summaryrefslogtreecommitdiff
path: root/ext/ply/test/lex_rule3.py
diff options
context:
space:
mode:
Diffstat (limited to 'ext/ply/test/lex_rule3.py')
-rw-r--r--ext/ply/test/lex_rule3.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/ply/test/lex_rule3.py b/ext/ply/test/lex_rule3.py
new file mode 100644
index 000000000..9ea94da2f
--- /dev/null
+++ b/ext/ply/test/lex_rule3.py
@@ -0,0 +1,27 @@
+# lex_rule3.py
+#
+# Rule function with incorrect number of arguments
+
+import sys
+if ".." not in sys.path: sys.path.insert(0,"..")
+
+import ply.lex as lex
+
+tokens = [
+ "PLUS",
+ "MINUS",
+ "NUMBER",
+ ]
+
+t_PLUS = r'\+'
+t_MINUS = r'-'
+def t_NUMBER(t,s):
+ r'\d+'
+ return t
+
+def t_error(t):
+ pass
+
+lex.lex()
+
+