parent
99dfb30e3e
commit
6334498f3d
|
@ -10,10 +10,10 @@ class StringGrammar(Grammar):
|
|||
name=r'escaped',
|
||||
pattern=r'\\.',
|
||||
),
|
||||
PatternRule(
|
||||
name=r'format',
|
||||
pattern=r'%(?:\([a-zA-Z_]+\))?[-# +]*(?:[0-9]+|\*)?\.?(?:[0-9]+|\*)?[hlL]?[a-zA-Z%]',
|
||||
),
|
||||
#PatternRule(
|
||||
# name=r'format',
|
||||
# pattern=r'%(?:\([a-zA-Z_]+\))?[-# +]*(?:[0-9]+|\*)?\.?(?:[0-9]+|\*)?[hlL]?[a-zA-Z%]',
|
||||
#),
|
||||
]
|
||||
|
||||
class PythonGrammar(Grammar):
|
||||
|
@ -72,15 +72,15 @@ class PythonGrammar(Grammar):
|
|||
),
|
||||
PatternRule(
|
||||
name=r"integer",
|
||||
pattern=r"(?:0|[1-9][0-9]*|0[0-7]+|0[xX][0-9a-fA-F]+)[lL]?",
|
||||
pattern=r"(?<![\.0-9a-zA-Z_])(?:0|[1-9][0-9]*|0[0-7]+|0[xX][0-9a-fA-F]+)[lL]?(?![\.0-9a-zA-Z_])",
|
||||
),
|
||||
PatternRule(
|
||||
name=r"float",
|
||||
pattern=r"[0-9]+\.[0-9]*|\.[0-9]+|(?:[0-9]|[0-9]+\.[0-9]*|\.[0-9]+)[eE][\+-]?[0-9]+",
|
||||
pattern=r"(?<![\.0-9a-zA-Z_])(?:[0-9]+\.[0-9]*|\.[0-9]+|(?:[0-9]|[0-9]+\.[0-9]*|\.[0-9]+)[eE][\+-]?[0-9]+)(?![\.0-9a-zA-Z_])",
|
||||
),
|
||||
PatternRule(
|
||||
name=r"imaginary",
|
||||
pattern=r"[0-9]+|(?:[0-9]+\.[0-9]*|\.[0-9]+|(?:[0-9]|[0-9]+\.[0-9]*|\.[0-9]+)[eE][\+-]?[0-9]+)[jJ]",
|
||||
pattern=r"(?<![\.0-9a-zA-Z_])(?:[0-9]+|(?:[0-9]+\.[0-9]*|\.[0-9]+|(?:[0-9]|[0-9]+\.[0-9]*|\.[0-9]+)[eE][\+-]?[0-9]+)[jJ])(?![\.0-9a-zA-Z_])",
|
||||
),
|
||||
|
||||
RegionRule(
|
||||
|
|
Loading…
Reference in New Issue