summaryrefslogtreecommitdiff
path: root/tests/lex_dup2.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lex_dup2.py')
-rw-r--r--tests/lex_dup2.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/lex_dup2.py b/tests/lex_dup2.py
new file mode 100644
index 0000000..47bf5b5
--- /dev/null
+++ b/tests/lex_dup2.py
@@ -0,0 +1,30 @@
+# lex_dup2.py
+#
+# Duplicated rule specifiers
+
+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
+
+
+
+lex.lex()
+
+