Fix unhandled cases in docs LAMMPS syntax highlighting

This commit is contained in:
Richard Berger
2021-03-19 18:51:21 -04:00
parent 1f50557b38
commit 06ee5be2ce
4 changed files with 11 additions and 9 deletions

View File

@ -40,7 +40,7 @@ class LAMMPSLexer(RegexLexer):
(r'compute\s+', Keyword, 'compute'),
(r'dump\s+', Keyword, 'dump'),
(r'region\s+', Keyword, 'region'),
(r'variable\s+', Keyword, 'variable'),
(r'^\s*variable\s+', Keyword, 'variable_cmd'),
(r'group\s+', Keyword, 'group'),
(r'change_box\s+', Keyword, 'change_box'),
(r'uncompute\s+', Keyword, 'uncompute'),
@ -51,6 +51,7 @@ class LAMMPSLexer(RegexLexer):
(r'#.*?\n', Comment),
('"', String, 'string'),
('\'', String, 'single_quote_string'),
(r'[0-9]+:[0-9]+(:[0-9]+)?', Number),
(r'[0-9]+(\.[0-9]+)?([eE]\-?[0-9]+)?', Number),
('\$?\(', Name.Variable, 'expression'),
('\$\{', Name.Variable, 'variable'),
@ -58,6 +59,7 @@ class LAMMPSLexer(RegexLexer):
(r'\$[\w_]+', Name.Variable),
(r'\s+', Whitespace),
(r'[\+\-\*\^\|\/\!%&=<>]', Operator),
(r'[\~\.\w_:,@\-\/\\0-9]+', Text),
],
'keywords' : [
(words(LAMMPS_COMMANDS, suffix=r'\b', prefix=r'^'), Keyword)
@ -99,7 +101,7 @@ class LAMMPSLexer(RegexLexer):
(r'[\w_\-\.\[\]]+', Name.Variable.Identifier),
default('#pop')
],
'variable' : [
'variable_cmd' : [
(r'[\w_\-\.\[\]]+', Name.Variable.Identifier),
default('#pop')
],