Debian Codegraph @

runtime/syntax/ruby.yaml

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