]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/crystal.yaml
Add converted syntax files
[micro.git] / runtime / syntax / crystal.yaml
1 filetype: crystal
2
3 detect: 
4     filename: "\\.cr$|Gemfile|config.ru|Rakefile|Capfile|Vagrantfile"
5     header: "^#!.*/(env +)?crystal( |$)"
6
7 rules:
8     - 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"
9     - constant: "(\\$|@|@@)?\\b[A-Z]+[0-9A-Z_a-z]*"
10     - constant.number: "\\b[0-9]+\\b"
11     - constant: "([     ]|^):[0-9A-Z_]+\\b"
12     - constant: "\\b(__FILE__|__LINE__)\\b"
13     - constant: "/([^/]|(\\\\/))*/[iomx]*|%r\\{([^}]|(\\\\}))*\\}[iomx]*"
14     - constant.string: "`[^`]*`|%x\\{[^}]*\\}"
15     - constant.string: "\"([^\"]|(\\\\\"))*\"|%[QW]?\\{[^}]*\\}|%[QW]?\\([^)]*\\)|%[QW]?<[^>]*>|%[QW]?\\[[^]]*\\]|%[QW]?\\$[^$]*\\$|%[QW]?\\^[^^]*\\^|%[QW]?![^!]*!"
16     - special: "#\\{[^}]*\\}"
17     - constant.string.char: "'([^']|(\\\\'))*'|%[qw]\\{[^}]*\\}|%[qw]\\([^)]*\\)|%[qw]<[^>]*>|%[qw]\\[[^]]*\\]|%[qw]\\$[^$]*\\$|%[qw]\\^[^^]*\\^|%[qw]![^!]*!"
18     - comment: "#[^{].*$|#$"
19     - comment.bright: "##[^{].*$|##$"
20     - constant:
21         start: "<<-?'?EOT'?"
22         end: "^EOT"
23         rules: []
24
25     - todo: "(XXX|TODO|FIXME|\\?\\?\\?)"