diff options
author | Enrico Tassi <Enrico.Tassi@inria.fr> | 2023-04-30 09:58:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-30 09:58:45 +0200 |
commit | 4575f888183c65eb50f55963b9e20f5af5757b53 (patch) | |
tree | e8fffd0b7efdf9087ed808b17e5efb5c8e3940a5 /pygments | |
parent | 013193b542e9f76b799dd6d9665b3aad3cc07ba0 (diff) | |
download | pygments-git-4575f888183c65eb50f55963b9e20f5af5757b53.tar.gz |
[elpi] handle quotations (#2419)
Co-authored-by: Jean Abou Samra <jean@abou-samra.fr>
Diffstat (limited to 'pygments')
-rw-r--r-- | pygments/lexers/elpi.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pygments/lexers/elpi.py b/pygments/lexers/elpi.py index 91dfa0a6..6fc8b502 100644 --- a/pygments/lexers/elpi.py +++ b/pygments/lexers/elpi.py @@ -10,7 +10,7 @@ from pygments.lexer import RegexLexer, bygroups, include from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ - Number + Number, Punctuation __all__ = ['ElpiLexer'] @@ -88,6 +88,7 @@ class ElpiLexer(RegexLexer): (r'"', String.Double, 'elpi-string'), (r'`', String.Double, 'elpi-btick'), (r'\'', String.Double, 'elpi-tick'), + (r'\{\{', Punctuation, 'elpi-quote'), (r'\{[^\{]', Text, 'elpi-spill'), (r"\(", Text, 'elpi-in-parens'), (r'\d[\d_]*', Number.Integer), @@ -151,6 +152,13 @@ class ElpiLexer(RegexLexer): (r'[^\"]+', String.Double), (r'"', String.Double, '#pop'), ], + 'elpi-quote': [ + (r'\{\{', Punctuation, '#push'), + (r'\}\}', Punctuation, '#pop'), + (r"(lp:)((?=[A-Z_]){})".format(constant_re), bygroups(Keyword, Name.Variable)), + (r"[^l\}]+", Text), + (r"l|\}", Text), + ], 'elpi-spill': [ (r'\{[^\{]', Text, '#push'), (r'\}[^\}]', Text, '#pop'), |