File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -126,18 +126,11 @@ def self.builtins
126126
127127 rule %r/#{ id } (?=\s *:)/ , Name ::Attribute , :slash_starts_regex
128128
129- rule %r/#{ id } / do |m |
130- if self . class . keywords . include? m [ 0 ]
131- token Keyword
132- elsif self . class . constants . include? m [ 0 ]
133- token Name ::Constant
134- elsif self . class . builtins . include? m [ 0 ]
135- token Name ::Builtin
136- else
137- token Name ::Other
138- end
139-
140- push :slash_starts_regex
129+ keywords id do
130+ rule :keywords , Keyword , :slash_starts_regex
131+ rule :constants , Name ::Constant , :slash_starts_regex
132+ rule :builtins , Name ::Builtin , :slash_starts_regex
133+ default Name ::Other , :slash_starts_regex
141134 end
142135
143136 rule %r/[{(\[ ;,]/ , Punctuation , :slash_starts_regex
You can’t perform that action at this time.
0 commit comments