]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/ruby.micro
Merge pull request #447 from samdmarshall/objective-c-syntax
[micro.git] / runtime / syntax / ruby.micro
1 ## Here is an example for Ruby.
2 ##
3 syntax "ruby" "\.rb$" "Gemfile" "config.ru" "Rakefile" "Capfile" "Vagrantfile"
4 header "^#!.*/(env +)?ruby( |$)"
5
6 ## Asciibetical list of reserved words
7 color 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"
8 ## Constants
9 color constant "(\$|@|@@)?\b[A-Z]+[0-9A-Z_a-z]*"
10 color constant.number "\b[0-9]+\b"
11 ## Ruby "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 ## Strings, single-quoted
26 color constant.string "'([^']|(\\'))*'" "%[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