Skip to content

Instantly share code, notes, and snippets.

@scholtes
Created September 21, 2016 03:18
Show Gist options
  • Save scholtes/81c53fded4e32c22e016189acd22df34 to your computer and use it in GitHub Desktop.
Save scholtes/81c53fded4e32c22e016189acd22df34 to your computer and use it in GitHub Desktop.
FRIL syntax highlighting for Sublime Text
%YAML 1.2
---
# HOW TO USE
#
# Save this as "...\AppData\roaming\Sublime Text 3\Packages\User\fril.sublime-syntax"
# or a similar folder location. The "Sublime Text 3\Packages\User" should already
# exist, so on other systems, you might try looking in:
#
# ~/Library/Application Support/......
# ~/Library/Preferences/......
# /var/lib/......
#
# http://www.sublimetext.com/docs/3/syntax.html
name: Fril
file_extensions:
- fril
- frl
scope: source.fril
contexts:
main:
- match: (%).*$\n?
scope: comment.line.percent.fril
captures:
1: punctuation.definition.comment.fril
- match: /\*
scope: punctuation.definition.comment.fril
push:
- meta_scope: comment.block.fril
- match: \*/\n?
scope: punctuation.definition.comment.fril
pop: true
- match: \b_|\||!\b
scope: keyword.control.logical.fril
- match: \?|!|tq(?=\()
scope: keyword.control.logical.fril
- match: \b(([A-Z][A-Z0-9][\w-]*)|([A-Z])|([A-Z]))\b
scope: entity.name.function.fril
- match: \b((abort|addcl|and|atomic|cd|cdict|charof|cl|close|complement|con|conj|convert|cos|cprintf|cputime|create|create_a|create_r|create_ra|cscanf|date|ddict|def|def_dtype|def_itype|def_rel|delcl|dempdict|dempster|dict|disj|division|dtype|dtype_name|dtype_to_freq|dtype_to_list|dynamic|edict|eq|errm|error|err_han|evlog|exists|exit|exp|expected_value|export|fail|fdict|file|filebcopy|filename|filepos|filesearch|findall|flush|fmem|forall|fset|fsetdict|fset_name|gen|general|gensym|get|getb|getenv|get_prior|get_univ|help|help_example|idict|if|import|init_random|int|intersection|intok|isall|itype|itype_name|itype_to_freq|itype_to_list|kb_garbage|kill|less|less_eq|list|listfile|lload|load|lreload|match|maximise_frame|mdict|module|module_initialisation|name|neg|negg|nospy|not|num|oh|open|or|orr|os|osc|ose|osv|p|peek|peekb|point_match|poss_match|power|pp|ppq|pq|prlen|pspaces|putb|qh|qs|qsc|qse|qsv|r|random|rdict|read|read_suppterm|reload|remainder|repeat|sc|se|set|setenv|set_difference|sh|sin|snips|spy|spying|square|statistics|stricteq|stringof|str_to_list|sum|supp_collect|supp_expect|supp_query|supp_value|sv|sys|system_garbage|tan|tempfile|times|tq|true|truncate|union|univ|univdict|univ_name|var|visible|w|wh|wq|write|writeq|ws|wse|wsc|wspaces|wsv))\b
scope: keyword.control.fril
- match: '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b'
scope: constant.numeric.fril
- match: \b(?<=\()\w*\b
scope: support.function.fril
- match: '"'
captures:
0: punctuation.definition.string.begin.fril
push:
- meta_scope: string.quoted.double.fril
- match: '"'
captures:
0: punctuation.definition.string.end.fril
pop: true
- match: \\.
scope: constant.character.escape.fril
- match: "'"
captures:
0: punctuation.definition.string.begin.fril
push:
- meta_scope: string.quoted.double.fril
- match: "'"
captures:
0: punctuation.definition.string.end.fril
pop: true
- match: \\.
scope: constant.character.escape.fril
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment