DataSpec: Merge definitions state into root
This commit is contained in:
@ -11,7 +11,15 @@ class DataSpecLexer(RegexLexer):
|
||||
(r'(\s*)(\+-)', bygroups(Text, Text), 'boundary'),
|
||||
(r'(\s+)([\+|])', bygroups(Text, Text), 'content'),
|
||||
(r'~', Generic.Strong, 'content'),
|
||||
(r'(\s*)([\w=;]+)(\s)(::)(\s)', bygroups(Text, Name.Tag, Text, Operator, Text), 'definition'),
|
||||
(r'(\s*)([\w=;]+)(\s)(::)(\s)', bygroups(Text, Name.Tag, Text, Operator, Text)),
|
||||
(r'(\s*)((?:[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)),
|
||||
(r'(\s*)([0-9]+)(\+)?', bygroups(Text, Number, Punctuation)),
|
||||
(r'(-)([0-9]+)', bygroups(Punctuation, Number)),
|
||||
(r'(\s*)(->|<=|>=|\*)', bygroups(Text, Operator)),
|
||||
(r'(\s*)([\w()-=\'<>]+)', bygroups(Text, Comment)),
|
||||
],
|
||||
'boundary': [
|
||||
(r'---\+$', Text, '#pop'),
|
||||
@ -35,15 +43,4 @@ class DataSpecLexer(RegexLexer):
|
||||
(r'(\s*)(\$\w+)', bygroups(Text, Name.Tag)),
|
||||
(r'(\s*)(\w+)', bygroups(Text, Name)),
|
||||
],
|
||||
'definition': [
|
||||
(r'(\s*)([\w=;]+)(\s)(::)(\s)', bygroups(Text, Name.Tag, Text, Operator, Text)),
|
||||
(r'(\s*)((?:[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)),
|
||||
(r'(\s*)([0-9]+)(\+)?', bygroups(Text, Number, Punctuation)),
|
||||
(r'(-)([0-9]+)', bygroups(Punctuation, Number)),
|
||||
(r'(\s*)(->|<=|>=|\*)', bygroups(Text, Operator)),
|
||||
(r'(\s*)([\w()-=\'<>]+)', bygroups(Text, Comment)),
|
||||
],
|
||||
}
|
||||
|
Reference in New Issue
Block a user