pmacs3/test.py

16 lines
292 B
Python
Raw Normal View History

2007-03-06 10:05:38 -05:00
import lex2
lines = [
'this is the first line',
'<< EOF;'
' abracadra hocus pocus',
' EOF',
'EOF',
'"this is a double-quoted string" and this is not...',
"we're done",
]
l = lex2.Lexer()
l.lex(lines)
for t in l:
print '%-20r %r' % (t.rule.name, t.string)