avoid invalid escape warnings for regexp expressions with python 3.12

This commit is contained in:
Axel Kohlmeyer
2023-10-22 20:00:33 -04:00
parent 731400e004
commit e518637d63

View File

@ -76,12 +76,12 @@ class LAMMPSLexer(RegexLexer):
include('conditionals'),
include('keywords'),
(r'#.*?\n', Comment),
('"', String, 'string'),
('\'', String, 'single_quote_string'),
(r'"', String, 'string'),
(r'\'', 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'),
(r'\$?\(', Name.Variable, 'expression'),
(r'\$\{', Name.Variable, 'variable'),
(r'[\w_\.\[\]]+', Name),
(r'\$[\w_]+', Name.Variable),
(r'\s+', Whitespace),
@ -97,21 +97,21 @@ class LAMMPSLexer(RegexLexer):
]
,
'variable' : [
('[^\}]+', Name.Variable),
('\}', Name.Variable, '#pop'),
(r'[^\}]+', Name.Variable),
(r'\}', Name.Variable, '#pop'),
],
'string' : [
('[^"]+', String),
('"', String, '#pop'),
(r'[^"]+', String),
(r'"', String, '#pop'),
],
'single_quote_string' : [
('[^\']+', String),
('\'', String, '#pop'),
(r'[^\']+', String),
(r'\'', String, '#pop'),
],
'expression' : [
('[^\(\)]+', Name.Variable),
('\(', Name.Variable, 'expression'),
('\)', Name.Variable, '#pop'),
(r'[^\(\)]+', Name.Variable),
(r'\(', Name.Variable, 'expression'),
(r'\)', Name.Variable, '#pop'),
],
'modify_cmd' : [
(r'[\w_\-\.\[\]]+', Name.Variable.Identifier),