rouge 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/bin/rougify +1 -1
- data/lib/rouge/demos/{text → plaintext} +0 -0
- data/lib/rouge/formatters/html.rb +13 -8
- data/lib/rouge/formatters/terminal256.rb +15 -11
- data/lib/rouge/lexer.rb +3 -1
- data/lib/rouge/lexers/c.rb +65 -55
- data/lib/rouge/lexers/clojure.rb +19 -19
- data/lib/rouge/lexers/coffeescript.rb +42 -42
- data/lib/rouge/lexers/common_lisp.rb +49 -48
- data/lib/rouge/lexers/conf.rb +6 -6
- data/lib/rouge/lexers/cpp.rb +48 -48
- data/lib/rouge/lexers/csharp.rb +25 -25
- data/lib/rouge/lexers/css.rb +32 -33
- data/lib/rouge/lexers/diff.rb +8 -8
- data/lib/rouge/lexers/elixir.rb +30 -30
- data/lib/rouge/lexers/erb.rb +5 -5
- data/lib/rouge/lexers/erlang.rb +38 -38
- data/lib/rouge/lexers/factor.rb +56 -56
- data/lib/rouge/lexers/gherkin.rb +27 -27
- data/lib/rouge/lexers/go.rb +21 -21
- data/lib/rouge/lexers/groovy.rb +32 -32
- data/lib/rouge/lexers/haml.rb +35 -35
- data/lib/rouge/lexers/handlebars.rb +27 -27
- data/lib/rouge/lexers/haskell.rb +78 -79
- data/lib/rouge/lexers/html.rb +28 -28
- data/lib/rouge/lexers/http.rb +13 -13
- data/lib/rouge/lexers/ini.rb +13 -13
- data/lib/rouge/lexers/io.rb +19 -19
- data/lib/rouge/lexers/java.rb +29 -29
- data/lib/rouge/lexers/javascript.rb +49 -52
- data/lib/rouge/lexers/literate_haskell.rb +5 -5
- data/lib/rouge/lexers/llvm.rb +14 -14
- data/lib/rouge/lexers/lua.rb +33 -33
- data/lib/rouge/lexers/make.rb +26 -26
- data/lib/rouge/lexers/markdown.rb +49 -49
- data/lib/rouge/lexers/nginx.rb +19 -19
- data/lib/rouge/lexers/perl.rb +53 -54
- data/lib/rouge/lexers/php.rb +42 -43
- data/lib/rouge/lexers/{text.rb → plain_text.rb} +3 -2
- data/lib/rouge/lexers/prolog.rb +19 -19
- data/lib/rouge/lexers/puppet.rb +40 -40
- data/lib/rouge/lexers/python.rb +63 -63
- data/lib/rouge/lexers/r.rb +15 -15
- data/lib/rouge/lexers/racket.rb +29 -29
- data/lib/rouge/lexers/ruby.rb +94 -97
- data/lib/rouge/lexers/rust.rb +37 -37
- data/lib/rouge/lexers/sass.rb +15 -15
- data/lib/rouge/lexers/sass/common.rb +144 -136
- data/lib/rouge/lexers/scheme.rb +25 -25
- data/lib/rouge/lexers/scss.rb +7 -7
- data/lib/rouge/lexers/sed.rb +39 -39
- data/lib/rouge/lexers/shell.rb +45 -45
- data/lib/rouge/lexers/smalltalk.rb +36 -36
- data/lib/rouge/lexers/sql.rb +27 -27
- data/lib/rouge/lexers/tcl.rb +34 -34
- data/lib/rouge/lexers/tex.rb +24 -24
- data/lib/rouge/lexers/toml.rb +18 -18
- data/lib/rouge/lexers/viml.rb +19 -19
- data/lib/rouge/lexers/xml.rb +16 -16
- data/lib/rouge/lexers/yaml.rb +78 -81
- data/lib/rouge/plugins/redcarpet.rb +1 -1
- data/lib/rouge/regex_lexer.rb +31 -14
- data/lib/rouge/template_lexer.rb +1 -1
- data/lib/rouge/theme.rb +12 -10
- data/lib/rouge/themes/thankful_eyes.rb +43 -43
- data/lib/rouge/token.rb +145 -148
- data/lib/rouge/version.rb +1 -1
- metadata +4 -4
data/lib/rouge/lexers/sql.rb
CHANGED
@@ -85,52 +85,52 @@ module Rouge
|
|
85
85
|
end
|
86
86
|
|
87
87
|
state :root do
|
88
|
-
rule /\s+/m,
|
89
|
-
rule /--.*?\n/,
|
90
|
-
rule %r(/\*),
|
91
|
-
rule /\d+/,
|
92
|
-
rule /'/,
|
93
|
-
rule /"/,
|
94
|
-
rule /`/,
|
88
|
+
rule /\s+/m, Text
|
89
|
+
rule /--.*?\n/, Comment::Single
|
90
|
+
rule %r(/\*), Comment::Multiline, :multiline_comments
|
91
|
+
rule /\d+/, Num::Integer
|
92
|
+
rule /'/, Str::Single, :single_string
|
93
|
+
rule /"/, Name::Variable, :double_string
|
94
|
+
rule /`/, Name::Variable, :backtick
|
95
95
|
|
96
96
|
rule /\w[\w\d]*/ do |m|
|
97
97
|
if self.class.keywords.include? m[0].upcase
|
98
|
-
token
|
98
|
+
token Keyword
|
99
99
|
else
|
100
|
-
token
|
100
|
+
token Name
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
-
rule %r([+*/<>=~!@#%^&|?^-]),
|
105
|
-
rule /[;:()\[\],.]/,
|
104
|
+
rule %r([+*/<>=~!@#%^&|?^-]), Operator
|
105
|
+
rule /[;:()\[\],.]/, Punctuation
|
106
106
|
end
|
107
107
|
|
108
108
|
state :multiline_comments do
|
109
|
-
rule %r(/[*]),
|
110
|
-
rule %r([*]/),
|
111
|
-
rule %r([^/*]+),
|
112
|
-
rule %r([/*]),
|
109
|
+
rule %r(/[*]), Comment::Multiline, :multiline_comments
|
110
|
+
rule %r([*]/), Comment::Multiline, :pop!
|
111
|
+
rule %r([^/*]+), Comment::Multiline
|
112
|
+
rule %r([/*]), Comment::Multiline
|
113
113
|
end
|
114
114
|
|
115
115
|
state :backtick do
|
116
|
-
rule /\\./,
|
117
|
-
rule /``/,
|
118
|
-
rule /`/,
|
119
|
-
rule /[^\\`]+/,
|
116
|
+
rule /\\./, Str::Escape
|
117
|
+
rule /``/, Str::Escape
|
118
|
+
rule /`/, Name::Variable, :pop!
|
119
|
+
rule /[^\\`]+/, Name::Variable
|
120
120
|
end
|
121
121
|
|
122
122
|
state :single_string do
|
123
|
-
rule /\\./,
|
124
|
-
rule /''/,
|
125
|
-
rule /'/,
|
126
|
-
rule /[^\\']+/,
|
123
|
+
rule /\\./, Str::Escape
|
124
|
+
rule /''/, Str::Escape
|
125
|
+
rule /'/, Str::Single, :pop!
|
126
|
+
rule /[^\\']+/, Str::Single
|
127
127
|
end
|
128
128
|
|
129
129
|
state :double_string do
|
130
|
-
rule /\\./,
|
131
|
-
rule /""/,
|
132
|
-
rule /"/,
|
133
|
-
rule /[^\\"]+/,
|
130
|
+
rule /\\./, Str::Escape
|
131
|
+
rule /""/, Str::Escape
|
132
|
+
rule /"/, Name::Variable, :pop!
|
133
|
+
rule /[^\\"]+/, Name::Variable
|
134
134
|
end
|
135
135
|
end
|
136
136
|
end
|
data/lib/rouge/lexers/tcl.rb
CHANGED
@@ -41,21 +41,21 @@ module Rouge
|
|
41
41
|
NOT_CHARS = lambda { |list| Regexp.new %/[^#{list.join}]/ }
|
42
42
|
|
43
43
|
state :word do
|
44
|
-
rule /\{\*\}/,
|
44
|
+
rule /\{\*\}/, Keyword
|
45
45
|
|
46
46
|
mixin :brace_abort
|
47
47
|
mixin :interp
|
48
|
-
rule /\{/,
|
49
|
-
rule /\(/,
|
50
|
-
rule /"/,
|
51
|
-
rule /#{NOT_CHARS[END_WORD]}+?(?=#{CHARS[OPEN+['\\\\']]})/,
|
48
|
+
rule /\{/, Punctuation, :brace
|
49
|
+
rule /\(/, Punctuation, :paren
|
50
|
+
rule /"/, Str::Double, :string
|
51
|
+
rule /#{NOT_CHARS[END_WORD]}+?(?=#{CHARS[OPEN+['\\\\']]})/, Text
|
52
52
|
end
|
53
53
|
|
54
54
|
def self.gen_command_state(name='')
|
55
55
|
state(:"command#{name}") do
|
56
56
|
mixin :word
|
57
57
|
|
58
|
-
rule /##{NOT_CHARS[END_LINE]}+/,
|
58
|
+
rule /##{NOT_CHARS[END_LINE]}+/, Comment::Single
|
59
59
|
|
60
60
|
rule /(?=#{CHARS[END_WORD]})/ do
|
61
61
|
push :"params#{name}"
|
@@ -63,11 +63,11 @@ module Rouge
|
|
63
63
|
|
64
64
|
rule /#{NOT_CHARS[END_WORD]}+/ do |m|
|
65
65
|
if KEYWORDS.include? m[0]
|
66
|
-
token
|
66
|
+
token Keyword
|
67
67
|
elsif BUILTINS.include? m[0]
|
68
|
-
token
|
68
|
+
token Name::Builtin
|
69
69
|
else
|
70
|
-
token
|
70
|
+
token Text
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
@@ -80,24 +80,24 @@ module Rouge
|
|
80
80
|
|
81
81
|
state :"params_in_#{name}" do
|
82
82
|
rule close do
|
83
|
-
token
|
84
|
-
pop
|
83
|
+
token Punctuation
|
84
|
+
pop! 2
|
85
85
|
end
|
86
86
|
|
87
87
|
# mismatched delimiters. Braced strings with mismatched
|
88
88
|
# closing delimiters should be okay, since this is standard
|
89
89
|
# practice, like {]]]]}
|
90
90
|
if opts[:strict]
|
91
|
-
rule CHARS[CLOSE - [close]],
|
91
|
+
rule CHARS[CLOSE - [close]], Error
|
92
92
|
else
|
93
|
-
rule CHARS[CLOSE - [close]],
|
93
|
+
rule CHARS[CLOSE - [close]], Text
|
94
94
|
end
|
95
95
|
|
96
96
|
mixin :params
|
97
97
|
end
|
98
98
|
|
99
99
|
state name do
|
100
|
-
rule close,
|
100
|
+
rule close, Punctuation, :pop!
|
101
101
|
mixin :"command_in_#{name}"
|
102
102
|
end
|
103
103
|
end
|
@@ -116,20 +116,20 @@ module Rouge
|
|
116
116
|
if in_state? :brace
|
117
117
|
pop! until state? :brace
|
118
118
|
pop!
|
119
|
-
token
|
119
|
+
token Punctuation
|
120
120
|
else
|
121
|
-
token
|
121
|
+
token Error
|
122
122
|
end
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
126
126
|
state :params do
|
127
|
-
rule /;/,
|
128
|
-
rule /\n/,
|
129
|
-
rule /else|elseif|then/,
|
127
|
+
rule /;/, Punctuation, :pop!
|
128
|
+
rule /\n/, Text, :pop!
|
129
|
+
rule /else|elseif|then/, Keyword
|
130
130
|
mixin :word
|
131
131
|
mixin :whitespace
|
132
|
-
rule /#{NOT_CHARS[END_WORD]}+/,
|
132
|
+
rule /#{NOT_CHARS[END_WORD]}+/, Text
|
133
133
|
end
|
134
134
|
|
135
135
|
gen_delimiter_states :brace, /\}/, :strict => false
|
@@ -143,26 +143,26 @@ module Rouge
|
|
143
143
|
|
144
144
|
state :whitespace do
|
145
145
|
# not a multiline regex because we want to capture \n sometimes
|
146
|
-
rule /\s+/,
|
146
|
+
rule /\s+/, Text
|
147
147
|
end
|
148
148
|
|
149
149
|
state :interp do
|
150
|
-
rule /\[/,
|
151
|
-
rule /\$[a-z0-9.:-]+/,
|
152
|
-
rule /\$\{.*?\}/m,
|
153
|
-
rule /\$/,
|
150
|
+
rule /\[/, Punctuation, :bracket
|
151
|
+
rule /\$[a-z0-9.:-]+/, Name::Variable
|
152
|
+
rule /\$\{.*?\}/m, Name::Variable
|
153
|
+
rule /\$/, Text
|
154
154
|
|
155
155
|
# escape sequences
|
156
|
-
rule /\\[0-7]{3}/,
|
157
|
-
rule /\\x[0-9a-f]{2}/i,
|
158
|
-
rule /\\u[0-9a-f]{4}/i,
|
159
|
-
rule /\\./m,
|
156
|
+
rule /\\[0-7]{3}/, Str::Escape
|
157
|
+
rule /\\x[0-9a-f]{2}/i, Str::Escape
|
158
|
+
rule /\\u[0-9a-f]{4}/i, Str::Escape
|
159
|
+
rule /\\./m, Str::Escape
|
160
160
|
end
|
161
161
|
|
162
162
|
state :string do
|
163
|
-
rule /"/,
|
163
|
+
rule /"/, Str::Double, :pop!
|
164
164
|
mixin :interp
|
165
|
-
rule /[^\\\[\$"{}]+/m,
|
165
|
+
rule /[^\\\[\$"{}]+/m, Str::Double
|
166
166
|
|
167
167
|
# strings have to keep count of their internal braces, to support
|
168
168
|
# for example { "{ }" }.
|
@@ -170,17 +170,17 @@ module Rouge
|
|
170
170
|
@brace_count ||= 0
|
171
171
|
@brace_count += 1
|
172
172
|
|
173
|
-
token
|
173
|
+
token Str::Double
|
174
174
|
end
|
175
175
|
|
176
176
|
rule /}/ do
|
177
177
|
if in_state? :brace and @brace_count.to_i == 0
|
178
178
|
pop! until state? :brace
|
179
179
|
pop!
|
180
|
-
token
|
180
|
+
token Punctuation
|
181
181
|
else
|
182
182
|
@brace_count -= 1
|
183
|
-
token
|
183
|
+
token Str::Double
|
184
184
|
end
|
185
185
|
end
|
186
186
|
end
|
data/lib/rouge/lexers/tex.rb
CHANGED
@@ -18,53 +18,53 @@ module Rouge
|
|
18
18
|
command = /\\([a-z]+|\s+|.)/i
|
19
19
|
|
20
20
|
state :general do
|
21
|
-
rule /%.*$/,
|
22
|
-
rule /[{}&_^]/,
|
21
|
+
rule /%.*$/, Comment
|
22
|
+
rule /[{}&_^]/, Punctuation
|
23
23
|
end
|
24
24
|
|
25
25
|
state :root do
|
26
|
-
rule /\\\[/,
|
27
|
-
rule /\\\(/,
|
28
|
-
rule /\$\$/,
|
29
|
-
rule /\$/,
|
30
|
-
rule /\\(begin|end)\{.*?\}/,
|
26
|
+
rule /\\\[/, Punctuation, :displaymath
|
27
|
+
rule /\\\(/, Punctuation, :inlinemath
|
28
|
+
rule /\$\$/, Punctuation, :displaymath
|
29
|
+
rule /\$/, Punctuation, :inlinemath
|
30
|
+
rule /\\(begin|end)\{.*?\}/, Name::Tag
|
31
31
|
|
32
32
|
rule /(\\verb)\b(\S)(.*?)(\2)/ do |m|
|
33
|
-
group
|
34
|
-
group
|
35
|
-
group
|
36
|
-
group
|
33
|
+
group Name::Builtin
|
34
|
+
group Keyword::Pseudo
|
35
|
+
group Str::Other
|
36
|
+
group Keyword::Pseudo
|
37
37
|
end
|
38
38
|
|
39
|
-
rule command,
|
39
|
+
rule command, Keyword, :command
|
40
40
|
mixin :general
|
41
|
-
rule /[^\\$%&_^{}]+/,
|
41
|
+
rule /[^\\$%&_^{}]+/, Text
|
42
42
|
end
|
43
43
|
|
44
44
|
state :math do
|
45
|
-
rule command,
|
45
|
+
rule command, Name::Variable
|
46
46
|
mixin :general
|
47
|
-
rule /[0-9]+/,
|
48
|
-
rule /[-=!+*\/()\[\]]/,
|
49
|
-
rule /[^=!+*\/()\[\]\\$%&_^{}0-9-]+/,
|
47
|
+
rule /[0-9]+/, Num
|
48
|
+
rule /[-=!+*\/()\[\]]/, Operator
|
49
|
+
rule /[^=!+*\/()\[\]\\$%&_^{}0-9-]+/, Name::Builtin
|
50
50
|
end
|
51
51
|
|
52
52
|
state :inlinemath do
|
53
|
-
rule /\\\)/,
|
54
|
-
rule /\$/,
|
53
|
+
rule /\\\)/, Punctuation, :pop!
|
54
|
+
rule /\$/, Punctuation, :pop!
|
55
55
|
mixin :math
|
56
56
|
end
|
57
57
|
|
58
58
|
state :displaymath do
|
59
|
-
rule /\\\]/,
|
60
|
-
rule /\$\$/,
|
61
|
-
rule /\$/,
|
59
|
+
rule /\\\]/, Punctuation, :pop!
|
60
|
+
rule /\$\$/, Punctuation, :pop!
|
61
|
+
rule /\$/, Name::Builtin
|
62
62
|
mixin :math
|
63
63
|
end
|
64
64
|
|
65
65
|
state :command do
|
66
|
-
rule /\[.*?\]/,
|
67
|
-
rule /\*/,
|
66
|
+
rule /\[.*?\]/, Name::Attribute
|
67
|
+
rule /\*/, Keyword
|
68
68
|
rule(//) { pop! }
|
69
69
|
end
|
70
70
|
end
|
data/lib/rouge/lexers/toml.rb
CHANGED
@@ -14,55 +14,55 @@ module Rouge
|
|
14
14
|
identifier = /[\w.\S]+/
|
15
15
|
|
16
16
|
state :basic do
|
17
|
-
rule /\s+/,
|
18
|
-
rule /#.*?$/,
|
19
|
-
rule /(true|false)/,
|
20
|
-
rule /(?<!=)\s*\[[\w\d\S]+\]/,
|
17
|
+
rule /\s+/, Text
|
18
|
+
rule /#.*?$/, Comment
|
19
|
+
rule /(true|false)/, Keyword::Constant
|
20
|
+
rule /(?<!=)\s*\[[\w\d\S]+\]/, Name::Namespace
|
21
21
|
|
22
|
-
rule /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/,
|
22
|
+
rule /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/, Literal::Date
|
23
23
|
|
24
|
-
rule /(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?/,
|
25
|
-
rule /\d+[eE][+-]?[0-9]+j?/,
|
26
|
-
rule /\-?\d+/,
|
24
|
+
rule /(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?/, Num::Float
|
25
|
+
rule /\d+[eE][+-]?[0-9]+j?/, Num::Float
|
26
|
+
rule /\-?\d+/, Num::Integer
|
27
27
|
end
|
28
28
|
|
29
29
|
state :root do
|
30
30
|
mixin :basic
|
31
31
|
|
32
32
|
rule /(#{identifier})(\s*)(=)/ do
|
33
|
-
group
|
34
|
-
group
|
33
|
+
group Name::Property; group Text
|
34
|
+
group Punctuation
|
35
35
|
push :value
|
36
36
|
end
|
37
37
|
|
38
38
|
end
|
39
39
|
|
40
40
|
state :value do
|
41
|
-
rule /\n/,
|
41
|
+
rule /\n/, Text, :pop!
|
42
42
|
mixin :content
|
43
43
|
end
|
44
44
|
|
45
45
|
state :content do
|
46
46
|
mixin :basic
|
47
|
-
rule /"/,
|
47
|
+
rule /"/, Str, :dq
|
48
48
|
mixin :esc_str
|
49
|
-
rule /\,/,
|
50
|
-
rule /\[/,
|
49
|
+
rule /\,/, Punctuation
|
50
|
+
rule /\[/, Punctuation, :array
|
51
51
|
end
|
52
52
|
|
53
53
|
state :dq do
|
54
|
-
rule /"/,
|
54
|
+
rule /"/, Str, :pop!
|
55
55
|
mixin :esc_str
|
56
|
-
rule /[^\\"]+/,
|
56
|
+
rule /[^\\"]+/, Str
|
57
57
|
end
|
58
58
|
|
59
59
|
state :esc_str do
|
60
|
-
rule /\\[0t\tn\n "\\ r]/,
|
60
|
+
rule /\\[0t\tn\n "\\ r]/, Str::Escape
|
61
61
|
end
|
62
62
|
|
63
63
|
state :array do
|
64
64
|
mixin :content
|
65
|
-
rule /\]/,
|
65
|
+
rule /\]/, Punctuation, :pop!
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
data/lib/rouge/lexers/viml.rb
CHANGED
@@ -16,48 +16,48 @@ module Rouge
|
|
16
16
|
|
17
17
|
state :root do
|
18
18
|
rule /^(\s*)(".*?)$/ do
|
19
|
-
group
|
19
|
+
group Text; group Comment
|
20
20
|
end
|
21
21
|
|
22
|
-
rule /^\s*\\/,
|
22
|
+
rule /^\s*\\/, Str::Escape
|
23
23
|
|
24
|
-
rule /[ \t]+/,
|
24
|
+
rule /[ \t]+/, Text
|
25
25
|
|
26
26
|
# TODO: regexes can have other delimiters
|
27
|
-
rule %r(/(\\\\|\\/|[^\n/])*/),
|
28
|
-
rule %r("(\\\\|\\"|[^\n"])*"),
|
29
|
-
rule %r('(\\\\|\\'|[^\n'])*'),
|
27
|
+
rule %r(/(\\\\|\\/|[^\n/])*/), Str::Regex
|
28
|
+
rule %r("(\\\\|\\"|[^\n"])*"), Str::Double
|
29
|
+
rule %r('(\\\\|\\'|[^\n'])*'), Str::Single
|
30
30
|
|
31
31
|
# if it's not a string, it's a comment.
|
32
|
-
rule /(?<=\s)"[^-:.%#=*].*?$/,
|
32
|
+
rule /(?<=\s)"[^-:.%#=*].*?$/, Comment
|
33
33
|
|
34
|
-
rule /-?\d+/,
|
35
|
-
rule /#[0-9a-f]{6}/i,
|
36
|
-
rule /^:/,
|
37
|
-
rule /[():<>+=!\[\]{}\|,~.-]/,
|
34
|
+
rule /-?\d+/, Num
|
35
|
+
rule /#[0-9a-f]{6}/i, Num::Hex
|
36
|
+
rule /^:/, Punctuation
|
37
|
+
rule /[():<>+=!\[\]{}\|,~.-]/, Punctuation
|
38
38
|
rule /\b(let|if|else|endif|elseif|fun|function|endfunction)\b/,
|
39
|
-
|
39
|
+
Keyword
|
40
40
|
|
41
|
-
rule /\b(NONE|bold|italic|underline|dark|light)\b/,
|
41
|
+
rule /\b(NONE|bold|italic|underline|dark|light)\b/, Name::Builtin
|
42
42
|
|
43
|
-
rule /[absg]:\w+\b/,
|
43
|
+
rule /[absg]:\w+\b/, Name::Variable
|
44
44
|
rule /\b\w+\b/ do |m|
|
45
45
|
name = m[0]
|
46
46
|
keywords = self.class.keywords
|
47
47
|
|
48
48
|
if mapping_contains?(keywords[:command], name)
|
49
|
-
token
|
49
|
+
token Keyword
|
50
50
|
elsif mapping_contains?(keywords[:option], name)
|
51
|
-
token
|
51
|
+
token Name::Builtin
|
52
52
|
elsif mapping_contains?(keywords[:auto], name)
|
53
|
-
token
|
53
|
+
token Name::Builtin
|
54
54
|
else
|
55
|
-
token
|
55
|
+
token Text
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
59
|
# no errors in VimL!
|
60
|
-
rule /./m,
|
60
|
+
rule /./m, Text
|
61
61
|
end
|
62
62
|
|
63
63
|
def mapping_contains?(mapping, word)
|