pmacs3/lex_blame.py

17 lines
392 B
Python
Raw Normal View History

2007-03-06 10:05:38 -05:00
import lex
class BlameGrammar(lex.Grammar):
GRAMMAR_LIST = [
{'name': 'metadata',
'expr': "(?:^|(?<=\n))[0-9.]+ +[a-zA-Z0-9_]+ +[-0-9A-Za-z]+",
'action': lex.make_token},
{'name': 'data',
'expr': ".+(?:$|\n)",
'action': lex.make_token},
{'name': "default",
'expr': r'\\.|.|\n',
'action': lex.silent},
]