diff options
Diffstat (limited to 'tests/lex_dup3.py')
-rw-r--r-- | tests/lex_dup3.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/lex_dup3.py b/tests/lex_dup3.py new file mode 100644 index 0000000..5398f48 --- /dev/null +++ b/tests/lex_dup3.py @@ -0,0 +1,28 @@ +# lex_dup3.py +# +# Duplicated rule specifiers + +import ply.lex as lex + +tokens = [ + "PLUS", + "MINUS", + "NUMBER", + ] + +t_PLUS = r'\+' +t_MINUS = r'-' +t_NUMBER = r'\d+' + +def t_NUMBER(t): + r'\d+' + pass + +def t_error(t): + pass + + + +lex.lex() + + |