some fixes for python

--HG--
branch : pmacs2
This commit is contained in:
moculus 2007-06-05 15:23:56 +00:00
parent 99dfb30e3e
commit 6334498f3d
2 changed files with 9 additions and 9 deletions

View File

@ -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(

View File

@ -3,8 +3,8 @@ import sets, string
import color, default, highlight, method, point import color, default, highlight, method, point
#DEBUG = False DEBUG = False
DEBUG = True #DEBUG = True
class Handler: class Handler:
def __init__(self): def __init__(self):