Skip to content
Snippets Groups Projects
Commit 2a44fd7c authored by Charlie Somerville's avatar Charlie Somerville
Browse files

prettier highlighting for classes and defs

parent dbb074c7
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -459,8 +459,12 @@ class SlashLanguageLexer(ExtendedRegexLexer):
(r'true'+_nkw, Name.Builtin),
(r'false'+_nkw, Name.Builtin),
(r'self'+_nkw, Name.Builtin),
(r'(class)(\s+)([A-Z][a-zA-Z0-9_\']*)',
bygroups(Keyword, Whitespace, Name.Class)),
(r'class'+_nkw, Keyword),
(r'extends'+_nkw, Keyword),
(r'(def)(\s+)([a-z_][a-zA-Z0-9_\']*=?|<<|>>|==|<=>|<=|<|>=|>|\+|-(self)?|~(self)?|\*|/|%|^|&&|&|\||\[\]=?)',
bygroups(Keyword, Whitespace, Name.Function)),
(r'def'+_nkw, Keyword),
(r'if'+_nkw, Keyword),
(r'elsif'+_nkw, Keyword),
Loading
Loading
@@ -486,10 +490,10 @@ class SlashLanguageLexer(ExtendedRegexLexer):
(r'λ', Keyword),
(r'__FILE__'+_nkw, Name.Builtin.Pseudo),
(r'__LINE__'+_nkw, Name.Builtin.Pseudo),
(r'[A-Z][a-zA-Z0-9_]*'+_nkw, Name.Constant),
(r'[a-z_][a-zA-Z0-9_]*'+_nkw, Name.Variable),
(r'@[a-z_][a-zA-Z0-9_]*'+_nkw, Name.Variable.Instance),
(r'@@[a-z_][a-zA-Z0-9_]*'+_nkw, Name.Variable.Class),
(r'[A-Z][a-zA-Z0-9_\']*'+_nkw, Name.Constant),
(r'[a-z_][a-zA-Z0-9_\']*'+_nkw, Name),
(r'@[a-z_][a-zA-Z0-9_\']*'+_nkw, Name.Variable.Instance),
(r'@@[a-z_][a-zA-Z0-9_\']*'+_nkw, Name.Variable.Class),
(r'\(', Punctuation),
(r'\)', Punctuation),
(r'\[', Punctuation),
Loading
Loading
@@ -540,7 +544,7 @@ class SlashLanguageLexer(ExtendedRegexLexer):
(r'::', Operator),
(r':', Operator),
(r'(\s|\n)+', Whitespace),
(r'[a-z_][a-zA-Z0-9_]*', Name.Variable),
(r'[a-z_][a-zA-Z0-9_\']*', Name.Variable),
],
}
 
Loading
Loading
Loading
Loading
@@ -459,8 +459,12 @@ class SlashLanguageLexer(ExtendedRegexLexer):
(r'true'+_nkw, Name.Builtin),
(r'false'+_nkw, Name.Builtin),
(r'self'+_nkw, Name.Builtin),
(r'(class)(\s+)([A-Z][a-zA-Z0-9_\']*)',
bygroups(Keyword, Whitespace, Name.Class)),
(r'class'+_nkw, Keyword),
(r'extends'+_nkw, Keyword),
(r'(def)(\s+)([a-z_][a-zA-Z0-9_\']*=?|<<|>>|==|<=>|<=|<|>=|>|\+|-(self)?|~(self)?|\*|/|%|^|&&|&|\||\[\]=?)',
bygroups(Keyword, Whitespace, Name.Function)),
(r'def'+_nkw, Keyword),
(r'if'+_nkw, Keyword),
(r'elsif'+_nkw, Keyword),
Loading
Loading
@@ -486,10 +490,10 @@ class SlashLanguageLexer(ExtendedRegexLexer):
(r'λ', Keyword),
(r'__FILE__'+_nkw, Name.Builtin.Pseudo),
(r'__LINE__'+_nkw, Name.Builtin.Pseudo),
(r'[A-Z][a-zA-Z0-9_]*'+_nkw, Name.Constant),
(r'[a-z_][a-zA-Z0-9_]*'+_nkw, Name.Variable),
(r'@[a-z_][a-zA-Z0-9_]*'+_nkw, Name.Variable.Instance),
(r'@@[a-z_][a-zA-Z0-9_]*'+_nkw, Name.Variable.Class),
(r'[A-Z][a-zA-Z0-9_\']*'+_nkw, Name.Constant),
(r'[a-z_][a-zA-Z0-9_\']*'+_nkw, Name),
(r'@[a-z_][a-zA-Z0-9_\']*'+_nkw, Name.Variable.Instance),
(r'@@[a-z_][a-zA-Z0-9_\']*'+_nkw, Name.Variable.Class),
(r'\(', Punctuation),
(r'\)', Punctuation),
(r'\[', Punctuation),
Loading
Loading
@@ -540,7 +544,7 @@ class SlashLanguageLexer(ExtendedRegexLexer):
(r'::', Operator),
(r':', Operator),
(r'(\s|\n)+', Whitespace),
(r'[a-z_][a-zA-Z0-9_]*', Name.Variable),
(r'[a-z_][a-zA-Z0-9_\']*', Name.Variable),
],
}
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment