diff options
Diffstat (limited to 'chall/ply-2.2/test/lex_re3.py')
| -rw-r--r-- | chall/ply-2.2/test/lex_re3.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/chall/ply-2.2/test/lex_re3.py b/chall/ply-2.2/test/lex_re3.py new file mode 100644 index 0000000..099e156 --- /dev/null +++ b/chall/ply-2.2/test/lex_re3.py @@ -0,0 +1,29 @@ +# lex_token.py +# +# Regular expression rule matches empty string + +import sys +sys.path.insert(0,"..") + +import ply.lex as lex + +tokens = [ + "PLUS", + "MINUS", + "NUMBER", + "POUND", + ] + +t_PLUS = r'\+' +t_MINUS = r'-' +t_NUMBER = r'(\d+)' +t_POUND = r'#' + +def t_error(t): + pass + +import sys + +lex.lex() + + |
