diff options
| author | Gregory Grubbs <gregory@dynapse.com> | 2021-12-30 06:24:25 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-30 14:24:25 +0100 |
| commit | 830d7ba768f1ebdf27dc87d9dd9c85a8d64f7002 (patch) | |
| tree | 52718ee649404e3cb3c14e535e9f6726cf0de11b /pygments | |
| parent | 80bf2918a254f64c77db83f4b8dbaead9b92b7a3 (diff) | |
| download | pygments-git-830d7ba768f1ebdf27dc87d9dd9c85a8d64f7002.tar.gz | |
GSQL lexer syntax changes (#2006)
* Add square, angle and single underscore to punct; simplify string regex
* Add dollar as operator in LOAD DDL; add pipe as op for resused edge names
* Add to test file to test recent lexer fixes
* Added PR# to new test cases
Diffstat (limited to 'pygments')
| -rwxr-xr-x | pygments/lexers/gsql.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pygments/lexers/gsql.py b/pygments/lexers/gsql.py index da32f780..3dd3ea1a 100755 --- a/pygments/lexers/gsql.py +++ b/pygments/lexers/gsql.py @@ -71,12 +71,11 @@ class GSQLLexer(RegexLexer): 'relations': [ (r'(-\s?)(\(.*\:\w?\))(\s?-)', bygroups(Operator, using(this), Operator)), (r'->|<-', Operator), - (r'[.*{}]', Punctuation), + (r'[.*{}\[\]\<\>\_]', Punctuation), ], 'strings': [ - (r'"(?:\\[tbnrf\'"\\]|[^\\"])*"', String), + (r'"([^"\\]|\\.)*"', String), (r'@{1,2}\w+', Name.Variable), - (r'(\<\w+)?\<(\w+\>?\,?\s?)+\>+', Name.Constant), ], 'whitespace': [ (r'\s+', Whitespace), @@ -86,7 +85,7 @@ class GSQLLexer(RegexLexer): (r'(\d+\.\d+|\d+)', Number), ], 'operators': [ - (r'[^0-9|\/|\-](\-\=|\+\=|\*\=|\\\=|\=|\=\=|\=\=\=|\+|\-|\*|\\|\+\=|\>|\<)[^\>|\/]', Operator), - (r'(\(|\)|\,|\;|\=|\-|\+|\*|\/|\>|\<|\:)', Operator), + (r'\$|[^0-9|\/|\-](\-\=|\+\=|\*\=|\\\=|\=|\=\=|\=\=\=|\+|\-|\*|\\|\+\=|\>|\<)[^\>|\/]', Operator), + (r'(\||\(|\)|\,|\;|\=|\-|\+|\*|\/|\>|\<|\:)', Operator), ], } |
