]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/ruby.yaml
Merge pull request #1412 from tommyshem/batSyntaxHighlighting
[micro.git] / runtime / syntax / ruby.yaml
1 filetype: ruby
2
3 detect: 
4     filename: "\\.rb$|\\.gemspec$|Gemfile|config.ru|Rakefile|Capfile|Vagrantfile"
5     header: "^#!.*/(env +)?ruby( |$)"
6
7 rules:
8     - statement: "\\b(BEGIN|END|alias|and|begin|break|case|class|def|defined\\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|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: "(i?)([         ]|^):[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: "'([^']|(\\\\'))*'|%[qw]\\{[^}]*\\}|%[qw]\\([^)]*\\)|%[qw]<[^>]*>|%[qw]\\[[^]]*\\]|%[qw]\\$[^$]*\\$|%[qw]\\^[^^]*\\^|%[qw]![^!]*!"
18     - comment: "#[^{].*$|#$"
19     - comment.bright: "##[^{].*$|##$"
20     - constant.macro:
21         start: "<<-?'?EOT'?"
22         end: "^EOT"
23         rules: []
24
25     - todo: "(XXX|TODO|FIXME|\\?\\?\\?)"
26     - preproc.shebang: "^#!.+?( |$)"