summaryrefslogtreecommitdiff
path: root/test/lex_token3.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/lex_token3.py')
-rw-r--r--test/lex_token3.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/lex_token3.py b/test/lex_token3.py
new file mode 100644
index 0000000..27ce947
--- /dev/null
+++ b/test/lex_token3.py
@@ -0,0 +1,27 @@
+# lex_token.py
+#
+# tokens is right type, but is missing a token for one rule
+
+import sys
+sys.path.insert(0,"..")
+
+import ply.lex as lex
+
+tokens = [
+ "PLUS",
+ "NUMBER",
+ ]
+
+t_PLUS = r'\+'
+t_MINUS = r'-'
+t_NUMBER = r'\d+'
+
+def t_error(t):
+ pass
+
+
+sys.tracebacklimit = 0
+
+lex.lex()
+
+