devver-ultraviolet 0.10.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +25 -0
- data/Manifest.txt +233 -0
- data/README.txt +52 -0
- data/bin/theme2latexrender +122 -0
- data/bin/theme2xhtmlrender +156 -0
- data/bin/uv +140 -0
- data/lib/uv.rb +94 -0
- data/lib/uv/render_processor.rb +146 -0
- data/lib/uv/utility.rb +67 -0
- data/render/latex/active4d.render +132 -0
- data/render/latex/all_hallows_eve.render +96 -0
- data/render/latex/amy.render +171 -0
- data/render/latex/blackboard.render +111 -0
- data/render/latex/brilliance_black.render +552 -0
- data/render/latex/brilliance_dull.render +561 -0
- data/render/latex/cobalt.render +162 -0
- data/render/latex/dawn.render +126 -0
- data/render/latex/eiffel.render +132 -0
- data/render/latex/espresso_libre.render +123 -0
- data/render/latex/idle.render +93 -0
- data/render/latex/iplastic.render +99 -0
- data/render/latex/lazy.render +96 -0
- data/render/latex/mac_classic.render +135 -0
- data/render/latex/magicwb_amiga.render +117 -0
- data/render/latex/pastels_on_dark.render +204 -0
- data/render/latex/slush_poppies.render +123 -0
- data/render/latex/spacecadet.render +81 -0
- data/render/latex/sunburst.render +186 -0
- data/render/latex/twilight.render +153 -0
- data/render/latex/zenburnesque.render +126 -0
- data/render/old/txt2tags.render +131 -0
- data/render/xhtml/active4d.render +140 -0
- data/render/xhtml/all_hallows_eve.render +104 -0
- data/render/xhtml/amy.render +179 -0
- data/render/xhtml/blackboard.render +119 -0
- data/render/xhtml/brilliance_black.render +560 -0
- data/render/xhtml/brilliance_dull.render +569 -0
- data/render/xhtml/cobalt.render +170 -0
- data/render/xhtml/dawn.render +134 -0
- data/render/xhtml/eiffel.render +140 -0
- data/render/xhtml/espresso_libre.render +131 -0
- data/render/xhtml/files/css/active4d.css +114 -0
- data/render/xhtml/files/css/all_hallows_eve.css +72 -0
- data/render/xhtml/files/css/amy.css +147 -0
- data/render/xhtml/files/css/blackboard.css +88 -0
- data/render/xhtml/files/css/brilliance_black.css +605 -0
- data/render/xhtml/files/css/brilliance_dull.css +599 -0
- data/render/xhtml/files/css/cobalt.css +149 -0
- data/render/xhtml/files/css/dawn.css +121 -0
- data/render/xhtml/files/css/eiffel.css +121 -0
- data/render/xhtml/files/css/espresso_libre.css +109 -0
- data/render/xhtml/files/css/idle.css +62 -0
- data/render/xhtml/files/css/iplastic.css +80 -0
- data/render/xhtml/files/css/lazy.css +73 -0
- data/render/xhtml/files/css/mac_classic.css +123 -0
- data/render/xhtml/files/css/magicwb_amiga.css +104 -0
- data/render/xhtml/files/css/pastels_on_dark.css +188 -0
- data/render/xhtml/files/css/slush_poppies.css +85 -0
- data/render/xhtml/files/css/spacecadet.css +51 -0
- data/render/xhtml/files/css/sunburst.css +180 -0
- data/render/xhtml/files/css/twilight.css +137 -0
- data/render/xhtml/files/css/zenburnesque.css +91 -0
- data/render/xhtml/idle.render +101 -0
- data/render/xhtml/iplastic.render +107 -0
- data/render/xhtml/lazy.render +104 -0
- data/render/xhtml/mac_classic.render +143 -0
- data/render/xhtml/magicwb_amiga.render +125 -0
- data/render/xhtml/pastels_on_dark.render +212 -0
- data/render/xhtml/slush_poppies.render +131 -0
- data/render/xhtml/spacecadet.render +89 -0
- data/render/xhtml/sunburst.render +194 -0
- data/render/xhtml/twilight.render +161 -0
- data/render/xhtml/zenburnesque.render +134 -0
- data/syntax/actionscript.syntax +97 -0
- data/syntax/active4d.syntax +276 -0
- data/syntax/active4d_html.syntax +311 -0
- data/syntax/active4d_ini.syntax +50 -0
- data/syntax/active4d_library.syntax +21 -0
- data/syntax/ada.syntax +33 -0
- data/syntax/antlr.syntax +151 -0
- data/syntax/apache.syntax +191 -0
- data/syntax/applescript.syntax +384 -0
- data/syntax/asp.syntax +70 -0
- data/syntax/asp_vb.net.syntax +129 -0
- data/syntax/bibtex.syntax +151 -0
- data/syntax/blog_html.syntax +41 -0
- data/syntax/blog_markdown.syntax +42 -0
- data/syntax/blog_text.syntax +27 -0
- data/syntax/blog_textile.syntax +27 -0
- data/syntax/build.syntax +53 -0
- data/syntax/bulletin_board.syntax +287 -0
- data/syntax/cake.syntax +55 -0
- data/syntax/camlp4.syntax +36 -0
- data/syntax/cm.syntax +32 -0
- data/syntax/coldfusion.syntax +119 -0
- data/syntax/context_free.syntax +176 -0
- data/syntax/cs.syntax +59 -0
- data/syntax/css.syntax +195 -0
- data/syntax/css_experimental.syntax +1925 -0
- data/syntax/csv.syntax +68 -0
- data/syntax/d.syntax +142 -0
- data/syntax/diff.syntax +81 -0
- data/syntax/dokuwiki.syntax +204 -0
- data/syntax/dot.syntax +47 -0
- data/syntax/doxygen.syntax +43 -0
- data/syntax/dylan.syntax +62 -0
- data/syntax/eiffel.syntax +78 -0
- data/syntax/erlang.syntax +922 -0
- data/syntax/f-script.syntax +80 -0
- data/syntax/fortran.syntax +141 -0
- data/syntax/fxscript.syntax +142 -0
- data/syntax/greasemonkey.syntax +34 -0
- data/syntax/gri.syntax +83 -0
- data/syntax/groovy.syntax +191 -0
- data/syntax/gtd.syntax +22 -0
- data/syntax/gtdalt.syntax +143 -0
- data/syntax/haml.syntax +88 -0
- data/syntax/haskell.syntax +88 -0
- data/syntax/html-asp.syntax +27 -0
- data/syntax/html.syntax +362 -0
- data/syntax/html_django.syntax +36 -0
- data/syntax/html_for_asp.net.syntax +424 -0
- data/syntax/html_mason.syntax +119 -0
- data/syntax/html_rails.syntax +40 -0
- data/syntax/html_tcl.syntax +26 -0
- data/syntax/icalendar.syntax +32 -0
- data/syntax/inform.syntax +48 -0
- data/syntax/ini.syntax +55 -0
- data/syntax/installer_distribution_script.syntax +77 -0
- data/syntax/io.syntax +81 -0
- data/syntax/java.syntax +211 -0
- data/syntax/javaproperties.syntax +20 -0
- data/syntax/javascript.syntax +256 -0
- data/syntax/javascript_+_prototype.syntax +72 -0
- data/syntax/javascript_+_prototype_bracketed.syntax +140 -0
- data/syntax/jquery_javascript.syntax +114 -0
- data/syntax/json.syntax +136 -0
- data/syntax/languagedefinition.syntax +708 -0
- data/syntax/latex.syntax +566 -0
- data/syntax/latex_beamer.syntax +41 -0
- data/syntax/latex_log.syntax +50 -0
- data/syntax/latex_memoir.syntax +64 -0
- data/syntax/lexflex.syntax +219 -0
- data/syntax/lighttpd.syntax +54 -0
- data/syntax/lilypond.syntax +492 -0
- data/syntax/lisp.syntax +61 -0
- data/syntax/literate_haskell.syntax +24 -0
- data/syntax/logo.syntax +29 -0
- data/syntax/logtalk.syntax +152 -0
- data/syntax/lua.syntax +86 -0
- data/syntax/m.syntax +142 -0
- data/syntax/macports_portfile.syntax +163 -0
- data/syntax/makefile.syntax +36 -0
- data/syntax/man.syntax +17 -0
- data/syntax/mediawiki.syntax +567 -0
- data/syntax/mips.syntax +66 -0
- data/syntax/mod_perl.syntax +50 -0
- data/syntax/modula-3.syntax +47 -0
- data/syntax/moinmoin.syntax +189 -0
- data/syntax/mootools.syntax +572 -0
- data/syntax/movable_type.syntax +162 -0
- data/syntax/multimarkdown.syntax +39 -0
- data/syntax/objective-c++.syntax +18 -0
- data/syntax/objective-c.syntax +233 -0
- data/syntax/ocaml.syntax +764 -0
- data/syntax/ocamllex.syntax +167 -0
- data/syntax/ocamlyacc.syntax +184 -0
- data/syntax/opengl.syntax +14 -0
- data/syntax/pascal.syntax +77 -0
- data/syntax/perl.syntax +1115 -0
- data/syntax/plain_text.syntax +32 -0
- data/syntax/postscript.syntax +114 -0
- data/syntax/processing.syntax +106 -0
- data/syntax/prolog.syntax +40 -0
- data/syntax/property_list.syntax +635 -0
- data/syntax/python.syntax +868 -0
- data/syntax/python_django.syntax +21 -0
- data/syntax/qmake_project.syntax +114 -0
- data/syntax/qt_c++.syntax +26 -0
- data/syntax/quake3_config.syntax +32 -0
- data/syntax/r.syntax +81 -0
- data/syntax/r_console.syntax +16 -0
- data/syntax/ragel.syntax +201 -0
- data/syntax/rd_r_documentation.syntax +91 -0
- data/syntax/regexp.syntax +50 -0
- data/syntax/release_notes.syntax +46 -0
- data/syntax/remind.syntax +253 -0
- data/syntax/restructuredtext.syntax +250 -0
- data/syntax/rez.syntax +80 -0
- data/syntax/ruby.syntax +1035 -0
- data/syntax/ruby_experimental.syntax +145 -0
- data/syntax/ruby_on_rails.syntax +88 -0
- data/syntax/s5.syntax +69 -0
- data/syntax/scheme.syntax +347 -0
- data/syntax/scilab.syntax +41 -0
- data/syntax/setext.syntax +147 -0
- data/syntax/shell-unix-generic.syntax +384 -0
- data/syntax/slate.syntax +149 -0
- data/syntax/sql.syntax +237 -0
- data/syntax/sql_rails.syntax +18 -0
- data/syntax/ssh-config.syntax +33 -0
- data/syntax/standard_ml.syntax +121 -0
- data/syntax/strings_file.syntax +39 -0
- data/syntax/subversion_commit_message.syntax +36 -0
- data/syntax/sweave.syntax +84 -0
- data/syntax/swig.syntax +57 -0
- data/syntax/tcl.syntax +152 -0
- data/syntax/template_toolkit.syntax +121 -0
- data/syntax/tex.syntax +86 -0
- data/syntax/tex_math.syntax +49 -0
- data/syntax/textile.syntax +215 -0
- data/syntax/tsv.syntax +50 -0
- data/syntax/twiki.syntax +241 -0
- data/syntax/txt2tags.syntax +79 -0
- data/syntax/vectorscript.syntax +57 -0
- data/syntax/xhtml_1.0.syntax +4027 -0
- data/syntax/xml.syntax +180 -0
- data/syntax/xml_strict.syntax +92 -0
- data/syntax/xsl.syntax +60 -0
- data/syntax/yaml.syntax +160 -0
- data/syntax/yui_javascript.syntax +176 -0
- metadata +310 -0
data/syntax/rez.syntax
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
name: Rez
|
3
|
+
fileTypes:
|
4
|
+
- r
|
5
|
+
scopeName: source.rez
|
6
|
+
repository:
|
7
|
+
escaped_char:
|
8
|
+
name: constant.character.escape.rez
|
9
|
+
match: \\.
|
10
|
+
uuid: F3EB29E9-8DB7-4052-9D48-5CDD2491D8D3
|
11
|
+
foldingStartMarker: (/\*\*|\{\s*$)
|
12
|
+
patterns:
|
13
|
+
- name: comment.block.rez
|
14
|
+
captures:
|
15
|
+
"0":
|
16
|
+
name: punctuation.definition.comment.rez
|
17
|
+
begin: /\*
|
18
|
+
end: \*/
|
19
|
+
- name: comment.line.double-slash.rez
|
20
|
+
captures:
|
21
|
+
"1":
|
22
|
+
name: punctuation.definition.comment.rez
|
23
|
+
match: (//).*$\n?
|
24
|
+
- name: keyword.control.rez
|
25
|
+
match: \b(?i:(change|data|delete|include|read|resource|type))\b
|
26
|
+
comment: Note that Xcode gets case sensitivity wrong (last checked Xcode 2.0). I'm not sure built-in functions are case-insensitive, though, so we might too.
|
27
|
+
- name: storage.type.rez
|
28
|
+
match: \b(?i:(align|array|binary|bit|bitstring|boolean|byte|case|char|cstring|decimal|enum|fill|hex|integer|key|literal|long|longint|nibble|octal|point|pstring|rect|string|switch|unsigned|wide|word|wstring))\b
|
29
|
+
- name: keyword.other.attributes.rez
|
30
|
+
match: \b(?i:(appheap|locked|nonpurgeable|purgeable|sysheap|unlocked))\b
|
31
|
+
- name: support.function.built-in.rez
|
32
|
+
captures:
|
33
|
+
"1":
|
34
|
+
name: punctuation.definition.function.rez
|
35
|
+
match: (\$\$)(?i:(ArrayIndex|Attributes|BitField|Byte|CountOf|Date|Day|Format|Hour|ID|Long|Minute|Month|Name|PackedSize|Read|Resource|ResourceSize|Second|Shell|Time|Type|Version|Weekday|Word|Year))
|
36
|
+
- name: constant.numeric.rez
|
37
|
+
match: \b(((0(x|X|B)|\$)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b
|
38
|
+
- name: string.quoted.double.rez
|
39
|
+
endCaptures:
|
40
|
+
"0":
|
41
|
+
name: punctuation.definition.string.end.rez
|
42
|
+
begin: "\""
|
43
|
+
beginCaptures:
|
44
|
+
"0":
|
45
|
+
name: punctuation.definition.string.begin.rez
|
46
|
+
end: "\""
|
47
|
+
patterns:
|
48
|
+
- include: "#escaped_char"
|
49
|
+
- name: string.quoted.single.rez
|
50
|
+
endCaptures:
|
51
|
+
"0":
|
52
|
+
name: punctuation.definition.string.end.rez
|
53
|
+
begin: "'"
|
54
|
+
beginCaptures:
|
55
|
+
"0":
|
56
|
+
name: punctuation.definition.string.begin.rez
|
57
|
+
end: "'"
|
58
|
+
patterns:
|
59
|
+
- include: "#escaped_char"
|
60
|
+
- name: string.quoted.other.hex.rez
|
61
|
+
endCaptures:
|
62
|
+
"0":
|
63
|
+
name: punctuation.definition.string.end.rez
|
64
|
+
begin: \$"
|
65
|
+
beginCaptures:
|
66
|
+
"0":
|
67
|
+
name: punctuation.definition.string.begin.rez
|
68
|
+
end: "\""
|
69
|
+
patterns:
|
70
|
+
- include: "#escaped_char"
|
71
|
+
- name: meta.preprocessor.rez
|
72
|
+
captures:
|
73
|
+
"1":
|
74
|
+
name: punctuation.definition.preprocessor.rez
|
75
|
+
"2":
|
76
|
+
name: keyword.control.import.rez
|
77
|
+
match: ^\s*(#)\s*(define|defined|else|elif|endif|if|ifdef|ifndef|include|line|printf|undef)\b
|
78
|
+
foldingStopMarker: (\*\*/|^\s*\})
|
79
|
+
keyEquivalent: ^~R
|
80
|
+
comment: "Rez. Legacy Mac OS source code frequently contains Rez files. \xE2\x80\x93 chris@cjack.com"
|
data/syntax/ruby.syntax
ADDED
@@ -0,0 +1,1035 @@
|
|
1
|
+
---
|
2
|
+
name: Ruby
|
3
|
+
fileTypes:
|
4
|
+
- rb
|
5
|
+
- rbx
|
6
|
+
- rjs
|
7
|
+
- Rakefile
|
8
|
+
- rake
|
9
|
+
- cgi
|
10
|
+
- fcgi
|
11
|
+
- gemspec
|
12
|
+
firstLineMatch: ^#!/.*\bruby\b
|
13
|
+
scopeName: source.ruby
|
14
|
+
repository:
|
15
|
+
nest_brackets:
|
16
|
+
captures:
|
17
|
+
"0":
|
18
|
+
name: punctuation.section.scope.ruby
|
19
|
+
begin: \[
|
20
|
+
end: \]
|
21
|
+
patterns:
|
22
|
+
- include: "#nest_brackets"
|
23
|
+
interpolated_ruby:
|
24
|
+
patterns:
|
25
|
+
- name: source.ruby.embedded.source
|
26
|
+
captures:
|
27
|
+
"0":
|
28
|
+
name: punctuation.section.embedded.ruby
|
29
|
+
"1":
|
30
|
+
name: source.ruby.embedded.source.empty
|
31
|
+
match: "#\\{(\\})"
|
32
|
+
- name: source.ruby.embedded.source
|
33
|
+
captures:
|
34
|
+
"0":
|
35
|
+
name: punctuation.section.embedded.ruby
|
36
|
+
begin: "#\\{"
|
37
|
+
end: \}
|
38
|
+
patterns:
|
39
|
+
- include: "#nest_curly_and_self"
|
40
|
+
- include: $self
|
41
|
+
- name: variable.other.readwrite.instance.ruby
|
42
|
+
captures:
|
43
|
+
"1":
|
44
|
+
name: punctuation.definition.variable.ruby
|
45
|
+
match: (#@)[a-zA-Z_]\w*
|
46
|
+
- name: variable.other.readwrite.class.ruby
|
47
|
+
captures:
|
48
|
+
"1":
|
49
|
+
name: punctuation.definition.variable.ruby
|
50
|
+
match: (#@@)[a-zA-Z_]\w*
|
51
|
+
- name: variable.other.readwrite.global.ruby
|
52
|
+
captures:
|
53
|
+
"1":
|
54
|
+
name: punctuation.definition.variable.ruby
|
55
|
+
match: (#\$)[a-zA-Z_]\w*
|
56
|
+
escaped_char:
|
57
|
+
name: constant.character.escape.ruby
|
58
|
+
match: \\(?:0\d{1,2}|x[\da-fA-F]{1,2}|.)
|
59
|
+
regex_sub:
|
60
|
+
patterns:
|
61
|
+
- include: "#interpolated_ruby"
|
62
|
+
- include: "#escaped_char"
|
63
|
+
- name: string.regexp.arbitrary-repitition.ruby
|
64
|
+
captures:
|
65
|
+
"1":
|
66
|
+
name: punctuation.definition.arbitrary-repitition.ruby
|
67
|
+
"3":
|
68
|
+
name: punctuation.definition.arbitrary-repitition.ruby
|
69
|
+
match: (\{)\d+(,\d+)?(\})
|
70
|
+
- name: string.regexp.character-class.ruby
|
71
|
+
captures:
|
72
|
+
"0":
|
73
|
+
name: punctuation.definition.character-class.ruby
|
74
|
+
begin: \[(?:\^?\])?
|
75
|
+
end: \]
|
76
|
+
patterns:
|
77
|
+
- include: "#escaped_char"
|
78
|
+
- name: string.regexp.group.ruby
|
79
|
+
captures:
|
80
|
+
"0":
|
81
|
+
name: punctuation.definition.group.ruby
|
82
|
+
begin: \(
|
83
|
+
end: \)
|
84
|
+
patterns:
|
85
|
+
- include: "#regex_sub"
|
86
|
+
- name: comment.line.number-sign.ruby
|
87
|
+
captures:
|
88
|
+
"1":
|
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":
|
100
|
+
name: punctuation.section.scope.ruby
|
101
|
+
begin: \(
|
102
|
+
end: \)
|
103
|
+
patterns:
|
104
|
+
- include: "#regex_sub"
|
105
|
+
- include: "#nest_parens_r"
|
106
|
+
nest_curly_r:
|
107
|
+
captures:
|
108
|
+
"0":
|
109
|
+
name: punctuation.section.scope.ruby
|
110
|
+
begin: \{
|
111
|
+
end: \}
|
112
|
+
patterns:
|
113
|
+
- include: "#regex_sub"
|
114
|
+
- include: "#nest_curly_r"
|
115
|
+
nest_parens_i:
|
116
|
+
captures:
|
117
|
+
"0":
|
118
|
+
name: punctuation.section.scope.ruby
|
119
|
+
begin: \(
|
120
|
+
end: \)
|
121
|
+
patterns:
|
122
|
+
- include: "#interpolated_ruby"
|
123
|
+
- include: "#escaped_char"
|
124
|
+
- include: "#nest_parens_i"
|
125
|
+
nest_ltgt_r:
|
126
|
+
captures:
|
127
|
+
"0":
|
128
|
+
name: punctuation.section.scope.ruby
|
129
|
+
begin: \<
|
130
|
+
end: \>
|
131
|
+
patterns:
|
132
|
+
- include: "#regex_sub"
|
133
|
+
- include: "#nest_ltgt_r"
|
134
|
+
nest_curly_i:
|
135
|
+
captures:
|
136
|
+
"0":
|
137
|
+
name: punctuation.section.scope.ruby
|
138
|
+
begin: \{
|
139
|
+
end: \}
|
140
|
+
patterns:
|
141
|
+
- include: "#interpolated_ruby"
|
142
|
+
- include: "#escaped_char"
|
143
|
+
- include: "#nest_curly_i"
|
144
|
+
nest_ltgt_i:
|
145
|
+
captures:
|
146
|
+
"0":
|
147
|
+
name: punctuation.section.scope.ruby
|
148
|
+
begin: \<
|
149
|
+
end: \>
|
150
|
+
patterns:
|
151
|
+
- include: "#interpolated_ruby"
|
152
|
+
- include: "#escaped_char"
|
153
|
+
- include: "#nest_ltgt_i"
|
154
|
+
nest_ltgt:
|
155
|
+
captures:
|
156
|
+
"0":
|
157
|
+
name: punctuation.section.scope.ruby
|
158
|
+
begin: \<
|
159
|
+
end: \>
|
160
|
+
patterns:
|
161
|
+
- include: "#nest_ltgt"
|
162
|
+
nest_curly_and_self:
|
163
|
+
patterns:
|
164
|
+
- captures:
|
165
|
+
"0":
|
166
|
+
name: punctuation.section.scope.ruby
|
167
|
+
begin: \{
|
168
|
+
end: \}
|
169
|
+
patterns:
|
170
|
+
- include: "#nest_curly_and_self"
|
171
|
+
- include: $self
|
172
|
+
nest_parens:
|
173
|
+
captures:
|
174
|
+
"0":
|
175
|
+
name: punctuation.section.scope.ruby
|
176
|
+
begin: \(
|
177
|
+
end: \)
|
178
|
+
patterns:
|
179
|
+
- include: "#nest_parens"
|
180
|
+
nest_brackets_r:
|
181
|
+
captures:
|
182
|
+
"0":
|
183
|
+
name: punctuation.section.scope.ruby
|
184
|
+
begin: \[
|
185
|
+
end: \]
|
186
|
+
patterns:
|
187
|
+
- include: "#regex_sub"
|
188
|
+
- include: "#nest_brackets_r"
|
189
|
+
nest_curly:
|
190
|
+
captures:
|
191
|
+
"0":
|
192
|
+
name: punctuation.section.scope.ruby
|
193
|
+
begin: \{
|
194
|
+
end: \}
|
195
|
+
patterns:
|
196
|
+
- include: "#nest_curly"
|
197
|
+
nest_brackets_i:
|
198
|
+
captures:
|
199
|
+
"0":
|
200
|
+
name: punctuation.section.scope.ruby
|
201
|
+
begin: \[
|
202
|
+
end: \]
|
203
|
+
patterns:
|
204
|
+
- include: "#interpolated_ruby"
|
205
|
+
- include: "#escaped_char"
|
206
|
+
- include: "#nest_brackets_i"
|
207
|
+
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:
|
236
|
+
- name: meta.class.ruby
|
237
|
+
captures:
|
238
|
+
"6":
|
239
|
+
name: variable.other.object.ruby
|
240
|
+
"7":
|
241
|
+
name: punctuation.definition.variable.ruby
|
242
|
+
"1":
|
243
|
+
name: keyword.control.class.ruby
|
244
|
+
"2":
|
245
|
+
name: entity.name.type.class.ruby
|
246
|
+
"4":
|
247
|
+
name: entity.other.inherited-class.ruby
|
248
|
+
"5":
|
249
|
+
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_:]+))
|
251
|
+
- name: meta.module.ruby
|
252
|
+
captures:
|
253
|
+
"6":
|
254
|
+
name: punctuation.separator.inheritance.ruby
|
255
|
+
"7":
|
256
|
+
name: entity.other.inherited-class.module.third.ruby
|
257
|
+
"8":
|
258
|
+
name: punctuation.separator.inheritance.ruby
|
259
|
+
"1":
|
260
|
+
name: keyword.control.module.ruby
|
261
|
+
"2":
|
262
|
+
name: entity.name.type.module.ruby
|
263
|
+
"3":
|
264
|
+
name: entity.other.inherited-class.module.first.ruby
|
265
|
+
"4":
|
266
|
+
name: punctuation.separator.inheritance.ruby
|
267
|
+
"5":
|
268
|
+
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*)
|
270
|
+
- 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."
|
273
|
+
- 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(?![?!])
|
275
|
+
comment: everything being a reserved word, not a value and needing a 'end' is a..
|
276
|
+
- name: keyword.control.ruby.start-block
|
277
|
+
match: (?<!\.)\bdo\b\s*
|
278
|
+
comment: contextual smart pair support for block parameters
|
279
|
+
- name: meta.syntax.ruby.start-block
|
280
|
+
match: (?<=\{)(\s+)
|
281
|
+
comment: contextual smart pair support
|
282
|
+
- name: keyword.operator.logical.ruby
|
283
|
+
match: (?<!\.)\b(and|not|or)\b
|
284
|
+
comment: " as above, just doesn't need a 'end' and does a logic operation"
|
285
|
+
- name: keyword.control.pseudo-method.ruby
|
286
|
+
match: (?<!\.)\b(alias|alias_method|break|next|redo|retry|return|super|undef|yield)\b(?![?!])|\bdefined\?|\bblock_given\?
|
287
|
+
comment: " just as above but being not a logical operation"
|
288
|
+
- name: constant.language.ruby
|
289
|
+
match: \b(nil|true|false)\b(?![?!])
|
290
|
+
- name: variable.language.ruby
|
291
|
+
match: \b(__(FILE|LINE)__|self)\b(?![?!])
|
292
|
+
- 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(?![?!])
|
294
|
+
comment: " everything being a method but having a special function is a.."
|
295
|
+
- name: meta.require.ruby
|
296
|
+
captures:
|
297
|
+
"1":
|
298
|
+
name: keyword.other.special-method.ruby
|
299
|
+
begin: \b(require)\b
|
300
|
+
end: $|(?=#)
|
301
|
+
patterns:
|
302
|
+
- include: $base
|
303
|
+
- name: variable.other.readwrite.instance.ruby
|
304
|
+
captures:
|
305
|
+
"1":
|
306
|
+
name: punctuation.definition.variable.ruby
|
307
|
+
match: (@)[a-zA-Z_]\w*
|
308
|
+
- name: variable.other.readwrite.class.ruby
|
309
|
+
captures:
|
310
|
+
"1":
|
311
|
+
name: punctuation.definition.variable.ruby
|
312
|
+
match: (@@)[a-zA-Z_]\w*
|
313
|
+
- name: variable.other.readwrite.global.ruby
|
314
|
+
captures:
|
315
|
+
"1":
|
316
|
+
name: punctuation.definition.variable.ruby
|
317
|
+
match: (\$)[a-zA-Z_]\w*
|
318
|
+
- name: variable.other.readwrite.global.pre-defined.ruby
|
319
|
+
captures:
|
320
|
+
"1":
|
321
|
+
name: punctuation.definition.variable.ruby
|
322
|
+
match: (\$)(!|@|&|`|'|\+|\d|~|=|/|\\|,|;|\.|<|>|_|\*|\$|\?|:|"|-[0adFiIlpv])
|
323
|
+
- name: support.class.ruby
|
324
|
+
match: \b[A-Z][a-z]\w*(?=((\.|::)[A-Za-z]|\[))
|
325
|
+
- name: meta.environment-variable.ruby
|
326
|
+
begin: \b(ENV)\[
|
327
|
+
beginCaptures:
|
328
|
+
"1":
|
329
|
+
name: variable.other.constant.ruby
|
330
|
+
end: \]
|
331
|
+
patterns:
|
332
|
+
- include: $self
|
333
|
+
- name: variable.other.constant.ruby
|
334
|
+
match: \b[A-Z]\w*\b
|
335
|
+
- name: meta.function.method.with-arguments.ruby
|
336
|
+
endCaptures:
|
337
|
+
"0":
|
338
|
+
name: punctuation.definition.parameters.ruby
|
339
|
+
begin: (?<=^|\s)\b(def)\b\s+((?>[a-zA-Z_]\w*(?>\.|::))?(?>[a-zA-Z_]\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?))\s*(\()
|
340
|
+
contentName: variable.parameter.function.ruby
|
341
|
+
beginCaptures:
|
342
|
+
"1":
|
343
|
+
name: keyword.control.def.ruby
|
344
|
+
"2":
|
345
|
+
name: entity.name.function.ruby
|
346
|
+
"3":
|
347
|
+
name: punctuation.definition.parameters.ruby
|
348
|
+
end: \)
|
349
|
+
patterns:
|
350
|
+
- include: $base
|
351
|
+
comment: " the method pattern comes from the symbol pattern, see there for a explaination"
|
352
|
+
- name: meta.function.method.without-arguments.ruby
|
353
|
+
captures:
|
354
|
+
"1":
|
355
|
+
name: keyword.control.def.ruby
|
356
|
+
"3":
|
357
|
+
name: entity.name.function.ruby
|
358
|
+
match: (?<=^|\s)(def)\b(\s+((?>[a-zA-Z_]\w*(?>\.|::))?(?>[a-zA-Z_]\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?)))?
|
359
|
+
comment: " the optional name is just to catch the def also without a method-name"
|
360
|
+
- name: constant.numeric.ruby
|
361
|
+
match: \b(0[xX]\h(?>_?\h)*|\d(?>_?\d)*(\.(?![^[:space:][:digit:]])(?>_?\d)*)?([eE][-+]?\d(?>_?\d)*)?|0[bB][01]+)\b
|
362
|
+
- name: constant.other.symbol.single-quoted.ruby
|
363
|
+
captures:
|
364
|
+
"0":
|
365
|
+
name: punctuation.definition.constant.ruby
|
366
|
+
begin: ":'"
|
367
|
+
end: "'"
|
368
|
+
patterns:
|
369
|
+
- name: constant.character.escape.ruby
|
370
|
+
match: \\['\\]
|
371
|
+
- name: constant.other.symbol.double-quoted.ruby
|
372
|
+
captures:
|
373
|
+
"0":
|
374
|
+
name: punctuation.definition.constant.ruby
|
375
|
+
begin: ":\""
|
376
|
+
end: "\""
|
377
|
+
patterns:
|
378
|
+
- include: "#interpolated_ruby"
|
379
|
+
- include: "#escaped_char"
|
380
|
+
- name: string.quoted.single.ruby
|
381
|
+
endCaptures:
|
382
|
+
"0":
|
383
|
+
name: punctuation.definition.string.end.ruby
|
384
|
+
begin: "'"
|
385
|
+
beginCaptures:
|
386
|
+
"0":
|
387
|
+
name: punctuation.definition.string.begin.ruby
|
388
|
+
end: "'"
|
389
|
+
patterns:
|
390
|
+
- name: constant.character.escape.ruby
|
391
|
+
match: \\'|\\\\
|
392
|
+
comment: single quoted string (does not allow interpolation)
|
393
|
+
- name: string.quoted.double.ruby
|
394
|
+
endCaptures:
|
395
|
+
"0":
|
396
|
+
name: punctuation.definition.string.end.ruby
|
397
|
+
begin: "\""
|
398
|
+
beginCaptures:
|
399
|
+
"0":
|
400
|
+
name: punctuation.definition.string.begin.ruby
|
401
|
+
end: "\""
|
402
|
+
patterns:
|
403
|
+
- include: "#interpolated_ruby"
|
404
|
+
- include: "#escaped_char"
|
405
|
+
comment: double quoted string (allows for interpolation)
|
406
|
+
- name: string.interpolated.ruby
|
407
|
+
endCaptures:
|
408
|
+
"0":
|
409
|
+
name: punctuation.definition.string.end.ruby
|
410
|
+
begin: `
|
411
|
+
beginCaptures:
|
412
|
+
"0":
|
413
|
+
name: punctuation.definition.string.begin.ruby
|
414
|
+
end: `
|
415
|
+
patterns:
|
416
|
+
- include: "#interpolated_ruby"
|
417
|
+
- include: "#escaped_char"
|
418
|
+
comment: execute string (allows for interpolation)
|
419
|
+
- name: string.interpolated.ruby
|
420
|
+
endCaptures:
|
421
|
+
"0":
|
422
|
+
name: punctuation.definition.string.end.ruby
|
423
|
+
begin: "%x\\{"
|
424
|
+
beginCaptures:
|
425
|
+
"0":
|
426
|
+
name: punctuation.definition.string.begin.ruby
|
427
|
+
end: \}
|
428
|
+
patterns:
|
429
|
+
- include: "#interpolated_ruby"
|
430
|
+
- include: "#escaped_char"
|
431
|
+
- include: "#nest_curly_i"
|
432
|
+
comment: execute string (allow for interpolation)
|
433
|
+
- name: string.interpolated.ruby
|
434
|
+
endCaptures:
|
435
|
+
"0":
|
436
|
+
name: punctuation.definition.string.end.ruby
|
437
|
+
begin: "%x\\["
|
438
|
+
beginCaptures:
|
439
|
+
"0":
|
440
|
+
name: punctuation.definition.string.begin.ruby
|
441
|
+
end: \]
|
442
|
+
patterns:
|
443
|
+
- include: "#interpolated_ruby"
|
444
|
+
- include: "#escaped_char"
|
445
|
+
- include: "#nest_brackets_i"
|
446
|
+
comment: execute string (allow for interpolation)
|
447
|
+
- name: string.interpolated.ruby
|
448
|
+
endCaptures:
|
449
|
+
"0":
|
450
|
+
name: punctuation.definition.string.end.ruby
|
451
|
+
begin: "%x\\<"
|
452
|
+
beginCaptures:
|
453
|
+
"0":
|
454
|
+
name: punctuation.definition.string.begin.ruby
|
455
|
+
end: \>
|
456
|
+
patterns:
|
457
|
+
- include: "#interpolated_ruby"
|
458
|
+
- include: "#escaped_char"
|
459
|
+
- include: "#nest_ltgt_i"
|
460
|
+
comment: execute string (allow for interpolation)
|
461
|
+
- name: string.interpolated.ruby
|
462
|
+
endCaptures:
|
463
|
+
"0":
|
464
|
+
name: punctuation.definition.string.end.ruby
|
465
|
+
begin: "%x\\("
|
466
|
+
beginCaptures:
|
467
|
+
"0":
|
468
|
+
name: punctuation.definition.string.begin.ruby
|
469
|
+
end: \)
|
470
|
+
patterns:
|
471
|
+
- include: "#interpolated_ruby"
|
472
|
+
- include: "#escaped_char"
|
473
|
+
- include: "#nest_parens_i"
|
474
|
+
comment: execute string (allow for interpolation)
|
475
|
+
- name: string.interpolated.ruby
|
476
|
+
endCaptures:
|
477
|
+
"0":
|
478
|
+
name: punctuation.definition.string.end.ruby
|
479
|
+
begin: "%x([^\\w])"
|
480
|
+
beginCaptures:
|
481
|
+
"0":
|
482
|
+
name: punctuation.definition.string.begin.ruby
|
483
|
+
end: \1
|
484
|
+
patterns:
|
485
|
+
- include: "#interpolated_ruby"
|
486
|
+
- include: "#escaped_char"
|
487
|
+
comment: execute string (allow for interpolation)
|
488
|
+
- captures:
|
489
|
+
"1":
|
490
|
+
name: string.regexp.classic.ruby
|
491
|
+
"2":
|
492
|
+
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"
|
530
|
+
contentName: string.regexp.classic.ruby
|
531
|
+
end: ((/[eimnosux]*))
|
532
|
+
patterns:
|
533
|
+
- 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"
|
538
|
+
- name: string.regexp.mod-r.ruby
|
539
|
+
endCaptures:
|
540
|
+
"0":
|
541
|
+
name: punctuation.definition.string.end.ruby
|
542
|
+
begin: "%r\\{"
|
543
|
+
beginCaptures:
|
544
|
+
"0":
|
545
|
+
name: punctuation.definition.string.begin.ruby
|
546
|
+
end: \}[eimnosux]*
|
547
|
+
patterns:
|
548
|
+
- include: "#regex_sub"
|
549
|
+
- include: "#nest_curly_r"
|
550
|
+
comment: regular expressions (literal)
|
551
|
+
- name: string.regexp.mod-r.ruby
|
552
|
+
endCaptures:
|
553
|
+
"0":
|
554
|
+
name: punctuation.definition.string.end.ruby
|
555
|
+
begin: "%r\\["
|
556
|
+
beginCaptures:
|
557
|
+
"0":
|
558
|
+
name: punctuation.definition.string.begin.ruby
|
559
|
+
end: \][eimnosux]*
|
560
|
+
patterns:
|
561
|
+
- include: "#regex_sub"
|
562
|
+
- include: "#nest_brackets_r"
|
563
|
+
comment: regular expressions (literal)
|
564
|
+
- name: string.regexp.mod-r.ruby
|
565
|
+
endCaptures:
|
566
|
+
"0":
|
567
|
+
name: punctuation.definition.string.end.ruby
|
568
|
+
begin: "%r\\("
|
569
|
+
beginCaptures:
|
570
|
+
"0":
|
571
|
+
name: punctuation.definition.string.begin.ruby
|
572
|
+
end: \)[eimnosux]*
|
573
|
+
patterns:
|
574
|
+
- include: "#regex_sub"
|
575
|
+
- include: "#nest_parens_r"
|
576
|
+
comment: regular expressions (literal)
|
577
|
+
- name: string.regexp.mod-r.ruby
|
578
|
+
endCaptures:
|
579
|
+
"0":
|
580
|
+
name: punctuation.definition.string.end.ruby
|
581
|
+
begin: "%r\\<"
|
582
|
+
beginCaptures:
|
583
|
+
"0":
|
584
|
+
name: punctuation.definition.string.begin.ruby
|
585
|
+
end: \>[eimnosux]*
|
586
|
+
patterns:
|
587
|
+
- include: "#regex_sub"
|
588
|
+
- include: "#nest_ltgt_r"
|
589
|
+
comment: regular expressions (literal)
|
590
|
+
- name: string.regexp.mod-r.ruby
|
591
|
+
endCaptures:
|
592
|
+
"0":
|
593
|
+
name: punctuation.definition.string.end.ruby
|
594
|
+
begin: "%r([^\\w])"
|
595
|
+
beginCaptures:
|
596
|
+
"0":
|
597
|
+
name: punctuation.definition.string.begin.ruby
|
598
|
+
end: \1[eimnosux]*
|
599
|
+
patterns:
|
600
|
+
- include: "#regex_sub"
|
601
|
+
comment: regular expressions (literal)
|
602
|
+
- name: string.quoted.other.literal.upper.ruby
|
603
|
+
endCaptures:
|
604
|
+
"0":
|
605
|
+
name: punctuation.definition.string.end.ruby
|
606
|
+
begin: "%[QWSR]?\\("
|
607
|
+
beginCaptures:
|
608
|
+
"0":
|
609
|
+
name: punctuation.definition.string.begin.ruby
|
610
|
+
end: \)
|
611
|
+
patterns:
|
612
|
+
- include: "#interpolated_ruby"
|
613
|
+
- include: "#escaped_char"
|
614
|
+
- include: "#nest_parens_i"
|
615
|
+
comment: literal capable of interpolation ()
|
616
|
+
- name: string.quoted.other.literal.upper.ruby
|
617
|
+
endCaptures:
|
618
|
+
"0":
|
619
|
+
name: punctuation.definition.string.end.ruby
|
620
|
+
begin: "%[QWSR]?\\["
|
621
|
+
beginCaptures:
|
622
|
+
"0":
|
623
|
+
name: punctuation.definition.string.begin.ruby
|
624
|
+
end: \]
|
625
|
+
patterns:
|
626
|
+
- include: "#interpolated_ruby"
|
627
|
+
- include: "#escaped_char"
|
628
|
+
- include: "#nest_brackets_i"
|
629
|
+
comment: literal capable of interpolation []
|
630
|
+
- name: string.quoted.other.literal.upper.ruby
|
631
|
+
endCaptures:
|
632
|
+
"0":
|
633
|
+
name: punctuation.definition.string.end.ruby
|
634
|
+
begin: "%[QWSR]?\\<"
|
635
|
+
beginCaptures:
|
636
|
+
"0":
|
637
|
+
name: punctuation.definition.string.begin.ruby
|
638
|
+
end: \>
|
639
|
+
patterns:
|
640
|
+
- include: "#interpolated_ruby"
|
641
|
+
- include: "#escaped_char"
|
642
|
+
- include: "#nest_ltgt_i"
|
643
|
+
comment: literal capable of interpolation <>
|
644
|
+
- name: string.quoted.double.ruby.mod
|
645
|
+
endCaptures:
|
646
|
+
"0":
|
647
|
+
name: punctuation.definition.string.end.ruby
|
648
|
+
begin: "%[QWSR]?\\{"
|
649
|
+
beginCaptures:
|
650
|
+
"0":
|
651
|
+
name: punctuation.definition.string.begin.ruby
|
652
|
+
end: \}
|
653
|
+
patterns:
|
654
|
+
- include: "#interpolated_ruby"
|
655
|
+
- include: "#escaped_char"
|
656
|
+
- include: "#nest_curly_i"
|
657
|
+
comment: literal capable of interpolation -- {}
|
658
|
+
- name: string.quoted.other.literal.upper.ruby
|
659
|
+
endCaptures:
|
660
|
+
"0":
|
661
|
+
name: punctuation.definition.string.end.ruby
|
662
|
+
begin: "%[QWSR]([^\\w])"
|
663
|
+
beginCaptures:
|
664
|
+
"0":
|
665
|
+
name: punctuation.definition.string.begin.ruby
|
666
|
+
end: \1
|
667
|
+
patterns:
|
668
|
+
- include: "#interpolated_ruby"
|
669
|
+
- include: "#escaped_char"
|
670
|
+
comment: literal capable of interpolation -- wildcard
|
671
|
+
- name: string.quoted.other.literal.other.ruby
|
672
|
+
endCaptures:
|
673
|
+
"0":
|
674
|
+
name: punctuation.definition.string.end.ruby
|
675
|
+
begin: "%([^\\w\\s=])"
|
676
|
+
beginCaptures:
|
677
|
+
"0":
|
678
|
+
name: punctuation.definition.string.begin.ruby
|
679
|
+
end: \1
|
680
|
+
patterns:
|
681
|
+
- include: "#interpolated_ruby"
|
682
|
+
- include: "#escaped_char"
|
683
|
+
comment: literal capable of interpolation -- wildcard
|
684
|
+
- name: string.quoted.other.literal.lower.ruby
|
685
|
+
endCaptures:
|
686
|
+
"0":
|
687
|
+
name: punctuation.definition.string.end.ruby
|
688
|
+
begin: "%[qws]\\("
|
689
|
+
beginCaptures:
|
690
|
+
"0":
|
691
|
+
name: punctuation.definition.string.begin.ruby
|
692
|
+
end: \)
|
693
|
+
patterns:
|
694
|
+
- name: constant.character.escape.ruby
|
695
|
+
match: \\\)|\\\\
|
696
|
+
- include: "#nest_parens"
|
697
|
+
comment: literal incapable of interpolation -- ()
|
698
|
+
- name: string.quoted.other.literal.lower.ruby
|
699
|
+
endCaptures:
|
700
|
+
"0":
|
701
|
+
name: punctuation.definition.string.end.ruby
|
702
|
+
begin: "%[qws]\\<"
|
703
|
+
beginCaptures:
|
704
|
+
"0":
|
705
|
+
name: punctuation.definition.string.begin.ruby
|
706
|
+
end: \>
|
707
|
+
patterns:
|
708
|
+
- name: constant.character.escape.ruby
|
709
|
+
match: \\\>|\\\\
|
710
|
+
- include: "#nest_ltgt"
|
711
|
+
comment: literal incapable of interpolation -- <>
|
712
|
+
- name: string.quoted.other.literal.lower.ruby
|
713
|
+
endCaptures:
|
714
|
+
"0":
|
715
|
+
name: punctuation.definition.string.end.ruby
|
716
|
+
begin: "%[qws]\\["
|
717
|
+
beginCaptures:
|
718
|
+
"0":
|
719
|
+
name: punctuation.definition.string.begin.ruby
|
720
|
+
end: \]
|
721
|
+
patterns:
|
722
|
+
- name: constant.character.escape.ruby
|
723
|
+
match: \\\]|\\\\
|
724
|
+
- include: "#nest_brackets"
|
725
|
+
comment: literal incapable of interpolation -- []
|
726
|
+
- name: string.quoted.other.literal.lower.ruby
|
727
|
+
endCaptures:
|
728
|
+
"0":
|
729
|
+
name: punctuation.definition.string.end.ruby
|
730
|
+
begin: "%[qws]\\{"
|
731
|
+
beginCaptures:
|
732
|
+
"0":
|
733
|
+
name: punctuation.definition.string.begin.ruby
|
734
|
+
end: \}
|
735
|
+
patterns:
|
736
|
+
- name: constant.character.escape.ruby
|
737
|
+
match: \\\}|\\\\
|
738
|
+
- include: "#nest_curly"
|
739
|
+
comment: literal incapable of interpolation -- {}
|
740
|
+
- name: string.quoted.other.literal.lower.ruby
|
741
|
+
endCaptures:
|
742
|
+
"0":
|
743
|
+
name: punctuation.definition.string.end.ruby
|
744
|
+
begin: "%[qws]([^\\w])"
|
745
|
+
beginCaptures:
|
746
|
+
"0":
|
747
|
+
name: punctuation.definition.string.begin.ruby
|
748
|
+
end: \1
|
749
|
+
patterns:
|
750
|
+
- match: \\.
|
751
|
+
comment: Cant be named because its not neccesarily an escape.
|
752
|
+
comment: literal incapable of interpolation -- wildcard
|
753
|
+
- name: constant.other.symbol.ruby
|
754
|
+
captures:
|
755
|
+
"1":
|
756
|
+
name: punctuation.definition.constant.ruby
|
757
|
+
match: (?<!:)(:)(?>[a-zA-Z_]\w*(?>[?!]|=(?![>=]))?|===?|>[>=]?|<[<=]?|<=>|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?|@@?[a-zA-Z_]\w*)
|
758
|
+
comment: symbols
|
759
|
+
- name: comment.block.documentation.ruby
|
760
|
+
captures:
|
761
|
+
"0":
|
762
|
+
name: punctuation.definition.comment.ruby
|
763
|
+
begin: ^=begin
|
764
|
+
end: ^=end
|
765
|
+
comment: multiline comments
|
766
|
+
- name: comment.line.number-sign.ruby
|
767
|
+
captures:
|
768
|
+
"1":
|
769
|
+
name: punctuation.definition.comment.ruby
|
770
|
+
match: (?:^[ \t]+)?(#).*$\n?
|
771
|
+
- 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":
|
794
|
+
name: string.unquoted.program-block.ruby
|
795
|
+
begin: ^__END__\n
|
796
|
+
contentName: text.plain
|
797
|
+
end: (?=not)impossible
|
798
|
+
patterns:
|
799
|
+
- name: text.html.embedded.ruby
|
800
|
+
begin: (?=<?xml|<(?i:html\b)|!DOCTYPE (?i:html\b))
|
801
|
+
end: (?=not)impossible
|
802
|
+
patterns:
|
803
|
+
- include: text.html.basic
|
804
|
+
comment: __END__ marker
|
805
|
+
- name: string.unquoted.heredoc.ruby
|
806
|
+
endCaptures:
|
807
|
+
"0":
|
808
|
+
name: punctuation.definition.string.end.ruby
|
809
|
+
begin: (?>\=\s*<<(\w+))(?!\s+#\s*([Cc]|sh|[Jj]ava))
|
810
|
+
beginCaptures:
|
811
|
+
"0":
|
812
|
+
name: punctuation.definition.string.begin.ruby
|
813
|
+
end: ^\1$
|
814
|
+
patterns:
|
815
|
+
- include: "#heredoc"
|
816
|
+
- include: "#interpolated_ruby"
|
817
|
+
- include: "#escaped_char"
|
818
|
+
- name: string.unquoted.embedded.html.ruby
|
819
|
+
endCaptures:
|
820
|
+
"0":
|
821
|
+
name: punctuation.definition.string.end.ruby
|
822
|
+
begin: (?><<-HTML\b)
|
823
|
+
contentName: text.html.embedded.ruby
|
824
|
+
beginCaptures:
|
825
|
+
"0":
|
826
|
+
name: punctuation.definition.string.begin.ruby
|
827
|
+
end: \s*HTML$
|
828
|
+
patterns:
|
829
|
+
- include: "#heredoc"
|
830
|
+
- include: text.html.basic
|
831
|
+
- include: "#interpolated_ruby"
|
832
|
+
- include: "#escaped_char"
|
833
|
+
comment: heredoc with embedded HTML and indented terminator
|
834
|
+
- name: string.unquoted.embedded.ruby.ruby
|
835
|
+
endCaptures:
|
836
|
+
"0":
|
837
|
+
name: punctuation.definition.string.end.ruby
|
838
|
+
begin: (?><<-(["\\']?)(\w+_(?i:eval))\1)
|
839
|
+
beginCaptures:
|
840
|
+
"0":
|
841
|
+
name: punctuation.definition.string.begin.ruby
|
842
|
+
end: \s*\2$
|
843
|
+
patterns:
|
844
|
+
- include: "#heredoc"
|
845
|
+
- include: "#interpolated_ruby"
|
846
|
+
- include: source.ruby
|
847
|
+
- include: "#escaped_char"
|
848
|
+
comment: ruby code in heredoc, interpolated
|
849
|
+
- name: string.unquoted.heredoc.ruby
|
850
|
+
endCaptures:
|
851
|
+
"0":
|
852
|
+
name: punctuation.definition.string.end.ruby
|
853
|
+
begin: (?><<-(\w+))
|
854
|
+
beginCaptures:
|
855
|
+
"0":
|
856
|
+
name: punctuation.definition.string.begin.ruby
|
857
|
+
end: \s*\1$
|
858
|
+
patterns:
|
859
|
+
- include: "#heredoc"
|
860
|
+
- include: "#interpolated_ruby"
|
861
|
+
- include: "#escaped_char"
|
862
|
+
comment: heredoc with indented terminator
|
863
|
+
- name: string.unquoted.embedded.c.ruby
|
864
|
+
endCaptures:
|
865
|
+
"0":
|
866
|
+
name: punctuation.definition.string.end.ruby
|
867
|
+
begin: (?>\=\s*<<(\w+))(?=\s+#\s*[Cc](?!(\+\+|[Ss][Ss])))
|
868
|
+
beginCaptures:
|
869
|
+
"0":
|
870
|
+
name: punctuation.definition.string.begin.ruby
|
871
|
+
end: ^\1$
|
872
|
+
patterns:
|
873
|
+
- include: "#heredoc"
|
874
|
+
- include: source.c
|
875
|
+
- include: "#interpolated_ruby"
|
876
|
+
- include: "#escaped_char"
|
877
|
+
- name: string.unquoted.embedded.cplusplus.ruby
|
878
|
+
endCaptures:
|
879
|
+
"0":
|
880
|
+
name: punctuation.definition.string.end.ruby
|
881
|
+
begin: (?>\=\s*<<(\w+))(?=\s+#\s*[Cc]\+\+)
|
882
|
+
beginCaptures:
|
883
|
+
"0":
|
884
|
+
name: punctuation.definition.string.begin.ruby
|
885
|
+
end: ^\1$
|
886
|
+
patterns:
|
887
|
+
- include: "#heredoc"
|
888
|
+
- include: source.c++
|
889
|
+
- include: "#interpolated_ruby"
|
890
|
+
- include: "#escaped_char"
|
891
|
+
- name: string.unquoted.embedded.css.ruby
|
892
|
+
endCaptures:
|
893
|
+
"0":
|
894
|
+
name: punctuation.definition.string.end.ruby
|
895
|
+
begin: (?>\=\s*<<(\w+))(?=\s+#\s*[Cc][Ss][Ss])
|
896
|
+
beginCaptures:
|
897
|
+
"0":
|
898
|
+
name: punctuation.definition.string.begin.ruby
|
899
|
+
end: ^\1$
|
900
|
+
patterns:
|
901
|
+
- include: "#heredoc"
|
902
|
+
- include: source.css
|
903
|
+
- include: "#interpolated_ruby"
|
904
|
+
- include: "#escaped_char"
|
905
|
+
- name: string.unquoted.embedded.js.ruby
|
906
|
+
endCaptures:
|
907
|
+
"0":
|
908
|
+
name: punctuation.definition.string.end.ruby
|
909
|
+
begin: (?>\=\s*<<(\w+))(?=\s+#\s*[Jj]ava[Ss]cript)
|
910
|
+
beginCaptures:
|
911
|
+
"0":
|
912
|
+
name: punctuation.definition.string.begin.ruby
|
913
|
+
end: ^\1$
|
914
|
+
patterns:
|
915
|
+
- include: "#heredoc"
|
916
|
+
- include: source.js
|
917
|
+
- include: "#interpolated_ruby"
|
918
|
+
- include: "#escaped_char"
|
919
|
+
- name: string.unquoted.embedded.shell.ruby
|
920
|
+
endCaptures:
|
921
|
+
"0":
|
922
|
+
name: punctuation.definition.string.end.ruby
|
923
|
+
begin: (?>\=\s*<<(\w+))(?=\s+#\s*sh)
|
924
|
+
beginCaptures:
|
925
|
+
"0":
|
926
|
+
name: punctuation.definition.string.begin.ruby
|
927
|
+
end: ^\1$
|
928
|
+
patterns:
|
929
|
+
- include: "#heredoc"
|
930
|
+
- include: source.shell
|
931
|
+
- include: "#interpolated_ruby"
|
932
|
+
- include: "#escaped_char"
|
933
|
+
- name: meta.function-call.method.with-arguments.ruby
|
934
|
+
begin: (?<=[^\.])(?=(\.|::)[a-zA-Z][a-zA-Z0-9_!?=]*\()(\.|::)
|
935
|
+
beginCaptures:
|
936
|
+
"1":
|
937
|
+
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"
|
941
|
+
- name: entity.name.function.ruby
|
942
|
+
match: ([a-zA-Z][a-zA-Z0-9_!?=]*)(?=[^a-zA-Z0-9_!?])
|
943
|
+
- 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":
|
947
|
+
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"
|
951
|
+
- name: entity.name.function.ruby
|
952
|
+
match: ([a-zA-Z][a-zA-Z0-9_!?]*)(?=[^a-zA-Z0-9_!?])
|
953
|
+
- 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"
|
958
|
+
- name: entity.name.function.ruby
|
959
|
+
match: ([a-zA-Z0-9_!?]+)(?=\()
|
960
|
+
- captures:
|
961
|
+
"1":
|
962
|
+
name: punctuation.separator.variable.ruby
|
963
|
+
begin: (?<=\{|do|\{\s|do\s)(\|)
|
964
|
+
end: (\|)
|
965
|
+
patterns:
|
966
|
+
- name: variable.other.block.ruby
|
967
|
+
match: "[_a-zA-Z][_a-zA-Z0-9]*"
|
968
|
+
- name: punctuation.separator.variable.ruby
|
969
|
+
match: ","
|
970
|
+
- name: punctuation.separator.key-value
|
971
|
+
match: =>
|
972
|
+
- name: keyword.operator.unary.ruby
|
973
|
+
match: \+@|-@
|
974
|
+
- name: keyword.operator.assignment.augmented.ruby
|
975
|
+
match: <<=|%=|&=|\*=|\*\*=|\+=|\-=|\^=|\|{1,2}=|/=|<<
|
976
|
+
- name: keyword.operator.comparison.ruby
|
977
|
+
match: <=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?<=[ \t])\?
|
978
|
+
- name: keyword.operator.logical.ruby
|
979
|
+
match: (?<=[ \t])!|\bnot\b|&&|\band\b|\|\||\bor\b|\^
|
980
|
+
- name: keyword.operator.arithmetic.ruby
|
981
|
+
match: (%|&|\*\*|\*|\+|\-|/)
|
982
|
+
- name: keyword.operator.assignment.ruby
|
983
|
+
match: "="
|
984
|
+
- name: keyword.operator.other.ruby
|
985
|
+
match: \||~|>>
|
986
|
+
- name: punctuation.separator.other.ruby
|
987
|
+
match: ":"
|
988
|
+
- name: punctuation.separator.statement.ruby
|
989
|
+
match: \;
|
990
|
+
- name: punctuation.separator.object.ruby
|
991
|
+
match: ","
|
992
|
+
- name: punctuation.separator.method.ruby
|
993
|
+
match: "\\.|::"
|
994
|
+
- name: punctuation.section.scope.ruby
|
995
|
+
match: \{|\}
|
996
|
+
- name: punctuation.section.array.ruby
|
997
|
+
match: \[|\]
|
998
|
+
- 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"
|