diff options
author | David Beazley <dave@dabeaz.com> | 2006-11-21 15:09:46 +0000 |
---|---|---|
committer | David Beazley <dave@dabeaz.com> | 2006-11-21 15:09:46 +0000 |
commit | 80c8c2d0a6e63745ff099b33ad2848b6fb17285a (patch) | |
tree | 36d223fc55a5649dc85a4f8a3fa9d17cb130c6c3 /test/lex_dup2.py | |
download | ply-80c8c2d0a6e63745ff099b33ad2848b6fb17285a.tar.gz |
initial checkin
Diffstat (limited to 'test/lex_dup2.py')
-rw-r--r-- | test/lex_dup2.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/lex_dup2.py b/test/lex_dup2.py new file mode 100644 index 0000000..f4d346e --- /dev/null +++ b/test/lex_dup2.py @@ -0,0 +1,33 @@ +# lex_token.py +# +# Duplicated rule specifiers + +import sys +sys.path.insert(0,"..") + +import ply.lex as lex + +tokens = [ + "PLUS", + "MINUS", + "NUMBER", + ] + +t_PLUS = r'\+' +t_MINUS = r'-' +def t_NUMBER(t): + r'\d+' + pass + +def t_NUMBER(t): + r'\d+' + pass + +def t_error(t): + pass + +sys.tracebacklimit = 0 + +lex.lex() + + |