improve idris

--HG--
branch : pmacs2
This commit is contained in:
~d6 2021-09-30 23:58:35 -04:00
parent 6555b657b2
commit 548c3fc17f
1 changed files with 4 additions and 2 deletions

View File

@ -31,7 +31,7 @@ class IdrisGrammar(Grammar):
PatternRule(r'spaces', r'[ \t]+'), PatternRule(r'spaces', r'[ \t]+'),
PatternRule(r'eol', r'\n'), PatternRule(r'eol', r'\n'),
PatternRule(r'delimiter', r'[\[\](){},;]'), PatternRule(r'delimiter', r'[\[\](){},;$]'),
PatternRule(r'idris.xyz', r'(?:=>|->|<-|=|:)(?![-!#$%&\*\+./<=>\?@\\^|~:])'), PatternRule(r'idris.xyz', r'(?:=>|->|<-|=|:)(?![-!#$%&\*\+./<=>\?@\\^|~:])'),
PatternMatchRule('x', r"(module)( +)([a-zA-Z0-9_']+)", "idris.keyword", "spaces", "idris.module"), PatternMatchRule('x', r"(module)( +)([a-zA-Z0-9_']+)", "idris.keyword", "spaces", "idris.module"),
@ -42,6 +42,7 @@ class IdrisGrammar(Grammar):
RegionRule(r'string', r'"', StringGrammar, r'"'), RegionRule(r'string', r'"', StringGrammar, r'"'),
PatternRule(r'idris.keyword', r"(?:with|where|using|try|trivial|total|then|term|syntax|solve|rewrite|refine|record|public|private|prefix|pattern|partial|parameters|of|namespace|mutual|module|let|intros|instance|infixr|infixl|infix|in|import|if|focus|exact|else|dsl|do|data|compute|codata|class|case|attack|abstract)(?![a-zA-Z0-9_'])"), PatternRule(r'idris.keyword', r"(?:with|where|using|try|trivial|total|then|term|syntax|solve|rewrite|refine|record|public|private|prefix|pattern|partial|parameters|of|namespace|mutual|module|let|intros|instance|infixr|infixl|infix|in|import|if|focus|exact|else|dsl|do|data|compute|codata|class|case|attack|abstract)(?![a-zA-Z0-9_'])"),
PatternRule(r'idris.builtin', "(?:_|implicit|default|auto)(?![a-zA-Z0-9_'])"),
PatternRule(r'idris.name', r"['_]?[A-Z][a-zA-Z0-9_']+"), PatternRule(r'idris.name', r"['_]?[A-Z][a-zA-Z0-9_']+"),
PatternRule(r'idris.word', r"[a-zA-Z0-9_']+"), PatternRule(r'idris.word', r"[a-zA-Z0-9_']+"),
@ -85,8 +86,9 @@ class Idris(Fundamental):
closetags = {')': '(', '}': '{', ']': '['} closetags = {')': '(', '}': '{', ']': '['}
colors = { colors = {
'idris.keyword': hi_magenta, 'idris.keyword': hi_magenta,
'idris.builtin': hi_magenta,
'idris.module': hi_yellow, 'idris.module': hi_yellow,
'idris.name': hi_green, 'idris.name': hi_blue,
'idris.xyz': hi_cyan, 'idris.xyz': hi_cyan,
'idris.directive': hi_orange, 'idris.directive': hi_orange,
} }