Updated dataspec lexer

This commit is contained in:
str4d
2014-01-08 07:01:41 +00:00
parent ca72c24b23
commit 0f103d6ef8
4 changed files with 87 additions and 87 deletions

View File

@ -11,8 +11,8 @@ class DataSpecLexer(RegexLexer):
(r'(\s*)(\+-)', bygroups(Text, Text), 'boundary'),
(r'(\s+)([\+|])', bygroups(Text, Text), 'content'),
(r'(\s*)(~)', bygroups(Text, Generic.Strong), 'content'),
(r'(\s*)([\w=;]+)(\s)(::)(\s)', bygroups(Text, Name.Tag, Text, Operator, Text)),
(r'(\s*)((?:[A-Z][a-z]+)+)', bygroups(Text, Name.Class)),
(r'(\s*)([\w=;]+)(\s[\w=;]+)*(\s)(::)(\s)', bygroups(Text, Name.Tag, Name.Tag, Text, Operator, Text)),
(r'(\s*)`((?:[A-Z][a-z]+)(?:[A-Z][a-z]*)*)`', bygroups(Text, Name.Class)),
(r'(\s*)([A-Z]{2,})', bygroups(Text, Name.Constant)),
(r'(\s*)([\[\]])', bygroups(Text, Punctuation)),
(r'(\s*)(\$\w+)', bygroups(Text, Name.Tag)),
@ -34,8 +34,8 @@ class DataSpecLexer(RegexLexer):
(r'(\s*)(\.\.\.)(\s)', bygroups(Text, Generic.Strong, Text)),
(r'(\s*)(\.\.\.)$', bygroups(Text, Generic.Strong), '#pop'),
(r'(\s*)(~)$', bygroups(Text, Generic.Strong), '#pop'),
(r'(\s*)([\w=;]+)$', bygroups(Text, Name.Tag), '#pop'),
(r'(\s*)([\w=;]+)', bygroups(Text, Name.Tag)),
(r'(\s*)([\w=;]+)(\s[\w=;]+)*$', bygroups(Text, Name.Tag, Name.Tag), '#pop'),
(r'(\s*)([\w=;]+)(\s[\w=;]+)*', bygroups(Text, Name.Tag, Name.Tag)),
(r'(\s*)(\|)', bygroups(Text, Text)),
(r'(\s*)(\()', bygroups(Text, Punctuation), 'expression'),
],