1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
filetype: ruby
detect:
filename: "\\.(rb|rake|gemspec)$|^(.*[\\/])?(Gemfile|config.ru|Rakefile|Capfile|Vagrantfile|Guardfile|Appfile|Fastfile|Pluginfile|Podfile|\\.?[Bb]rewfile)$"
header: "^#!.*/(env +)?ruby( |$)"
rules:
- comment.bright:
start: "##"
end: "$"
rules:
- todo: "(XXX|TODO|FIXME|BUG|\\?\\?\\?)"
- comment:
start: "#"
end: "$"
rules:
- todo: "(XXX|TODO|FIXME|BUG|\\?\\?\\?)"
- statement: "\\b(BEGIN|END|alias|and|begin|break|case|class|def|defined\\?|do|else|elsif|end|ensure|for|if|in|module|next|nil|not|or|private|protected|public|redo|rescue|retry|return|self|super|then|undef|unless|until|when|while|yield)\\b"
- constant: "(\\$|@|@@)?\\b[A-Z]+[0-9A-Z_a-z]*"
- constant.number: "(?i)\\b0x[0-9a-fA-F][0-9a-f_]*\\b"
- constant.number: "(?i)\\b0b[01][01_]*\\b"
- constant.number: "(?i)\\b[0-9][0-9_]*(['.'][0-9_]+)?(e[\\-]?[0-9_]+)?\\b"
# Predefined global variables
- constant:
start: "[$]([!@&`'+~=/\\\\,;.<>*$?:\"_]|-[A-Za-z0-9_]|[0-9]+)"
end: "\\B|\\b"
rules: []
# Ruby "Symbols"
- constant: "(i?)([ ]|^):[0-9A-Z_]+\\b"
- constant: "\\b(__FILE__|__LINE__)\\b"
- constant: "/([^/]|(\\\\/))*/[iomx]*|%r\\{([^}]|(\\\\}))*\\}[iomx]*"
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules: []
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- symbol.brackets:
start: "#\\{"
end: "\\}"
rules:
- default: ".*"
- constant.string.exec:
start: "`"
end: "`"
skip: "\\\\."
rules:
- symbol.brackets:
start: "#\\{"
end: "\\}"
rules:
- default: ".*"
- constant.string: "%[QW]?\\{[^}]*\\}|%[QW]?\\([^)]*\\)|%[QW]?<[^>]*>|%[QW]?\\[[^]]*\\]|%[QW]?\\$[^$]*\\$|%[QW]?\\^[^^]*\\^|%[QW]?![^!]*!"
- constant.string: "%[qw]\\{[^}]*\\}|%[qw]\\([^)]*\\)|%[qw]<[^>]*>|%[qw]\\[[^]]*\\]|%[qw]\\$[^$]*\\$|%[qw]\\^[^^]*\\^|%[qw]![^!]*!"
- constant.string.exec: "%[x]\\{[^}]*\\}|%[x]\\([^)]*\\)|%[x]<[^>]*>|%[x]\\[[^]]*\\]|%[x]\\$[^$]*\\$|%[x]\\^[^^]*\\^|%[x]![^!]*!"
- constant.bool: "\\b(true|false|nil|TRUE|FALSE|NIL)\\b"
- symbol.operator: "[-+/*=<>!~%&|^]|\\b:"
- symbol.brackets: "([(){}]|\\[|\\])"
- constant.macro:
start: "<<-?'?EOT'?"
end: "^EOT"
rules: []
- preproc.shebang: "^#!.+?( |$)"
|