]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/crystal.micro
Add mail syntax highlighting
[micro.git] / runtime / syntax / crystal.micro
1 ## Crystal Syntax file.
2 ##
3 syntax "crystal" "\.cr$" "Gemfile" "config.ru" "Rakefile" "Capfile" "Vagrantfile"
4 header "^#!.*/(env +)?crystal( |$)"
5
6 ## Asciibetical list of reserved words
7 color statement "\b(BEGIN|END|abstract|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|enum|false|for|fun|if|in|include|lib|loop|macro|module|next|nil|not|of|or|pointerof|private|protected|raise|redo|require|rescue|retry|return|self|sizeof|spawn|struct|super|then|true|type|undef|union|uninitialized|unless|until|when|while|yield)\b"
8 ## Constants
9 color constant "(\$|@|@@)?\b[A-Z]+[0-9A-Z_a-z]*"
10 color constant.number "\b[0-9]+\b"
11 ## Crystal "symbols"
12 color constant (i) "([  ]|^):[0-9A-Z_]+\b"
13 ## Some unique things we want to stand out
14 color constant "\b(__FILE__|__LINE__)\b"
15 ## Regular expressions
16 color constant "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*"
17 ## Shell command expansion is in `backticks` or like %x{this}.  These are
18 ## "double-quotish" (to use a perlism).
19 color constant.string "`[^`]*`" "%x\{[^}]*\}"
20 ## Strings, double-quoted
21 color constant.string ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
22 ## Expression substitution.  These go inside double-quoted strings,
23 ## "like #{this}".
24 color special "#\{[^}]*\}"
25 ## Characters are single-quoted
26 color constant.string.char "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
27 ## Comments
28 color comment "#[^{].*$" "#$"
29 color comment "##[^{].*$" "##$"
30 ## "Here" docs
31 color constant start="<<-?'?EOT'?" end="^EOT"
32 ## Some common markers
33 color todo "(XXX|TODO|FIXME|\?\?\?)"
34