summaryrefslogtreecommitdiffstats
path: root/chall/ply-2.2/test/lex_nowarn.py
diff options
context:
space:
mode:
Diffstat (limited to 'chall/ply-2.2/test/lex_nowarn.py')
-rw-r--r--chall/ply-2.2/test/lex_nowarn.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/chall/ply-2.2/test/lex_nowarn.py b/chall/ply-2.2/test/lex_nowarn.py
new file mode 100644
index 0000000..d60d31c
--- /dev/null
+++ b/chall/ply-2.2/test/lex_nowarn.py
@@ -0,0 +1,30 @@
+# lex_token.py
+#
+# Missing t_error() rule
+
+import sys
+sys.path.insert(0,"..")
+
+import ply.lex as lex
+
+tokens = [
+ "PLUS",
+ "MINUS",
+ "NUMBER",
+ "NUMBER",
+ ]
+
+states = (('foo','exclusive'),)
+
+t_ignore = ' \t'
+t_PLUS = r'\+'
+t_MINUS = r'-'
+t_NUMBER = r'\d+'
+
+t_foo_NUMBER = r'\d+'
+
+sys.tracebacklimit = 0
+
+lex.lex(nowarn=1)
+
+