Skip to content

Commit

Permalink
Improve slightly the Pygments highlighter
Browse files Browse the repository at this point in the history
  • Loading branch information
fizruk committed May 25, 2023
1 parent cbd656c commit 01c2a01
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions rzk/RzkLexer/rzklexer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ def get_tokens_unprocessed(self, text):
(r'--.*\n', Comment),
(r'\{-((.)(?<!-))*-((.)(?<![-\}])((.)(?<!-))*-|-)*\}', Comment),
(r'rzk-1', String),
(r'(\*_1|0_2|1_2)|\b(refl|BOT|recBOT|TOP|first|second|idJ|recOR)\b', Name.Constant),
(r'U|CUBE|TOPE|1|2|Sigma|∑|Σ', Keyword.Type),
(r'\*_1|0_2|1_2|refl|BOT|recBOT|TOP|first|second|idJ|recOR', Name.Constant),
(r'#lang|#set-option|#unset-option|#check|#compute-whnf|#compute-nf|#compute', Name.Decorator),
(r'(#section|#end)(\s+[^\t\n\r !"#\(\),-\.;:<>\?\[\\\]\{\|\}][^\t\n\r !"#\(\),\.;:<>\?\[\\\]\{\|\}]*)',
(r'(#lang|#set-option|#unset-option|#check|#compute-whnf|#compute-nf|#compute)\b', Name.Decorator),
(r'(#section|#end)\b(\s+[^\t\n\r !"#\(\),-\.;:<>\?\[\\\]\{\|\}][^\t\n\r !"#\(\),\.;:<>\?\[\\\]\{\|\}]*)',
bygroups(Name.Decorator, Name.Entity)),
(r' = | \* | === | <= | /\\ | \\/ ', Operator),
(r'(\(\s*)((([^\t\n\r !"#\(\),-\.;:<>\?\[\\\]\{\|\}][^\t\n\r !"#\(\),\.;:<>\?\[\\\]\{\|\}]*)\s*)+)(:)',
bygroups(Punctuation, Name.Variable, None, None, Punctuation)),
(r'(\\\s*)((([^\t\n\r !"#\(\),-\.;:<>\?\[\\\]\{\|\}][^\t\n\r !"#\(\),\.;:<>\?\[\\\]\{\|\}]*)\s*)+)',
(r'(\\\s*)((([^\t\n\r !"#\(\),-\.;:\\\/=<>\?\[\\\]\{\|\}][^\t\n\r !"#\(\),\.;:<>\?\[\\\]\{\|\}]*)\s*)+)',
bygroups(Punctuation, Name.Variable)),
(r';|:|:=|\(|\)|_|,|\{|\||\}|\|\[|\]|<|>|\\|->', Punctuation),
(r' = | \* | === | <= | /\\ | \\/ ', Operator),
(r'((#assume|#variables|#variable)\s+)([^:]+)',
(r'(;|:|:=|\(|\)|_\b|,|\{|\||\}|\||\[|\]|<|>|\\|->)', Punctuation),
(r'((#assume|#variables|#variable)\b\s+)([^:]+)',
bygroups(Keyword.Declaration, None, Name.Variable)),
(r'((#postulate|#define|#def)\s+)([^\t\n\r !"#\(\),-\.;:<>\?\[\\\]\{\|\}][^\t\n\r !"#\(\),\.;:<>\?\[\\\]\{\|\}]*\s+)((uses\s+)(\()([^\(\)]+)(\)))?',
(r'((#postulate|#define|#def)\b\s+)([^\t\n\r !"#\(\),-\.;:<>\?\[\\\]\{\|\}][^\t\n\r !"#\(\),\.;:<>\?\[\\\]\{\|\}]*\s+)((uses\s+)(\()([^\(\)]+)(\)))?',
bygroups(Keyword, None, Name.Function, None, Keyword, Punctuation, Name.Variable, Punctuation)),
(r'"((.)(?<!["\\])|\\["\\nt])*"', String.Double),
(r'\s+', Token.Space),
Expand Down

0 comments on commit 01c2a01

Please sign in to comment.