code_rippa 0.0.7 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile.lock +36 -0
  3. data/LICENSE +2 -2
  4. data/README.md +18 -1
  5. data/bin/code_rippa +15 -16
  6. data/code_rippa.gemspec +12 -10
  7. data/lib/code_rippa.rb +69 -51
  8. data/lib/code_rippa/syntax/actionscript.syntax +52 -52
  9. data/lib/code_rippa/syntax/active4d.syntax +226 -180
  10. data/lib/code_rippa/syntax/active4d_html.syntax +163 -173
  11. data/lib/code_rippa/syntax/active4d_ini.syntax +34 -27
  12. data/lib/code_rippa/syntax/active4d_library.syntax +8 -15
  13. data/lib/code_rippa/syntax/ada.syntax +19 -18
  14. data/lib/code_rippa/syntax/antlr.syntax +85 -85
  15. data/lib/code_rippa/syntax/apache.syntax +103 -109
  16. data/lib/code_rippa/syntax/applescript.syntax +244 -229
  17. data/lib/code_rippa/syntax/asp.syntax +41 -36
  18. data/lib/code_rippa/syntax/asp_vb.net.syntax +77 -72
  19. data/lib/code_rippa/syntax/bibtex.syntax +88 -90
  20. data/lib/code_rippa/syntax/blog_html.syntax +17 -29
  21. data/lib/code_rippa/syntax/blog_markdown.syntax +17 -27
  22. data/lib/code_rippa/syntax/blog_text.syntax +15 -15
  23. data/lib/code_rippa/syntax/blog_textile.syntax +15 -15
  24. data/lib/code_rippa/syntax/build.syntax +27 -27
  25. data/lib/code_rippa/syntax/bulletin_board.syntax +159 -172
  26. data/lib/code_rippa/syntax/c.syntax +31 -34
  27. data/lib/code_rippa/syntax/cake.syntax +27 -27
  28. data/lib/code_rippa/syntax/camlp4.syntax +23 -23
  29. data/lib/code_rippa/syntax/cm.syntax +19 -18
  30. data/lib/code_rippa/syntax/coffeescript.syntax +134 -181
  31. data/lib/code_rippa/syntax/coldfusion.syntax +51 -60
  32. data/lib/code_rippa/syntax/context_free.syntax +106 -106
  33. data/lib/code_rippa/syntax/cs.syntax +31 -34
  34. data/lib/code_rippa/syntax/css.syntax +112 -112
  35. data/lib/code_rippa/syntax/css_experimental.syntax +1006 -1004
  36. data/lib/code_rippa/syntax/csv.syntax +40 -44
  37. data/lib/code_rippa/syntax/d.syntax +80 -84
  38. data/lib/code_rippa/syntax/diff.syntax +46 -45
  39. data/lib/code_rippa/syntax/dokuwiki.syntax +118 -119
  40. data/lib/code_rippa/syntax/dot.syntax +26 -26
  41. data/lib/code_rippa/syntax/doxygen.syntax +26 -26
  42. data/lib/code_rippa/syntax/dylan.syntax +35 -35
  43. data/lib/code_rippa/syntax/eiffel.syntax +39 -42
  44. data/lib/code_rippa/syntax/erlang.syntax +514 -511
  45. data/lib/code_rippa/syntax/f-script.syntax +44 -44
  46. data/lib/code_rippa/syntax/fortran.syntax +80 -76
  47. data/lib/code_rippa/syntax/fxscript.syntax +78 -77
  48. data/lib/code_rippa/syntax/greasemonkey.syntax +20 -20
  49. data/lib/code_rippa/syntax/gri.syntax +47 -47
  50. data/lib/code_rippa/syntax/groovy.syntax +105 -114
  51. data/lib/code_rippa/syntax/gtd.syntax +10 -10
  52. data/lib/code_rippa/syntax/gtdalt.syntax +83 -83
  53. data/lib/code_rippa/syntax/haml.syntax +50 -50
  54. data/lib/code_rippa/syntax/haskell.syntax +47 -47
  55. data/lib/code_rippa/syntax/html-asp.syntax +15 -15
  56. data/lib/code_rippa/syntax/html_django.syntax +15 -14
  57. data/lib/code_rippa/syntax/html_for_asp.net.syntax +232 -245
  58. data/lib/code_rippa/syntax/html_mason.syntax +75 -74
  59. data/lib/code_rippa/syntax/html_rails.syntax +17 -27
  60. data/lib/code_rippa/syntax/html_tcl.syntax +13 -13
  61. data/lib/code_rippa/syntax/icalendar.syntax +15 -15
  62. data/lib/code_rippa/syntax/inform.syntax +26 -26
  63. data/lib/code_rippa/syntax/ini.syntax +30 -30
  64. data/lib/code_rippa/syntax/installer_distribution_script.syntax +49 -49
  65. data/lib/code_rippa/syntax/io.syntax +49 -46
  66. data/lib/code_rippa/syntax/java.syntax +117 -126
  67. data/lib/code_rippa/syntax/javaproperties.syntax +13 -12
  68. data/lib/code_rippa/syntax/javascript.syntax +141 -141
  69. data/lib/code_rippa/syntax/javascript_+_prototype.syntax +42 -41
  70. data/lib/code_rippa/syntax/javascript_+_prototype_bracketed.syntax +92 -91
  71. data/lib/code_rippa/syntax/jquery_javascript.syntax +64 -64
  72. data/lib/code_rippa/syntax/json.syntax +39 -39
  73. data/lib/code_rippa/syntax/languagedefinition.syntax +373 -453
  74. data/lib/code_rippa/syntax/lexflex.syntax +136 -136
  75. data/lib/code_rippa/syntax/lighttpd.syntax +31 -31
  76. data/lib/code_rippa/syntax/lilypond.syntax +246 -337
  77. data/lib/code_rippa/syntax/lisp.syntax +32 -32
  78. data/lib/code_rippa/syntax/literate_haskell.syntax +12 -12
  79. data/lib/code_rippa/syntax/logo.syntax +13 -14
  80. data/lib/code_rippa/syntax/logtalk.syntax +81 -81
  81. data/lib/code_rippa/syntax/lua.syntax +50 -48
  82. data/lib/code_rippa/syntax/m.syntax +78 -78
  83. data/lib/code_rippa/syntax/macports_portfile.syntax +98 -97
  84. data/lib/code_rippa/syntax/makefile.syntax +19 -19
  85. data/lib/code_rippa/syntax/man.syntax +9 -9
  86. data/lib/code_rippa/syntax/mediawiki.syntax +311 -401
  87. data/lib/code_rippa/syntax/mips.syntax +34 -34
  88. data/lib/code_rippa/syntax/mod_perl.syntax +25 -31
  89. data/lib/code_rippa/syntax/modula-3.syntax +24 -24
  90. data/lib/code_rippa/syntax/moinmoin.syntax +102 -102
  91. data/lib/code_rippa/syntax/mootools.syntax +283 -300
  92. data/lib/code_rippa/syntax/movable_type.syntax +91 -90
  93. data/lib/code_rippa/syntax/multimarkdown.syntax +19 -30
  94. data/lib/code_rippa/syntax/objective-c++.syntax +6 -10
  95. data/lib/code_rippa/syntax/objective-c.syntax +134 -138
  96. data/lib/code_rippa/syntax/ocaml.syntax +455 -453
  97. data/lib/code_rippa/syntax/ocamllex.syntax +94 -93
  98. data/lib/code_rippa/syntax/ocamlyacc.syntax +98 -98
  99. data/lib/code_rippa/syntax/opengl.syntax +6 -6
  100. data/lib/code_rippa/syntax/pascal.syntax +43 -42
  101. data/lib/code_rippa/syntax/perl.syntax +612 -615
  102. data/lib/code_rippa/syntax/plain_text.syntax +17 -20
  103. data/lib/code_rippa/syntax/postscript.syntax +71 -69
  104. data/lib/code_rippa/syntax/processing.syntax +60 -60
  105. data/lib/code_rippa/syntax/prolog.syntax +17 -20
  106. data/lib/code_rippa/syntax/property_list.syntax +338 -359
  107. data/lib/code_rippa/syntax/python.syntax +487 -509
  108. data/lib/code_rippa/syntax/python_django.syntax +9 -10
  109. data/lib/code_rippa/syntax/qmake_project.syntax +67 -67
  110. data/lib/code_rippa/syntax/qt_c++.syntax +12 -15
  111. data/lib/code_rippa/syntax/quake3_config.syntax +18 -17
  112. data/lib/code_rippa/syntax/r.syntax +42 -42
  113. data/lib/code_rippa/syntax/r_console.syntax +7 -8
  114. data/lib/code_rippa/syntax/ragel.syntax +109 -115
  115. data/lib/code_rippa/syntax/rd_r_documentation.syntax +53 -53
  116. data/lib/code_rippa/syntax/regexp.syntax +26 -26
  117. data/lib/code_rippa/syntax/release_notes.syntax +46 -26
  118. data/lib/code_rippa/syntax/remind.syntax +146 -146
  119. data/lib/code_rippa/syntax/restructuredtext.syntax +132 -131
  120. data/lib/code_rippa/syntax/rez.syntax +46 -45
  121. data/lib/code_rippa/syntax/ruby.syntax +533 -601
  122. data/lib/code_rippa/syntax/ruby_experimental.syntax +82 -100
  123. data/lib/code_rippa/syntax/ruby_on_rails.syntax +56 -68
  124. data/lib/code_rippa/syntax/s5.syntax +35 -51
  125. data/lib/code_rippa/syntax/scheme.syntax +162 -260
  126. data/lib/code_rippa/syntax/scilab.syntax +18 -18
  127. data/lib/code_rippa/syntax/setext.syntax +82 -82
  128. data/lib/code_rippa/syntax/shell-unix-generic.syntax +227 -226
  129. data/lib/code_rippa/syntax/slate.syntax +91 -91
  130. data/lib/code_rippa/syntax/sql.syntax +137 -139
  131. data/lib/code_rippa/syntax/sql_rails.syntax +8 -8
  132. data/lib/code_rippa/syntax/ssh-config.syntax +17 -17
  133. data/lib/code_rippa/syntax/standard_ml.syntax +67 -69
  134. data/lib/code_rippa/syntax/strings_file.syntax +20 -23
  135. data/lib/code_rippa/syntax/subversion_commit_message.syntax +20 -20
  136. data/lib/code_rippa/syntax/sweave.syntax +45 -45
  137. data/lib/code_rippa/syntax/swig.syntax +34 -33
  138. data/lib/code_rippa/syntax/tcl.syntax +87 -86
  139. data/lib/code_rippa/syntax/template_toolkit.syntax +67 -65
  140. data/lib/code_rippa/syntax/textile.syntax +111 -145
  141. data/lib/code_rippa/syntax/tsv.syntax +31 -33
  142. data/lib/code_rippa/syntax/twiki.syntax +141 -141
  143. data/lib/code_rippa/syntax/txt2tags.syntax +39 -38
  144. data/lib/code_rippa/syntax/vectorscript.syntax +31 -31
  145. data/lib/code_rippa/syntax/xhtml_1.0.syntax +2297 -2296
  146. data/lib/code_rippa/syntax/xml.syntax +95 -95
  147. data/lib/code_rippa/syntax/xml_strict.syntax +49 -50
  148. data/lib/code_rippa/syntax/xsl.syntax +31 -31
  149. data/lib/code_rippa/syntax/yaml.syntax +86 -86
  150. data/lib/code_rippa/syntax/yaml_converter.rb +37 -0
  151. data/lib/code_rippa/syntax/yui_javascript.syntax +88 -88
  152. data/lib/code_rippa/version.rb +2 -2
  153. data/test/fixtures/hello.rb +5 -3
  154. data/test/test_private_methods.rb +40 -40
  155. data/test/test_public_methods.rb +9 -18
  156. metadata +61 -63
@@ -1,6 +1,6 @@
1
- ---
1
+ ---
2
2
  name: Ruby
3
- fileTypes:
3
+ fileTypes:
4
4
  - rb
5
5
  - rbx
6
6
  - rjs
@@ -9,1027 +9,959 @@ fileTypes:
9
9
  - cgi
10
10
  - fcgi
11
11
  - gemspec
12
- firstLineMatch: ^#!/.*\bruby\b
12
+ firstLineMatch: "^#!/.*\\bruby\\b"
13
13
  scopeName: source.ruby
14
- repository:
15
- nest_brackets:
16
- captures:
17
- "0":
14
+ repository:
15
+ nest_brackets:
16
+ captures:
17
+ '0':
18
18
  name: punctuation.section.scope.ruby
19
- begin: \[
20
- end: \]
21
- patterns:
19
+ begin: "\\["
20
+ end: "\\]"
21
+ patterns:
22
22
  - include: "#nest_brackets"
23
- interpolated_ruby:
24
- patterns:
23
+ interpolated_ruby:
24
+ patterns:
25
25
  - name: source.ruby.embedded.source
26
- captures:
27
- "0":
26
+ captures:
27
+ '0':
28
28
  name: punctuation.section.embedded.ruby
29
- "1":
29
+ '1':
30
30
  name: source.ruby.embedded.source.empty
31
31
  match: "#\\{(\\})"
32
32
  - name: source.ruby.embedded.source
33
- captures:
34
- "0":
33
+ captures:
34
+ '0':
35
35
  name: punctuation.section.embedded.ruby
36
36
  begin: "#\\{"
37
- end: \}
38
- patterns:
37
+ end: "\\}"
38
+ patterns:
39
39
  - include: "#nest_curly_and_self"
40
- - include: $self
40
+ - include: "$self"
41
41
  - name: variable.other.readwrite.instance.ruby
42
- captures:
43
- "1":
42
+ captures:
43
+ '1':
44
44
  name: punctuation.definition.variable.ruby
45
- match: (#@)[a-zA-Z_]\w*
45
+ match: "(#@)[a-zA-Z_]\\w*"
46
46
  - name: variable.other.readwrite.class.ruby
47
- captures:
48
- "1":
47
+ captures:
48
+ '1':
49
49
  name: punctuation.definition.variable.ruby
50
- match: (#@@)[a-zA-Z_]\w*
50
+ match: "(#@@)[a-zA-Z_]\\w*"
51
51
  - name: variable.other.readwrite.global.ruby
52
- captures:
53
- "1":
52
+ captures:
53
+ '1':
54
54
  name: punctuation.definition.variable.ruby
55
- match: (#\$)[a-zA-Z_]\w*
56
- escaped_char:
55
+ match: "(#\\$)[a-zA-Z_]\\w*"
56
+ escaped_char:
57
57
  name: constant.character.escape.ruby
58
- match: \\(?:0\d{1,2}|x[\da-fA-F]{1,2}|.)
59
- regex_sub:
60
- patterns:
58
+ match: "\\\\(?:0\\d{1,2}|x[\\da-fA-F]{1,2}|.)"
59
+ regex_sub:
60
+ patterns:
61
61
  - include: "#interpolated_ruby"
62
62
  - include: "#escaped_char"
63
63
  - name: string.regexp.arbitrary-repitition.ruby
64
- captures:
65
- "1":
64
+ captures:
65
+ '1':
66
66
  name: punctuation.definition.arbitrary-repitition.ruby
67
- "3":
67
+ '3':
68
68
  name: punctuation.definition.arbitrary-repitition.ruby
69
- match: (\{)\d+(,\d+)?(\})
69
+ match: "(\\{)\\d+(,\\d+)?(\\})"
70
70
  - name: string.regexp.character-class.ruby
71
- captures:
72
- "0":
71
+ captures:
72
+ '0':
73
73
  name: punctuation.definition.character-class.ruby
74
- begin: \[(?:\^?\])?
75
- end: \]
76
- patterns:
74
+ begin: "\\[(?:\\^?\\])?"
75
+ end: "\\]"
76
+ patterns:
77
77
  - include: "#escaped_char"
78
78
  - name: string.regexp.group.ruby
79
- captures:
80
- "0":
79
+ captures:
80
+ '0':
81
81
  name: punctuation.definition.group.ruby
82
- begin: \(
83
- end: \)
84
- patterns:
82
+ begin: "\\("
83
+ end: "\\)"
84
+ patterns:
85
85
  - include: "#regex_sub"
86
86
  - name: comment.line.number-sign.ruby
87
- captures:
88
- "1":
87
+ captures:
88
+ '1':
89
89
  name: punctuation.definition.comment.ruby
90
- match: (?<=^|\s)(#)\s[[a-zA-Z0-9,. \t?!-][^\x00-\x7F]]*$
91
- comment: We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.
92
- heredoc:
93
- begin: ^<<-?\w+
94
- end: $
95
- patterns:
96
- - include: $base
97
- nest_parens_r:
98
- captures:
99
- "0":
90
+ match: "(?<=^|\\s)(#)\\s[[a-zA-Z0-9,. \\t?!-][^\\x00-\\x7F]]*$"
91
+ comment: We are restrictive in what we allow to go after the comment character
92
+ to avoid false positives, since the availability of comments depend on regexp
93
+ flags.
94
+ heredoc:
95
+ begin: "^<<-?\\w+"
96
+ end: "$"
97
+ patterns:
98
+ - include: "$base"
99
+ nest_parens_r:
100
+ captures:
101
+ '0':
100
102
  name: punctuation.section.scope.ruby
101
- begin: \(
102
- end: \)
103
- patterns:
103
+ begin: "\\("
104
+ end: "\\)"
105
+ patterns:
104
106
  - include: "#regex_sub"
105
107
  - include: "#nest_parens_r"
106
- nest_curly_r:
107
- captures:
108
- "0":
108
+ nest_curly_r:
109
+ captures:
110
+ '0':
109
111
  name: punctuation.section.scope.ruby
110
- begin: \{
111
- end: \}
112
- patterns:
112
+ begin: "\\{"
113
+ end: "\\}"
114
+ patterns:
113
115
  - include: "#regex_sub"
114
116
  - include: "#nest_curly_r"
115
- nest_parens_i:
116
- captures:
117
- "0":
117
+ nest_parens_i:
118
+ captures:
119
+ '0':
118
120
  name: punctuation.section.scope.ruby
119
- begin: \(
120
- end: \)
121
- patterns:
121
+ begin: "\\("
122
+ end: "\\)"
123
+ patterns:
122
124
  - include: "#interpolated_ruby"
123
125
  - include: "#escaped_char"
124
126
  - include: "#nest_parens_i"
125
- nest_ltgt_r:
126
- captures:
127
- "0":
127
+ nest_ltgt_r:
128
+ captures:
129
+ '0':
128
130
  name: punctuation.section.scope.ruby
129
- begin: \<
130
- end: \>
131
- patterns:
131
+ begin: "\\<"
132
+ end: "\\>"
133
+ patterns:
132
134
  - include: "#regex_sub"
133
135
  - include: "#nest_ltgt_r"
134
- nest_curly_i:
135
- captures:
136
- "0":
136
+ nest_curly_i:
137
+ captures:
138
+ '0':
137
139
  name: punctuation.section.scope.ruby
138
- begin: \{
139
- end: \}
140
- patterns:
140
+ begin: "\\{"
141
+ end: "\\}"
142
+ patterns:
141
143
  - include: "#interpolated_ruby"
142
144
  - include: "#escaped_char"
143
145
  - include: "#nest_curly_i"
144
- nest_ltgt_i:
145
- captures:
146
- "0":
146
+ nest_ltgt_i:
147
+ captures:
148
+ '0':
147
149
  name: punctuation.section.scope.ruby
148
- begin: \<
149
- end: \>
150
- patterns:
150
+ begin: "\\<"
151
+ end: "\\>"
152
+ patterns:
151
153
  - include: "#interpolated_ruby"
152
154
  - include: "#escaped_char"
153
155
  - include: "#nest_ltgt_i"
154
- nest_ltgt:
155
- captures:
156
- "0":
156
+ nest_ltgt:
157
+ captures:
158
+ '0':
157
159
  name: punctuation.section.scope.ruby
158
- begin: \<
159
- end: \>
160
- patterns:
160
+ begin: "\\<"
161
+ end: "\\>"
162
+ patterns:
161
163
  - include: "#nest_ltgt"
162
- nest_curly_and_self:
163
- patterns:
164
- - captures:
165
- "0":
164
+ nest_curly_and_self:
165
+ patterns:
166
+ - captures:
167
+ '0':
166
168
  name: punctuation.section.scope.ruby
167
- begin: \{
168
- end: \}
169
- patterns:
169
+ begin: "\\{"
170
+ end: "\\}"
171
+ patterns:
170
172
  - include: "#nest_curly_and_self"
171
- - include: $self
172
- nest_parens:
173
- captures:
174
- "0":
173
+ - include: "$self"
174
+ nest_parens:
175
+ captures:
176
+ '0':
175
177
  name: punctuation.section.scope.ruby
176
- begin: \(
177
- end: \)
178
- patterns:
178
+ begin: "\\("
179
+ end: "\\)"
180
+ patterns:
179
181
  - include: "#nest_parens"
180
- nest_brackets_r:
181
- captures:
182
- "0":
182
+ nest_brackets_r:
183
+ captures:
184
+ '0':
183
185
  name: punctuation.section.scope.ruby
184
- begin: \[
185
- end: \]
186
- patterns:
186
+ begin: "\\["
187
+ end: "\\]"
188
+ patterns:
187
189
  - include: "#regex_sub"
188
190
  - include: "#nest_brackets_r"
189
- nest_curly:
190
- captures:
191
- "0":
191
+ nest_curly:
192
+ captures:
193
+ '0':
192
194
  name: punctuation.section.scope.ruby
193
- begin: \{
194
- end: \}
195
- patterns:
195
+ begin: "\\{"
196
+ end: "\\}"
197
+ patterns:
196
198
  - include: "#nest_curly"
197
- nest_brackets_i:
198
- captures:
199
- "0":
199
+ nest_brackets_i:
200
+ captures:
201
+ '0':
200
202
  name: punctuation.section.scope.ruby
201
- begin: \[
202
- end: \]
203
- patterns:
203
+ begin: "\\["
204
+ end: "\\]"
205
+ patterns:
204
206
  - include: "#interpolated_ruby"
205
207
  - include: "#escaped_char"
206
208
  - include: "#nest_brackets_i"
207
209
  uuid: E00B62AC-6B1C-11D9-9B1F-000D93589AF6
208
- foldingStartMarker: "(?x)^\n\
209
- \t (\\s*+\n\
210
- \t (module|class|def\n\
211
- \t |unless|if\n\
212
- \t |case\n\
213
- \t |begin\n\
214
- \t |for|while|until\n\
215
- \t\t\t |^=begin\n\
216
- \t |( \"(\\\\.|[^\"])*+\" # eat a double quoted string\n\
217
- \t | '(\\\\.|[^'])*+' # eat a single quoted string\n\
218
- \t | [^#\"'] # eat all but comments and strings\n\
219
- \t )*\n\
220
- \t ( \\s (do|begin|case)\n\
221
- \t | (?<!\\$)[-+=&|*/~%^<>~] \\s*+ (if|unless)\n\
222
- \t )\n\
223
- \t )\\b\n\
224
- \t (?! [^;]*+ ; .*? \\bend\\b )\n\
225
- \t |( \"(\\\\.|[^\"])*+\" # eat a double quoted string\n\
226
- \t | '(\\\\.|[^'])*+' # eat a single quoted string\n\
227
- \t | [^#\"'] # eat all but comments and strings\n\
228
- \t )*\n\
229
- \t ( \\{ (?! [^}]*+ \\} )\n\
230
- \t | \\[ (?! [^\\]]*+ \\] )\n\
231
- \t )\n\
232
- \t ).*$\n\
233
- \t| [#] .*? \\(fold\\) \\s*+ $ # Sune\xE2\x80\x99s special marker\n\
234
- \t"
235
- patterns:
210
+ foldingStartMarker: "(?x)^\n\t (\\s*+\n\t (module|class|def\n\t |unless|if\n\t
211
+ \ |case\n\t |begin\n\t |for|while|until\n\t\t\t |^=begin\n\t
212
+ \ |( \"(\\\\.|[^\"])*+\" # eat a double quoted string\n\t |
213
+ '(\\\\.|[^'])*+' # eat a single quoted string\n\t | [^#\"'] #
214
+ eat all but comments and strings\n\t )*\n\t ( \\s
215
+ \ (do|begin|case)\n\t | (?<!\\$)[-+=&|*/~%^<>~] \\s*+ (if|unless)\n\t )\n\t
216
+ \ )\\b\n\t (?! [^;]*+ ; .*? \\bend\\b )\n\t |( \"(\\\\.|[^\"])*+\"
217
+ \ # eat a double quoted string\n\t | '(\\\\.|[^'])*+' #
218
+ eat a single quoted string\n\t | [^#\"'] # eat all but
219
+ comments and strings\n\t )*\n\t ( \\{ (?! [^}]*+ \\} )\n\t | \\[ (?!
220
+ [^\\]]*+ \\] )\n\t )\n\t ).*$\n\t| [#] .*? \\(fold\\) \\s*+ $ #
221
+ Sune’s special marker\n\t"
222
+ patterns:
236
223
  - name: meta.class.ruby
237
- captures:
238
- "6":
224
+ captures:
225
+ '6':
239
226
  name: variable.other.object.ruby
240
- "7":
227
+ '7':
241
228
  name: punctuation.definition.variable.ruby
242
- "1":
229
+ '1':
243
230
  name: keyword.control.class.ruby
244
- "2":
231
+ '2':
245
232
  name: entity.name.type.class.ruby
246
- "4":
233
+ '4':
247
234
  name: entity.other.inherited-class.ruby
248
- "5":
235
+ '5':
249
236
  name: punctuation.separator.inheritance.ruby
250
- match: ^\s*(class)\s+(([.a-zA-Z0-9_:]+(\s*(<)\s*[.a-zA-Z0-9_:]+)?)|((<<)\s*[.a-zA-Z0-9_:]+))
237
+ match: "^\\s*(class)\\s+(([.a-zA-Z0-9_:]+(\\s*(<)\\s*[.a-zA-Z0-9_:]+)?)|((<<)\\s*[.a-zA-Z0-9_:]+))"
251
238
  - name: meta.module.ruby
252
- captures:
253
- "6":
239
+ captures:
240
+ '6':
254
241
  name: punctuation.separator.inheritance.ruby
255
- "7":
242
+ '7':
256
243
  name: entity.other.inherited-class.module.third.ruby
257
- "8":
244
+ '8':
258
245
  name: punctuation.separator.inheritance.ruby
259
- "1":
246
+ '1':
260
247
  name: keyword.control.module.ruby
261
- "2":
248
+ '2':
262
249
  name: entity.name.type.module.ruby
263
- "3":
250
+ '3':
264
251
  name: entity.other.inherited-class.module.first.ruby
265
- "4":
252
+ '4':
266
253
  name: punctuation.separator.inheritance.ruby
267
- "5":
254
+ '5':
268
255
  name: entity.other.inherited-class.module.second.ruby
269
- match: ^\s*(module)\s+(([A-Z]\w*(::))?([A-Z]\w*(::))?([A-Z]\w*(::))*[A-Z]\w*)
256
+ match: "^\\s*(module)\\s+(([A-Z]\\w*(::))?([A-Z]\\w*(::))?([A-Z]\\w*(::))*[A-Z]\\w*)"
270
257
  - name: invalid.deprecated.ruby
271
- match: (?<!\.)\belse(\s)+if\b
272
- comment: "else if is a common mistake carried over from other languages. it works if you put in a second end, but it\xE2\x80\x99s never what you want."
258
+ match: "(?<!\\.)\\belse(\\s)+if\\b"
259
+ comment: else if is a common mistake carried over from other languages. it works
260
+ if you put in a second end, but it’s never what you want.
273
261
  - name: keyword.control.ruby
274
- match: (?<!\.)\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|for|if|in|module|rescue|then|unless|until|when|while)\b(?![?!])
262
+ match: "(?<!\\.)\\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|for|if|in|module|rescue|then|unless|until|when|while)\\b(?![?!])"
275
263
  comment: everything being a reserved word, not a value and needing a 'end' is a..
276
264
  - name: keyword.control.ruby.start-block
277
- match: (?<!\.)\bdo\b\s*
265
+ match: "(?<!\\.)\\bdo\\b\\s*"
278
266
  comment: contextual smart pair support for block parameters
279
267
  - name: meta.syntax.ruby.start-block
280
- match: (?<=\{)(\s+)
268
+ match: "(?<=\\{)(\\s+)"
281
269
  comment: contextual smart pair support
282
270
  - name: keyword.operator.logical.ruby
283
- match: (?<!\.)\b(and|not|or)\b
271
+ match: "(?<!\\.)\\b(and|not|or)\\b"
284
272
  comment: " as above, just doesn't need a 'end' and does a logic operation"
285
273
  - name: keyword.control.pseudo-method.ruby
286
- match: (?<!\.)\b(alias|alias_method|break|next|redo|retry|return|super|undef|yield)\b(?![?!])|\bdefined\?|\bblock_given\?
274
+ match: "(?<!\\.)\\b(alias|alias_method|break|next|redo|retry|return|super|undef|yield)\\b(?![?!])|\\bdefined\\?|\\bblock_given\\?"
287
275
  comment: " just as above but being not a logical operation"
288
276
  - name: constant.language.ruby
289
- match: \b(nil|true|false)\b(?![?!])
277
+ match: "\\b(nil|true|false)\\b(?![?!])"
290
278
  - name: variable.language.ruby
291
- match: \b(__(FILE|LINE)__|self)\b(?![?!])
279
+ match: "\\b(__(FILE|LINE)__|self)\\b(?![?!])"
292
280
  - name: keyword.other.special-method.ruby
293
- match: \b(initialize|new|loop|include|extend|raise|attr_reader|attr_writer|attr_accessor|attr|catch|throw|private|module_function|public|protected)\b(?![?!])
281
+ match: "\\b(initialize|new|loop|include|extend|raise|attr_reader|attr_writer|attr_accessor|attr|catch|throw|private|module_function|public|protected)\\b(?![?!])"
294
282
  comment: " everything being a method but having a special function is a.."
295
283
  - name: meta.require.ruby
296
- captures:
297
- "1":
284
+ captures:
285
+ '1':
298
286
  name: keyword.other.special-method.ruby
299
- begin: \b(require)\b
300
- end: $|(?=#)
301
- patterns:
302
- - include: $base
287
+ begin: "\\b(require)\\b"
288
+ end: "$|(?=#)"
289
+ patterns:
290
+ - include: "$base"
303
291
  - name: variable.other.readwrite.instance.ruby
304
- captures:
305
- "1":
292
+ captures:
293
+ '1':
306
294
  name: punctuation.definition.variable.ruby
307
- match: (@)[a-zA-Z_]\w*
295
+ match: "(@)[a-zA-Z_]\\w*"
308
296
  - name: variable.other.readwrite.class.ruby
309
- captures:
310
- "1":
297
+ captures:
298
+ '1':
311
299
  name: punctuation.definition.variable.ruby
312
- match: (@@)[a-zA-Z_]\w*
300
+ match: "(@@)[a-zA-Z_]\\w*"
313
301
  - name: variable.other.readwrite.global.ruby
314
- captures:
315
- "1":
302
+ captures:
303
+ '1':
316
304
  name: punctuation.definition.variable.ruby
317
- match: (\$)[a-zA-Z_]\w*
305
+ match: "(\\$)[a-zA-Z_]\\w*"
318
306
  - name: variable.other.readwrite.global.pre-defined.ruby
319
- captures:
320
- "1":
307
+ captures:
308
+ '1':
321
309
  name: punctuation.definition.variable.ruby
322
- match: (\$)(!|@|&|`|'|\+|\d|~|=|/|\\|,|;|\.|<|>|_|\*|\$|\?|:|"|-[0adFiIlpv])
310
+ match: "(\\$)(!|@|&|`|'|\\+|\\d|~|=|/|\\\\|,|;|\\.|<|>|_|\\*|\\$|\\?|:|\"|-[0adFiIlpv])"
323
311
  - name: support.class.ruby
324
- match: \b[A-Z][a-z]\w*(?=((\.|::)[A-Za-z]|\[))
312
+ match: "\\b[A-Z][a-z]\\w*(?=((\\.|::)[A-Za-z]|\\[))"
325
313
  - name: meta.environment-variable.ruby
326
- begin: \b(ENV)\[
327
- beginCaptures:
328
- "1":
314
+ begin: "\\b(ENV)\\["
315
+ beginCaptures:
316
+ '1':
329
317
  name: variable.other.constant.ruby
330
- end: \]
331
- patterns:
332
- - include: $self
318
+ end: "\\]"
319
+ patterns:
320
+ - include: "$self"
333
321
  - name: variable.other.constant.ruby
334
- match: \b[A-Z]\w*\b
322
+ match: "\\b[A-Z]\\w*\\b"
335
323
  - name: meta.function.method.with-arguments.ruby
336
- endCaptures:
337
- "0":
324
+ endCaptures:
325
+ '0':
338
326
  name: punctuation.definition.parameters.ruby
339
- begin: (?<=^|\s)\b(def)\b\s+((?>[a-zA-Z_]\w*(?>\.|::))?(?>[a-zA-Z_]\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?))\s*(\()
327
+ begin: "(?<=^|\\s)\\b(def)\\b\\s+((?>[a-zA-Z_]\\w*(?>\\.|::))?(?>[a-zA-Z_]\\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[\\]=?))\\s*(\\()"
340
328
  contentName: variable.parameter.function.ruby
341
- beginCaptures:
342
- "1":
329
+ beginCaptures:
330
+ '1':
343
331
  name: keyword.control.def.ruby
344
- "2":
332
+ '2':
345
333
  name: entity.name.function.ruby
346
- "3":
334
+ '3':
347
335
  name: punctuation.definition.parameters.ruby
348
- end: \)
349
- patterns:
350
- - include: $base
336
+ end: "\\)"
337
+ patterns:
338
+ - include: "$base"
351
339
  comment: " the method pattern comes from the symbol pattern, see there for a explaination"
352
340
  - name: meta.function.method.without-arguments.ruby
353
- captures:
354
- "1":
341
+ captures:
342
+ '1':
355
343
  name: keyword.control.def.ruby
356
- "3":
344
+ '3':
357
345
  name: entity.name.function.ruby
358
- match: (?<=^|\s)(def)\b(\s+((?>[a-zA-Z_]\w*(?>\.|::))?(?>[a-zA-Z_]\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?)))?
346
+ match: "(?<=^|\\s)(def)\\b(\\s+((?>[a-zA-Z_]\\w*(?>\\.|::))?(?>[a-zA-Z_]\\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[\\]=?)))?"
359
347
  comment: " the optional name is just to catch the def also without a method-name"
360
348
  - name: constant.numeric.ruby
361
- match: \b(0[xX]\h(?>_?\h)*|\d(?>_?\d)*(\.(?![^[:space:][:digit:]])(?>_?\d)*)?([eE][-+]?\d(?>_?\d)*)?|0[bB][01]+)\b
349
+ match: "\\b(0[xX]\\h(?>_?\\h)*|\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?|0[bB][01]+)\\b"
362
350
  - name: constant.other.symbol.single-quoted.ruby
363
- captures:
364
- "0":
351
+ captures:
352
+ '0':
365
353
  name: punctuation.definition.constant.ruby
366
354
  begin: ":'"
367
355
  end: "'"
368
- patterns:
356
+ patterns:
369
357
  - name: constant.character.escape.ruby
370
- match: \\['\\]
358
+ match: "\\\\['\\\\]"
371
359
  - name: constant.other.symbol.double-quoted.ruby
372
- captures:
373
- "0":
360
+ captures:
361
+ '0':
374
362
  name: punctuation.definition.constant.ruby
375
363
  begin: ":\""
376
364
  end: "\""
377
- patterns:
365
+ patterns:
378
366
  - include: "#interpolated_ruby"
379
367
  - include: "#escaped_char"
380
368
  - name: string.quoted.single.ruby
381
- endCaptures:
382
- "0":
369
+ endCaptures:
370
+ '0':
383
371
  name: punctuation.definition.string.end.ruby
384
372
  begin: "'"
385
- beginCaptures:
386
- "0":
373
+ beginCaptures:
374
+ '0':
387
375
  name: punctuation.definition.string.begin.ruby
388
376
  end: "'"
389
- patterns:
377
+ patterns:
390
378
  - name: constant.character.escape.ruby
391
- match: \\'|\\\\
379
+ match: "\\\\'|\\\\\\\\"
392
380
  comment: single quoted string (does not allow interpolation)
393
381
  - name: string.quoted.double.ruby
394
- endCaptures:
395
- "0":
382
+ endCaptures:
383
+ '0':
396
384
  name: punctuation.definition.string.end.ruby
397
385
  begin: "\""
398
- beginCaptures:
399
- "0":
386
+ beginCaptures:
387
+ '0':
400
388
  name: punctuation.definition.string.begin.ruby
401
389
  end: "\""
402
- patterns:
390
+ patterns:
403
391
  - include: "#interpolated_ruby"
404
392
  - include: "#escaped_char"
405
393
  comment: double quoted string (allows for interpolation)
406
394
  - name: string.interpolated.ruby
407
- endCaptures:
408
- "0":
395
+ endCaptures:
396
+ '0':
409
397
  name: punctuation.definition.string.end.ruby
410
- begin: `
411
- beginCaptures:
412
- "0":
398
+ begin: "`"
399
+ beginCaptures:
400
+ '0':
413
401
  name: punctuation.definition.string.begin.ruby
414
- end: `
415
- patterns:
402
+ end: "`"
403
+ patterns:
416
404
  - include: "#interpolated_ruby"
417
405
  - include: "#escaped_char"
418
406
  comment: execute string (allows for interpolation)
419
407
  - name: string.interpolated.ruby
420
- endCaptures:
421
- "0":
408
+ endCaptures:
409
+ '0':
422
410
  name: punctuation.definition.string.end.ruby
423
411
  begin: "%x\\{"
424
- beginCaptures:
425
- "0":
412
+ beginCaptures:
413
+ '0':
426
414
  name: punctuation.definition.string.begin.ruby
427
- end: \}
428
- patterns:
415
+ end: "\\}"
416
+ patterns:
429
417
  - include: "#interpolated_ruby"
430
418
  - include: "#escaped_char"
431
419
  - include: "#nest_curly_i"
432
420
  comment: execute string (allow for interpolation)
433
421
  - name: string.interpolated.ruby
434
- endCaptures:
435
- "0":
422
+ endCaptures:
423
+ '0':
436
424
  name: punctuation.definition.string.end.ruby
437
425
  begin: "%x\\["
438
- beginCaptures:
439
- "0":
426
+ beginCaptures:
427
+ '0':
440
428
  name: punctuation.definition.string.begin.ruby
441
- end: \]
442
- patterns:
429
+ end: "\\]"
430
+ patterns:
443
431
  - include: "#interpolated_ruby"
444
432
  - include: "#escaped_char"
445
433
  - include: "#nest_brackets_i"
446
434
  comment: execute string (allow for interpolation)
447
435
  - name: string.interpolated.ruby
448
- endCaptures:
449
- "0":
436
+ endCaptures:
437
+ '0':
450
438
  name: punctuation.definition.string.end.ruby
451
439
  begin: "%x\\<"
452
- beginCaptures:
453
- "0":
440
+ beginCaptures:
441
+ '0':
454
442
  name: punctuation.definition.string.begin.ruby
455
- end: \>
456
- patterns:
443
+ end: "\\>"
444
+ patterns:
457
445
  - include: "#interpolated_ruby"
458
446
  - include: "#escaped_char"
459
447
  - include: "#nest_ltgt_i"
460
448
  comment: execute string (allow for interpolation)
461
449
  - name: string.interpolated.ruby
462
- endCaptures:
463
- "0":
450
+ endCaptures:
451
+ '0':
464
452
  name: punctuation.definition.string.end.ruby
465
453
  begin: "%x\\("
466
- beginCaptures:
467
- "0":
454
+ beginCaptures:
455
+ '0':
468
456
  name: punctuation.definition.string.begin.ruby
469
- end: \)
470
- patterns:
457
+ end: "\\)"
458
+ patterns:
471
459
  - include: "#interpolated_ruby"
472
460
  - include: "#escaped_char"
473
461
  - include: "#nest_parens_i"
474
462
  comment: execute string (allow for interpolation)
475
463
  - name: string.interpolated.ruby
476
- endCaptures:
477
- "0":
464
+ endCaptures:
465
+ '0':
478
466
  name: punctuation.definition.string.end.ruby
479
467
  begin: "%x([^\\w])"
480
- beginCaptures:
481
- "0":
468
+ beginCaptures:
469
+ '0':
482
470
  name: punctuation.definition.string.begin.ruby
483
- end: \1
484
- patterns:
471
+ end: "\\1"
472
+ patterns:
485
473
  - include: "#interpolated_ruby"
486
474
  - include: "#escaped_char"
487
475
  comment: execute string (allow for interpolation)
488
- - captures:
489
- "1":
476
+ - captures:
477
+ '1':
490
478
  name: string.regexp.classic.ruby
491
- "2":
479
+ '2':
492
480
  name: punctuation.definition.string.ruby
493
- begin: "(?x)\n\
494
- \t\t\t (?:\n\
495
- \t\t\t ^ # beginning of line\n\
496
- \t\t\t | (?<= # or look-behind on:\n\
497
- \t\t\t [=>~(?:\\[,|&]\n\
498
- \t\t\t | (?:\\s|;)when\\s\n\
499
- \t\t\t | (?:\\s|;)or\\s\n\
500
- \t\t\t | (?:\\s|;)and\\s\n\
501
- \t\t\t | (?:\\s|;|\\.)index\\s\n\
502
- \t\t\t | (?:\\s|;|\\.)scan\\s\n\
503
- \t\t\t | (?:\\s|;|\\.)sub\\s\n\
504
- \t\t\t | (?:\\s|l|\\.)sub!\\s\n\
505
- \t\t\t | (?:\\s|;|\\.)gsub\\s\n\
506
- \t\t\t | (?:\\s|;|\\.)gsub!\\s\n\
507
- \t\t\t | (?:\\s|;|\\.)match\\s\n\
508
- \t\t\t | (?:\\s|;)if\\s\n\
509
- \t\t\t | (?:\\s|;)elsif\\s\n\
510
- \t\t\t | (?:\\s|;)while\\s\n\
511
- \t\t\t | (?:\\s|;)unless\\s\n\
512
- \t\t\t )\n\
513
- \t\t\t | (?<= # or a look-behind with line anchor:\n\
514
- \t\t\t ^when\\s # duplication necessary due to limits of regex\n\
515
- \t\t\t | ^index\\s\n\
516
- \t\t\t | ^scan\\s\n\
517
- \t\t\t | ^sub\\s\n\
518
- \t\t\t | ^gsub\\s\n\
519
- \t\t\t | ^sub!\\s\n\
520
- \t\t\t | ^gsub!\\s\n\
521
- \t\t\t | ^match\\s\n\
522
- \t\t\t | ^if\\s\n\
523
- \t\t\t | ^elsif\\s\n\
524
- \t\t\t | ^while\\s\n\
525
- \t\t\t | ^unless\\s\n\
526
- \t\t\t )\n\
527
- \t\t\t )\n\
528
- \t\t\t \\s*((/))(?![*+{}?])\n\
529
- \t\t\t"
481
+ begin: "(?x)\n\t\t\t (?:\n\t\t\t ^ # beginning of line\n\t\t\t
482
+ \ | (?<= # or look-behind on:\n\t\t\t [=>~(?:\\[,|&]\n\t\t\t
483
+ \ | (?:\\s|;)when\\s\n\t\t\t | (?:\\s|;)or\\s\n\t\t\t | (?:\\s|;)and\\s\n\t\t\t
484
+ \ | (?:\\s|;|\\.)index\\s\n\t\t\t | (?:\\s|;|\\.)scan\\s\n\t\t\t |
485
+ (?:\\s|;|\\.)sub\\s\n\t\t\t | (?:\\s|l|\\.)sub!\\s\n\t\t\t | (?:\\s|;|\\.)gsub\\s\n\t\t\t
486
+ \ | (?:\\s|;|\\.)gsub!\\s\n\t\t\t | (?:\\s|;|\\.)match\\s\n\t\t\t |
487
+ (?:\\s|;)if\\s\n\t\t\t | (?:\\s|;)elsif\\s\n\t\t\t | (?:\\s|;)while\\s\n\t\t\t
488
+ \ | (?:\\s|;)unless\\s\n\t\t\t )\n\t\t\t | (?<= # or
489
+ a look-behind with line anchor:\n\t\t\t ^when\\s # duplication
490
+ necessary due to limits of regex\n\t\t\t | ^index\\s\n\t\t\t | ^scan\\s\n\t\t\t
491
+ \ | ^sub\\s\n\t\t\t | ^gsub\\s\n\t\t\t | ^sub!\\s\n\t\t\t |
492
+ ^gsub!\\s\n\t\t\t | ^match\\s\n\t\t\t | ^if\\s\n\t\t\t | ^elsif\\s\n\t\t\t
493
+ \ | ^while\\s\n\t\t\t | ^unless\\s\n\t\t\t )\n\t\t\t )\n\t\t\t
494
+ \ \\s*((/))(?![*+{}?])\n\t\t\t"
530
495
  contentName: string.regexp.classic.ruby
531
- end: ((/[eimnosux]*))
532
- patterns:
496
+ end: "((/[eimnosux]*))"
497
+ patterns:
533
498
  - include: "#regex_sub"
534
- comment: "regular expressions (normal)\n\
535
- \t\t\twe only start a regexp if the character before it (excluding whitespace)\n\
536
- \t\t\tis what we think is before a regexp\n\
537
- \t\t\t"
499
+ comment: "regular expressions (normal)\n\t\t\twe only start a regexp if the character
500
+ before it (excluding whitespace)\n\t\t\tis what we think is before a regexp\n\t\t\t"
538
501
  - name: string.regexp.mod-r.ruby
539
- endCaptures:
540
- "0":
502
+ endCaptures:
503
+ '0':
541
504
  name: punctuation.definition.string.end.ruby
542
505
  begin: "%r\\{"
543
- beginCaptures:
544
- "0":
506
+ beginCaptures:
507
+ '0':
545
508
  name: punctuation.definition.string.begin.ruby
546
- end: \}[eimnosux]*
547
- patterns:
509
+ end: "\\}[eimnosux]*"
510
+ patterns:
548
511
  - include: "#regex_sub"
549
512
  - include: "#nest_curly_r"
550
513
  comment: regular expressions (literal)
551
514
  - name: string.regexp.mod-r.ruby
552
- endCaptures:
553
- "0":
515
+ endCaptures:
516
+ '0':
554
517
  name: punctuation.definition.string.end.ruby
555
518
  begin: "%r\\["
556
- beginCaptures:
557
- "0":
519
+ beginCaptures:
520
+ '0':
558
521
  name: punctuation.definition.string.begin.ruby
559
- end: \][eimnosux]*
560
- patterns:
522
+ end: "\\][eimnosux]*"
523
+ patterns:
561
524
  - include: "#regex_sub"
562
525
  - include: "#nest_brackets_r"
563
526
  comment: regular expressions (literal)
564
527
  - name: string.regexp.mod-r.ruby
565
- endCaptures:
566
- "0":
528
+ endCaptures:
529
+ '0':
567
530
  name: punctuation.definition.string.end.ruby
568
531
  begin: "%r\\("
569
- beginCaptures:
570
- "0":
532
+ beginCaptures:
533
+ '0':
571
534
  name: punctuation.definition.string.begin.ruby
572
- end: \)[eimnosux]*
573
- patterns:
535
+ end: "\\)[eimnosux]*"
536
+ patterns:
574
537
  - include: "#regex_sub"
575
538
  - include: "#nest_parens_r"
576
539
  comment: regular expressions (literal)
577
540
  - name: string.regexp.mod-r.ruby
578
- endCaptures:
579
- "0":
541
+ endCaptures:
542
+ '0':
580
543
  name: punctuation.definition.string.end.ruby
581
544
  begin: "%r\\<"
582
- beginCaptures:
583
- "0":
545
+ beginCaptures:
546
+ '0':
584
547
  name: punctuation.definition.string.begin.ruby
585
- end: \>[eimnosux]*
586
- patterns:
548
+ end: "\\>[eimnosux]*"
549
+ patterns:
587
550
  - include: "#regex_sub"
588
551
  - include: "#nest_ltgt_r"
589
552
  comment: regular expressions (literal)
590
553
  - name: string.regexp.mod-r.ruby
591
- endCaptures:
592
- "0":
554
+ endCaptures:
555
+ '0':
593
556
  name: punctuation.definition.string.end.ruby
594
557
  begin: "%r([^\\w])"
595
- beginCaptures:
596
- "0":
558
+ beginCaptures:
559
+ '0':
597
560
  name: punctuation.definition.string.begin.ruby
598
- end: \1[eimnosux]*
599
- patterns:
561
+ end: "\\1[eimnosux]*"
562
+ patterns:
600
563
  - include: "#regex_sub"
601
564
  comment: regular expressions (literal)
602
565
  - name: string.quoted.other.literal.upper.ruby
603
- endCaptures:
604
- "0":
566
+ endCaptures:
567
+ '0':
605
568
  name: punctuation.definition.string.end.ruby
606
569
  begin: "%[QWSR]?\\("
607
- beginCaptures:
608
- "0":
570
+ beginCaptures:
571
+ '0':
609
572
  name: punctuation.definition.string.begin.ruby
610
- end: \)
611
- patterns:
573
+ end: "\\)"
574
+ patterns:
612
575
  - include: "#interpolated_ruby"
613
576
  - include: "#escaped_char"
614
577
  - include: "#nest_parens_i"
615
578
  comment: literal capable of interpolation ()
616
579
  - name: string.quoted.other.literal.upper.ruby
617
- endCaptures:
618
- "0":
580
+ endCaptures:
581
+ '0':
619
582
  name: punctuation.definition.string.end.ruby
620
583
  begin: "%[QWSR]?\\["
621
- beginCaptures:
622
- "0":
584
+ beginCaptures:
585
+ '0':
623
586
  name: punctuation.definition.string.begin.ruby
624
- end: \]
625
- patterns:
587
+ end: "\\]"
588
+ patterns:
626
589
  - include: "#interpolated_ruby"
627
590
  - include: "#escaped_char"
628
591
  - include: "#nest_brackets_i"
629
592
  comment: literal capable of interpolation []
630
593
  - name: string.quoted.other.literal.upper.ruby
631
- endCaptures:
632
- "0":
594
+ endCaptures:
595
+ '0':
633
596
  name: punctuation.definition.string.end.ruby
634
597
  begin: "%[QWSR]?\\<"
635
- beginCaptures:
636
- "0":
598
+ beginCaptures:
599
+ '0':
637
600
  name: punctuation.definition.string.begin.ruby
638
- end: \>
639
- patterns:
601
+ end: "\\>"
602
+ patterns:
640
603
  - include: "#interpolated_ruby"
641
604
  - include: "#escaped_char"
642
605
  - include: "#nest_ltgt_i"
643
606
  comment: literal capable of interpolation <>
644
607
  - name: string.quoted.double.ruby.mod
645
- endCaptures:
646
- "0":
608
+ endCaptures:
609
+ '0':
647
610
  name: punctuation.definition.string.end.ruby
648
611
  begin: "%[QWSR]?\\{"
649
- beginCaptures:
650
- "0":
612
+ beginCaptures:
613
+ '0':
651
614
  name: punctuation.definition.string.begin.ruby
652
- end: \}
653
- patterns:
615
+ end: "\\}"
616
+ patterns:
654
617
  - include: "#interpolated_ruby"
655
618
  - include: "#escaped_char"
656
619
  - include: "#nest_curly_i"
657
620
  comment: literal capable of interpolation -- {}
658
621
  - name: string.quoted.other.literal.upper.ruby
659
- endCaptures:
660
- "0":
622
+ endCaptures:
623
+ '0':
661
624
  name: punctuation.definition.string.end.ruby
662
625
  begin: "%[QWSR]([^\\w])"
663
- beginCaptures:
664
- "0":
626
+ beginCaptures:
627
+ '0':
665
628
  name: punctuation.definition.string.begin.ruby
666
- end: \1
667
- patterns:
629
+ end: "\\1"
630
+ patterns:
668
631
  - include: "#interpolated_ruby"
669
632
  - include: "#escaped_char"
670
633
  comment: literal capable of interpolation -- wildcard
671
634
  - name: string.quoted.other.literal.other.ruby
672
- endCaptures:
673
- "0":
635
+ endCaptures:
636
+ '0':
674
637
  name: punctuation.definition.string.end.ruby
675
638
  begin: "%([^\\w\\s=])"
676
- beginCaptures:
677
- "0":
639
+ beginCaptures:
640
+ '0':
678
641
  name: punctuation.definition.string.begin.ruby
679
- end: \1
680
- patterns:
642
+ end: "\\1"
643
+ patterns:
681
644
  - include: "#interpolated_ruby"
682
645
  - include: "#escaped_char"
683
646
  comment: literal capable of interpolation -- wildcard
684
647
  - name: string.quoted.other.literal.lower.ruby
685
- endCaptures:
686
- "0":
648
+ endCaptures:
649
+ '0':
687
650
  name: punctuation.definition.string.end.ruby
688
651
  begin: "%[qws]\\("
689
- beginCaptures:
690
- "0":
652
+ beginCaptures:
653
+ '0':
691
654
  name: punctuation.definition.string.begin.ruby
692
- end: \)
693
- patterns:
655
+ end: "\\)"
656
+ patterns:
694
657
  - name: constant.character.escape.ruby
695
- match: \\\)|\\\\
658
+ match: "\\\\\\)|\\\\\\\\"
696
659
  - include: "#nest_parens"
697
660
  comment: literal incapable of interpolation -- ()
698
661
  - name: string.quoted.other.literal.lower.ruby
699
- endCaptures:
700
- "0":
662
+ endCaptures:
663
+ '0':
701
664
  name: punctuation.definition.string.end.ruby
702
665
  begin: "%[qws]\\<"
703
- beginCaptures:
704
- "0":
666
+ beginCaptures:
667
+ '0':
705
668
  name: punctuation.definition.string.begin.ruby
706
- end: \>
707
- patterns:
669
+ end: "\\>"
670
+ patterns:
708
671
  - name: constant.character.escape.ruby
709
- match: \\\>|\\\\
672
+ match: "\\\\\\>|\\\\\\\\"
710
673
  - include: "#nest_ltgt"
711
674
  comment: literal incapable of interpolation -- <>
712
675
  - name: string.quoted.other.literal.lower.ruby
713
- endCaptures:
714
- "0":
676
+ endCaptures:
677
+ '0':
715
678
  name: punctuation.definition.string.end.ruby
716
679
  begin: "%[qws]\\["
717
- beginCaptures:
718
- "0":
680
+ beginCaptures:
681
+ '0':
719
682
  name: punctuation.definition.string.begin.ruby
720
- end: \]
721
- patterns:
683
+ end: "\\]"
684
+ patterns:
722
685
  - name: constant.character.escape.ruby
723
- match: \\\]|\\\\
686
+ match: "\\\\\\]|\\\\\\\\"
724
687
  - include: "#nest_brackets"
725
688
  comment: literal incapable of interpolation -- []
726
689
  - name: string.quoted.other.literal.lower.ruby
727
- endCaptures:
728
- "0":
690
+ endCaptures:
691
+ '0':
729
692
  name: punctuation.definition.string.end.ruby
730
693
  begin: "%[qws]\\{"
731
- beginCaptures:
732
- "0":
694
+ beginCaptures:
695
+ '0':
733
696
  name: punctuation.definition.string.begin.ruby
734
- end: \}
735
- patterns:
697
+ end: "\\}"
698
+ patterns:
736
699
  - name: constant.character.escape.ruby
737
- match: \\\}|\\\\
700
+ match: "\\\\\\}|\\\\\\\\"
738
701
  - include: "#nest_curly"
739
702
  comment: literal incapable of interpolation -- {}
740
703
  - name: string.quoted.other.literal.lower.ruby
741
- endCaptures:
742
- "0":
704
+ endCaptures:
705
+ '0':
743
706
  name: punctuation.definition.string.end.ruby
744
707
  begin: "%[qws]([^\\w])"
745
- beginCaptures:
746
- "0":
708
+ beginCaptures:
709
+ '0':
747
710
  name: punctuation.definition.string.begin.ruby
748
- end: \1
749
- patterns:
750
- - match: \\.
711
+ end: "\\1"
712
+ patterns:
713
+ - match: "\\\\."
751
714
  comment: Cant be named because its not neccesarily an escape.
752
715
  comment: literal incapable of interpolation -- wildcard
753
716
  - name: constant.other.symbol.ruby
754
- captures:
755
- "1":
717
+ captures:
718
+ '1':
756
719
  name: punctuation.definition.constant.ruby
757
- match: (?<!:)(:)(?>[a-zA-Z_]\w*(?>[?!]|=(?![>=]))?|===?|>[>=]?|<[<=]?|<=>|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?|@@?[a-zA-Z_]\w*)
720
+ match: "(?<!:)(:)(?>[a-zA-Z_]\\w*(?>[?!]|=(?![>=]))?|===?|>[>=]?|<[<=]?|<=>|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[\\]=?|@@?[a-zA-Z_]\\w*)"
758
721
  comment: symbols
759
722
  - name: comment.block.documentation.ruby
760
- captures:
761
- "0":
723
+ captures:
724
+ '0':
762
725
  name: punctuation.definition.comment.ruby
763
- begin: ^=begin
764
- end: ^=end
726
+ begin: "^=begin"
727
+ end: "^=end"
765
728
  comment: multiline comments
766
729
  - name: comment.line.number-sign.ruby
767
- captures:
768
- "1":
730
+ captures:
731
+ '1':
769
732
  name: punctuation.definition.comment.ruby
770
- match: (?:^[ \t]+)?(#).*$\n?
733
+ match: "(?:^[ \\t]+)?(#).*$\\n?"
771
734
  - name: constant.numeric.ruby
772
- match: (?<!\w)\?(\\(x\h{1,2}(?!\h)\b|0[0-7]{0,2}(?![0-7])\b|[^x0MC])|(\\[MC]-)+\w|[^\s\\])
773
- comment: "\n\
774
- \t\t\tmatches questionmark-letters.\n\n\
775
- \t\t\texamples (1st alternation = hex):\n\
776
- \t\t\t?\\x1 ?\\x61\n\n\
777
- \t\t\texamples (2nd alternation = octal):\n\
778
- \t\t\t?\\0 ?\\07 ?\\017\n\n\
779
- \t\t\texamples (3rd alternation = escaped):\n\
780
- \t\t\t?\\n ?\\b\n\n\
781
- \t\t\texamples (4th alternation = meta-ctrl):\n\
782
- \t\t\t?\\C-a ?\\M-a ?\\C-\\M-\\C-\\M-a\n\n\
783
- \t\t\texamples (4th alternation = normal):\n\
784
- \t\t\t?a ?A ?0 \n\
785
- \t\t\t?* ?\" ?( \n\
786
- \t\t\t?. ?#\n\
787
- \t\t\t\n\
788
- \t\t\t\n\
789
- \t\t\tthe negative lookbehind prevents against matching\n\
790
- \t\t\tp(42.tainted?)\n\
791
- \t\t\t"
792
- - captures:
793
- "0":
735
+ match: "(?<!\\w)\\?(\\\\(x\\h{1,2}(?!\\h)\\b|0[0-7]{0,2}(?![0-7])\\b|[^x0MC])|(\\\\[MC]-)+\\w|[^\\s\\\\])"
736
+ comment: "\n\t\t\tmatches questionmark-letters.\n\n\t\t\texamples (1st alternation
737
+ = hex):\n\t\t\t?\\x1 ?\\x61\n\n\t\t\texamples (2nd alternation = octal):\n\t\t\t?\\0
738
+ \ ?\\07 ?\\017\n\n\t\t\texamples (3rd alternation = escaped):\n\t\t\t?\\n
739
+ \ ?\\b\n\n\t\t\texamples (4th alternation = meta-ctrl):\n\t\t\t?\\C-a ?\\M-a
740
+ \ ?\\C-\\M-\\C-\\M-a\n\n\t\t\texamples (4th alternation = normal):\n\t\t\t?a
741
+ \ ?A ?0 \n\t\t\t?* ?\" ?( \n\t\t\t?. ?#\n\t\t\t\n\t\t\t\n\t\t\tthe
742
+ negative lookbehind prevents against matching\n\t\t\tp(42.tainted?)\n\t\t\t"
743
+ - captures:
744
+ '0':
794
745
  name: string.unquoted.program-block.ruby
795
- begin: ^__END__\n
746
+ begin: "^__END__\\n"
796
747
  contentName: text.plain
797
- end: (?=not)impossible
798
- patterns:
748
+ end: "(?=not)impossible"
749
+ patterns:
799
750
  - name: text.html.embedded.ruby
800
- begin: (?=<?xml|<(?i:html\b)|!DOCTYPE (?i:html\b))
801
- end: (?=not)impossible
802
- patterns:
751
+ begin: "(?=<?xml|<(?i:html\\b)|!DOCTYPE (?i:html\\b))"
752
+ end: "(?=not)impossible"
753
+ patterns:
803
754
  - include: text.html.basic
804
755
  comment: __END__ marker
805
756
  - name: string.unquoted.heredoc.ruby
806
- endCaptures:
807
- "0":
757
+ endCaptures:
758
+ '0':
808
759
  name: punctuation.definition.string.end.ruby
809
- begin: (?>\=\s*<<(\w+))(?!\s+#\s*([Cc]|sh|[Jj]ava))
810
- beginCaptures:
811
- "0":
760
+ begin: "(?>\\=\\s*<<(\\w+))(?!\\s+#\\s*([Cc]|sh|[Jj]ava))"
761
+ beginCaptures:
762
+ '0':
812
763
  name: punctuation.definition.string.begin.ruby
813
- end: ^\1$
814
- patterns:
764
+ end: "^\\1$"
765
+ patterns:
815
766
  - include: "#heredoc"
816
767
  - include: "#interpolated_ruby"
817
768
  - include: "#escaped_char"
818
769
  - name: string.unquoted.embedded.html.ruby
819
- endCaptures:
820
- "0":
770
+ endCaptures:
771
+ '0':
821
772
  name: punctuation.definition.string.end.ruby
822
- begin: (?><<-HTML\b)
773
+ begin: "(?><<-HTML\\b)"
823
774
  contentName: text.html.embedded.ruby
824
- beginCaptures:
825
- "0":
775
+ beginCaptures:
776
+ '0':
826
777
  name: punctuation.definition.string.begin.ruby
827
- end: \s*HTML$
828
- patterns:
778
+ end: "\\s*HTML$"
779
+ patterns:
829
780
  - include: "#heredoc"
830
781
  - include: text.html.basic
831
782
  - include: "#interpolated_ruby"
832
783
  - include: "#escaped_char"
833
784
  comment: heredoc with embedded HTML and indented terminator
834
785
  - name: string.unquoted.embedded.ruby.ruby
835
- endCaptures:
836
- "0":
786
+ endCaptures:
787
+ '0':
837
788
  name: punctuation.definition.string.end.ruby
838
- begin: (?><<-(["\\']?)(\w+_(?i:eval))\1)
839
- beginCaptures:
840
- "0":
789
+ begin: "(?><<-([\"\\\\']?)(\\w+_(?i:eval))\\1)"
790
+ beginCaptures:
791
+ '0':
841
792
  name: punctuation.definition.string.begin.ruby
842
- end: \s*\2$
843
- patterns:
793
+ end: "\\s*\\2$"
794
+ patterns:
844
795
  - include: "#heredoc"
845
796
  - include: "#interpolated_ruby"
846
797
  - include: source.ruby
847
798
  - include: "#escaped_char"
848
799
  comment: ruby code in heredoc, interpolated
849
800
  - name: string.unquoted.heredoc.ruby
850
- endCaptures:
851
- "0":
801
+ endCaptures:
802
+ '0':
852
803
  name: punctuation.definition.string.end.ruby
853
- begin: (?><<-(\w+))
854
- beginCaptures:
855
- "0":
804
+ begin: "(?><<-(\\w+))"
805
+ beginCaptures:
806
+ '0':
856
807
  name: punctuation.definition.string.begin.ruby
857
- end: \s*\1$
858
- patterns:
808
+ end: "\\s*\\1$"
809
+ patterns:
859
810
  - include: "#heredoc"
860
811
  - include: "#interpolated_ruby"
861
812
  - include: "#escaped_char"
862
813
  comment: heredoc with indented terminator
863
814
  - name: string.unquoted.embedded.c.ruby
864
- endCaptures:
865
- "0":
815
+ endCaptures:
816
+ '0':
866
817
  name: punctuation.definition.string.end.ruby
867
- begin: (?>\=\s*<<(\w+))(?=\s+#\s*[Cc](?!(\+\+|[Ss][Ss])))
868
- beginCaptures:
869
- "0":
818
+ begin: "(?>\\=\\s*<<(\\w+))(?=\\s+#\\s*[Cc](?!(\\+\\+|[Ss][Ss])))"
819
+ beginCaptures:
820
+ '0':
870
821
  name: punctuation.definition.string.begin.ruby
871
- end: ^\1$
872
- patterns:
822
+ end: "^\\1$"
823
+ patterns:
873
824
  - include: "#heredoc"
874
825
  - include: source.c
875
826
  - include: "#interpolated_ruby"
876
827
  - include: "#escaped_char"
877
828
  - name: string.unquoted.embedded.cplusplus.ruby
878
- endCaptures:
879
- "0":
829
+ endCaptures:
830
+ '0':
880
831
  name: punctuation.definition.string.end.ruby
881
- begin: (?>\=\s*<<(\w+))(?=\s+#\s*[Cc]\+\+)
882
- beginCaptures:
883
- "0":
832
+ begin: "(?>\\=\\s*<<(\\w+))(?=\\s+#\\s*[Cc]\\+\\+)"
833
+ beginCaptures:
834
+ '0':
884
835
  name: punctuation.definition.string.begin.ruby
885
- end: ^\1$
886
- patterns:
836
+ end: "^\\1$"
837
+ patterns:
887
838
  - include: "#heredoc"
888
839
  - include: source.c++
889
840
  - include: "#interpolated_ruby"
890
841
  - include: "#escaped_char"
891
842
  - name: string.unquoted.embedded.css.ruby
892
- endCaptures:
893
- "0":
843
+ endCaptures:
844
+ '0':
894
845
  name: punctuation.definition.string.end.ruby
895
- begin: (?>\=\s*<<(\w+))(?=\s+#\s*[Cc][Ss][Ss])
896
- beginCaptures:
897
- "0":
846
+ begin: "(?>\\=\\s*<<(\\w+))(?=\\s+#\\s*[Cc][Ss][Ss])"
847
+ beginCaptures:
848
+ '0':
898
849
  name: punctuation.definition.string.begin.ruby
899
- end: ^\1$
900
- patterns:
850
+ end: "^\\1$"
851
+ patterns:
901
852
  - include: "#heredoc"
902
853
  - include: source.css
903
854
  - include: "#interpolated_ruby"
904
855
  - include: "#escaped_char"
905
856
  - name: string.unquoted.embedded.js.ruby
906
- endCaptures:
907
- "0":
857
+ endCaptures:
858
+ '0':
908
859
  name: punctuation.definition.string.end.ruby
909
- begin: (?>\=\s*<<(\w+))(?=\s+#\s*[Jj]ava[Ss]cript)
910
- beginCaptures:
911
- "0":
860
+ begin: "(?>\\=\\s*<<(\\w+))(?=\\s+#\\s*[Jj]ava[Ss]cript)"
861
+ beginCaptures:
862
+ '0':
912
863
  name: punctuation.definition.string.begin.ruby
913
- end: ^\1$
914
- patterns:
864
+ end: "^\\1$"
865
+ patterns:
915
866
  - include: "#heredoc"
916
867
  - include: source.js
917
868
  - include: "#interpolated_ruby"
918
869
  - include: "#escaped_char"
919
870
  - name: string.unquoted.embedded.shell.ruby
920
- endCaptures:
921
- "0":
871
+ endCaptures:
872
+ '0':
922
873
  name: punctuation.definition.string.end.ruby
923
- begin: (?>\=\s*<<(\w+))(?=\s+#\s*sh)
924
- beginCaptures:
925
- "0":
874
+ begin: "(?>\\=\\s*<<(\\w+))(?=\\s+#\\s*sh)"
875
+ beginCaptures:
876
+ '0':
926
877
  name: punctuation.definition.string.begin.ruby
927
- end: ^\1$
928
- patterns:
878
+ end: "^\\1$"
879
+ patterns:
929
880
  - include: "#heredoc"
930
881
  - include: source.shell
931
882
  - include: "#interpolated_ruby"
932
883
  - include: "#escaped_char"
933
884
  - name: meta.function-call.method.with-arguments.ruby
934
- begin: (?<=[^\.])(?=(\.|::)[a-zA-Z][a-zA-Z0-9_!?=]*\()(\.|::)
935
- beginCaptures:
936
- "1":
885
+ begin: "(?<=[^\\.])(?=(\\.|::)[a-zA-Z][a-zA-Z0-9_!?=]*\\()(\\.|::)"
886
+ beginCaptures:
887
+ '1':
937
888
  name: punctuation.separator.method.ruby
938
- end: (?<=[a-zA-Z0-9_!?=])(?=\()
939
- patterns:
940
- - comment: "made this way to eventually support including #known_function_names"
889
+ end: "(?<=[a-zA-Z0-9_!?=])(?=\\()"
890
+ patterns:
891
+ - comment: 'made this way to eventually support including #known_function_names'
941
892
  - name: entity.name.function.ruby
942
- match: ([a-zA-Z][a-zA-Z0-9_!?=]*)(?=[^a-zA-Z0-9_!?])
893
+ match: "([a-zA-Z][a-zA-Z0-9_!?=]*)(?=[^a-zA-Z0-9_!?])"
943
894
  - name: meta.function-call.method.without-arguments.ruby
944
- begin: (?<=[^\.])(?=(\.|::)[a-zA-Z][a-zA-Z0-9_!?]*[^a-zA-Z0-9_!?])(\.|::)
945
- beginCaptures:
946
- "1":
895
+ begin: "(?<=[^\\.])(?=(\\.|::)[a-zA-Z][a-zA-Z0-9_!?]*[^a-zA-Z0-9_!?])(\\.|::)"
896
+ beginCaptures:
897
+ '1':
947
898
  name: punctuation.separator.method.ruby
948
- end: (?<=[a-zA-Z0-9_!?])(?=[^a-zA-Z0-9_!?])
949
- patterns:
950
- - comment: "made this way to eventually support including #known_function_names"
899
+ end: "(?<=[a-zA-Z0-9_!?])(?=[^a-zA-Z0-9_!?])"
900
+ patterns:
901
+ - comment: 'made this way to eventually support including #known_function_names'
951
902
  - name: entity.name.function.ruby
952
- match: ([a-zA-Z][a-zA-Z0-9_!?]*)(?=[^a-zA-Z0-9_!?])
903
+ match: "([a-zA-Z][a-zA-Z0-9_!?]*)(?=[^a-zA-Z0-9_!?])"
953
904
  - name: meta.function-call.ruby
954
- begin: (?=[a-zA-Z][a-zA-Z0-9_!?]+\()
955
- end: (?=\()
956
- patterns:
957
- - comment: "eventually include #known_function_names"
905
+ begin: "(?=[a-zA-Z][a-zA-Z0-9_!?]+\\()"
906
+ end: "(?=\\()"
907
+ patterns:
908
+ - comment: 'eventually include #known_function_names'
958
909
  - name: entity.name.function.ruby
959
- match: ([a-zA-Z0-9_!?]+)(?=\()
960
- - captures:
961
- "1":
910
+ match: "([a-zA-Z0-9_!?]+)(?=\\()"
911
+ - captures:
912
+ '1':
962
913
  name: punctuation.separator.variable.ruby
963
- begin: (?<=\{|do|\{\s|do\s)(\|)
964
- end: (\|)
965
- patterns:
914
+ begin: "(?<=\\{|do|\\{\\s|do\\s)(\\|)"
915
+ end: "(\\|)"
916
+ patterns:
966
917
  - name: variable.other.block.ruby
967
918
  match: "[_a-zA-Z][_a-zA-Z0-9]*"
968
919
  - name: punctuation.separator.variable.ruby
969
920
  match: ","
970
921
  - name: punctuation.separator.key-value
971
- match: =>
922
+ match: "=>"
972
923
  - name: keyword.operator.unary.ruby
973
- match: \+@|-@
924
+ match: "\\+@|-@"
974
925
  - name: keyword.operator.assignment.augmented.ruby
975
- match: <<=|%=|&=|\*=|\*\*=|\+=|\-=|\^=|\|{1,2}=|/=|<<
926
+ match: "<<=|%=|&=|\\*=|\\*\\*=|\\+=|\\-=|\\^=|\\|{1,2}=|/=|<<"
976
927
  - name: keyword.operator.comparison.ruby
977
- match: <=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?<=[ \t])\?
928
+ match: "<=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?<=[ \\t])\\?"
978
929
  - name: keyword.operator.logical.ruby
979
- match: (?<=[ \t])!|\bnot\b|&&|\band\b|\|\||\bor\b|\^
930
+ match: "(?<=[ \\t])!|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\^"
980
931
  - name: keyword.operator.arithmetic.ruby
981
- match: (%|&|\*\*|\*|\+|\-|/)
932
+ match: "(%|&|\\*\\*|\\*|\\+|\\-|/)"
982
933
  - name: keyword.operator.assignment.ruby
983
934
  match: "="
984
935
  - name: keyword.operator.other.ruby
985
- match: \||~|>>
936
+ match: "\\||~|>>"
986
937
  - name: punctuation.separator.other.ruby
987
938
  match: ":"
988
939
  - name: punctuation.separator.statement.ruby
989
- match: \;
940
+ match: "\\;"
990
941
  - name: punctuation.separator.object.ruby
991
942
  match: ","
992
943
  - name: punctuation.separator.method.ruby
993
944
  match: "\\.|::"
994
945
  - name: punctuation.section.scope.ruby
995
- match: \{|\}
946
+ match: "\\{|\\}"
996
947
  - name: punctuation.section.array.ruby
997
- match: \[|\]
948
+ match: "\\[|\\]"
998
949
  - name: punctuation.section.function.ruby
999
- match: \(|\)
1000
- foldingStopMarker: "(?x)\n\
1001
- \t\t( (^|;) \\s*+ end \\s*+ ([#].*)? $\n\
1002
- \t\t| (^|;) \\s*+ end \\. .* $\n\
1003
- \t\t| ^ \\s*+ [}\\]] \\s*+ ([#].*)? $\n\
1004
- \t\t| [#] .*? \\(end\\) \\s*+ $ # Sune\xE2\x80\x99s special marker\n\
1005
- \t\t| ^=end\n\
1006
- \t\t)"
1007
- keyEquivalent: ^~R
1008
- comment: "\n\
1009
- \tTODO: unresolved issues\n\n\
1010
- \ttext:\n\
1011
- \t\"p << end\n\
1012
- \tprint me!\n\
1013
- \tend\"\n\
1014
- \tsymptoms:\n\
1015
- \tnot recognized as a heredoc\n\
1016
- \tsolution:\n\
1017
- \tthere is no way to distinguish perfectly between the << operator and the start\n\
1018
- \tof a heredoc. Currently, we require assignment to recognize a heredoc. More\n\
1019
- \trefinement is possible.\n\
1020
- \t\xE2\x80\xA2 Heredocs with indented terminators (<<-) are always distinguishable, however.\n\
1021
- \t\xE2\x80\xA2 Nested heredocs are not really supportable at present\n\n\
1022
- \ttext:\n\
1023
- \tprint <<-'THERE' \n\
1024
- \tThis is single quoted. \n\
1025
- \tThe above used #{Time.now} \n\
1026
- \tTHERE \n\
1027
- \tsymtoms:\n\
1028
- \tFrom Programming Ruby p306; should be a non-interpolated heredoc.\n\
1029
- \t\n\
1030
- \ttext:\n\
1031
- \t\"a\\332a\"\n\
1032
- \tsymptoms:\n\
1033
- \t'\\332' is not recognized as slash3.. which should be octal 332.\n\
1034
- \tsolution:\n\
1035
- \tplain regexp.. should be easy.\n\n text:\n val?(a):p(b)\n val?'a':'b'\n symptoms:\n ':p' is recognized as a symbol.. its 2 things ':' and 'p'.\n :'b' has same problem.\n solution:\n ternary operator rule, precedence stuff, symbol rule.\n but also consider 'a.b?(:c)' ??\n"
950
+ match: "\\(|\\)"
951
+ foldingStopMarker: "(?x)\n\t\t( (^|;) \\s*+ end \\s*+ ([#].*)? $\n\t\t| (^|;)
952
+ \\s*+ end \\. .* $\n\t\t| ^ \\s*+ [}\\]] \\s*+ ([#].*)? $\n\t\t| [#] .*?
953
+ \\(end\\) \\s*+ $ # Sune’s special marker\n\t\t| ^=end\n\t\t)"
954
+ keyEquivalent: "^~R"
955
+ comment: "\n\tTODO: unresolved issues\n\n\ttext:\n\t\"p << end\n\tprint me!\n\tend\"\n\tsymptoms:\n\tnot
956
+ recognized as a heredoc\n\tsolution:\n\tthere is no way to distinguish perfectly
957
+ between the << operator and the start\n\tof a heredoc. Currently, we require assignment
958
+ to recognize a heredoc. More\n\trefinement is possible.\n\t• Heredocs with indented
959
+ terminators (<<-) are always distinguishable, however.\n\t• Nested heredocs are
960
+ not really supportable at present\n\n\ttext:\n\tprint <<-'THERE' \n\tThis is single
961
+ quoted. \n\tThe above used #{Time.now} \n\tTHERE \n\tsymtoms:\n\tFrom Programming
962
+ Ruby p306; should be a non-interpolated heredoc.\n\t\n\ttext:\n\t\"a\\332a\"\n\tsymptoms:\n\t'\\332'
963
+ is not recognized as slash3.. which should be octal 332.\n\tsolution:\n\tplain regexp..
964
+ should be easy.\n\n text:\n val?(a):p(b)\n val?'a':'b'\n symptoms:\n
965
+ \ ':p' is recognized as a symbol.. its 2 things ':' and 'p'.\n :'b' has same
966
+ problem.\n solution:\n ternary operator rule, precedence stuff, symbol rule.\n
967
+ \ but also consider 'a.b?(:c)' ??\n"