Recognize Ruby identifiers beginning with _

:_foo, @_foo, $_foo, and { _foo: 1 } are all valid Ruby syntax, but were
not recognized by the highlighter.
This commit is contained in:
Alyssa Ross 2019-03-15 16:24:44 +00:00
parent 47be98f1fc
commit c409bce579
No known key found for this signature in database
GPG Key ID: C4844408C0657052

View File

@ -38,7 +38,7 @@ add-highlighter shared/ruby/backtick/interpolation region -recurse \{ \Q#{ \} fi
add-highlighter shared/ruby/regex/ default-region fill meta
add-highlighter shared/ruby/regex/interpolation region -recurse \{ \Q#{ \} fill meta
add-highlighter shared/ruby/code/ regex \b([A-Za-z]\w*:(?!:))|([$@][A-Za-z]\w*)|((?<!:):(([A-Za-z]\w*[=?!]?)|(\[\]=?)))|([A-Z]\w*|^|\h)\K::(?=[A-Z]) 0:variable
add-highlighter shared/ruby/code/ regex \b(\w+:(?!:))|([$@]\w+)|((?<!:):((\w+[=?!]?)|(\[\]=?)))|([A-Z]\w*|^|\h)\K::(?=[A-Z]) 0:variable
evaluate-commands %sh{
# Grammar