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