diff options
author | David Beazley <dave@dabeaz.com> | 2007-02-19 15:54:48 +0000 |
---|---|---|
committer | David Beazley <dave@dabeaz.com> | 2007-02-19 15:54:48 +0000 |
commit | 80cd0ca45628f8e50966489e7f5eb11f19a2f3e7 (patch) | |
tree | a551155be49a8d5916585d5c87a13be0c57a21ea /test | |
parent | 2e5a87b121e124d27b5a8c9b428b4db52b2b7f59 (diff) | |
download | ply-80cd0ca45628f8e50966489e7f5eb11f19a2f3e7.tar.gz |
Cleanup. Few minor improvements
Diffstat (limited to 'test')
-rw-r--r-- | test/lex_ignore.exp | 2 | ||||
-rw-r--r-- | test/lex_ignore2.exp | 1 | ||||
-rw-r--r-- | test/lex_ignore2.py | 29 | ||||
-rw-r--r-- | test/lex_re1.exp | 2 | ||||
-rw-r--r-- | test/lex_re2.exp | 2 | ||||
-rw-r--r-- | test/lex_re3.exp | 2 | ||||
-rw-r--r-- | test/lex_state1.exp | 2 | ||||
-rw-r--r-- | test/lex_state2.exp | 2 | ||||
-rw-r--r-- | test/lex_state3.exp | 2 | ||||
-rw-r--r-- | test/lex_state4.exp | 2 | ||||
-rw-r--r-- | test/lex_state5.exp | 2 | ||||
-rw-r--r-- | test/lex_state_norule.exp | 2 | ||||
-rw-r--r-- | test/yacc_noerror.exp | 2 |
13 files changed, 41 insertions, 11 deletions
diff --git a/test/lex_ignore.exp b/test/lex_ignore.exp index 466ce19..6b6b67c 100644 --- a/test/lex_ignore.exp +++ b/test/lex_ignore.exp @@ -2,6 +2,6 @@ Traceback (most recent call last): File "./lex_ignore.py", line 29, in <module> lex.lex() - File "../ply/lex.py", line 758, in lex + File "../ply/lex.py", line 759, in lex raise SyntaxError,"lex: Unable to build lexer." SyntaxError: lex: Unable to build lexer. diff --git a/test/lex_ignore2.exp b/test/lex_ignore2.exp new file mode 100644 index 0000000..0eb6bf2 --- /dev/null +++ b/test/lex_ignore2.exp @@ -0,0 +1 @@ +lex: Warning. t_ignore contains a literal backslash '\' diff --git a/test/lex_ignore2.py b/test/lex_ignore2.py new file mode 100644 index 0000000..fc95bd1 --- /dev/null +++ b/test/lex_ignore2.py @@ -0,0 +1,29 @@ +# lex_token.py +# +# ignore declaration as a raw string + +import sys +sys.path.insert(0,"..") + +import ply.lex as lex + +tokens = [ + "PLUS", + "MINUS", + "NUMBER", + ] + +t_PLUS = r'\+' +t_MINUS = r'-' +t_NUMBER = r'\d+' + +t_ignore = r' \t' + +def t_error(t): + pass + +import sys + +lex.lex() + + diff --git a/test/lex_re1.exp b/test/lex_re1.exp index ef8ba98..4d54f4b 100644 --- a/test/lex_re1.exp +++ b/test/lex_re1.exp @@ -2,6 +2,6 @@ lex: Invalid regular expression for rule 't_NUMBER'. unbalanced parenthesis Traceback (most recent call last): File "./lex_re1.py", line 25, in <module> lex.lex() - File "../ply/lex.py", line 758, in lex + File "../ply/lex.py", line 759, in lex raise SyntaxError,"lex: Unable to build lexer." SyntaxError: lex: Unable to build lexer. diff --git a/test/lex_re2.exp b/test/lex_re2.exp index 2e9cc73..a4e2e89 100644 --- a/test/lex_re2.exp +++ b/test/lex_re2.exp @@ -2,6 +2,6 @@ lex: Regular expression for rule 't_PLUS' matches empty string. Traceback (most recent call last): File "./lex_re2.py", line 25, in <module> lex.lex() - File "../ply/lex.py", line 758, in lex + File "../ply/lex.py", line 759, in lex raise SyntaxError,"lex: Unable to build lexer." SyntaxError: lex: Unable to build lexer. diff --git a/test/lex_re3.exp b/test/lex_re3.exp index 1205372..b9ada21 100644 --- a/test/lex_re3.exp +++ b/test/lex_re3.exp @@ -3,6 +3,6 @@ lex: Make sure '#' in rule 't_POUND' is escaped with '\#'. Traceback (most recent call last): File "./lex_re3.py", line 27, in <module> lex.lex() - File "../ply/lex.py", line 758, in lex + File "../ply/lex.py", line 759, in lex raise SyntaxError,"lex: Unable to build lexer." SyntaxError: lex: Unable to build lexer. diff --git a/test/lex_state1.exp b/test/lex_state1.exp index be59cbf..facad03 100644 --- a/test/lex_state1.exp +++ b/test/lex_state1.exp @@ -2,6 +2,6 @@ lex: states must be defined as a tuple or list. Traceback (most recent call last): File "./lex_state1.py", line 38, in <module> lex.lex() - File "../ply/lex.py", line 758, in lex + File "../ply/lex.py", line 759, in lex raise SyntaxError,"lex: Unable to build lexer." SyntaxError: lex: Unable to build lexer. diff --git a/test/lex_state2.exp b/test/lex_state2.exp index 241779c..8b04251 100644 --- a/test/lex_state2.exp +++ b/test/lex_state2.exp @@ -3,6 +3,6 @@ lex: invalid state specifier 'example'. Must be a tuple (statename,'exclusive|in Traceback (most recent call last): File "./lex_state2.py", line 38, in <module> lex.lex() - File "../ply/lex.py", line 758, in lex + File "../ply/lex.py", line 759, in lex raise SyntaxError,"lex: Unable to build lexer." SyntaxError: lex: Unable to build lexer. diff --git a/test/lex_state3.exp b/test/lex_state3.exp index 9495ad5..53ab57f 100644 --- a/test/lex_state3.exp +++ b/test/lex_state3.exp @@ -3,6 +3,6 @@ lex: No rules defined for state 'example' Traceback (most recent call last): File "./lex_state3.py", line 40, in <module> lex.lex() - File "../ply/lex.py", line 758, in lex + File "../ply/lex.py", line 759, in lex raise SyntaxError,"lex: Unable to build lexer." SyntaxError: lex: Unable to build lexer. diff --git a/test/lex_state4.exp b/test/lex_state4.exp index 9a2deed..412ae8f 100644 --- a/test/lex_state4.exp +++ b/test/lex_state4.exp @@ -2,6 +2,6 @@ lex: state type for state comment must be 'inclusive' or 'exclusive' Traceback (most recent call last): File "./lex_state4.py", line 39, in <module> lex.lex() - File "../ply/lex.py", line 758, in lex + File "../ply/lex.py", line 759, in lex raise SyntaxError,"lex: Unable to build lexer." SyntaxError: lex: Unable to build lexer. diff --git a/test/lex_state5.exp b/test/lex_state5.exp index 229c6c4..8eeae56 100644 --- a/test/lex_state5.exp +++ b/test/lex_state5.exp @@ -2,6 +2,6 @@ lex: state 'comment' already defined. Traceback (most recent call last): File "./lex_state5.py", line 40, in <module> lex.lex() - File "../ply/lex.py", line 758, in lex + File "../ply/lex.py", line 759, in lex raise SyntaxError,"lex: Unable to build lexer." SyntaxError: lex: Unable to build lexer. diff --git a/test/lex_state_norule.exp b/test/lex_state_norule.exp index 8cb1f04..7097d2a 100644 --- a/test/lex_state_norule.exp +++ b/test/lex_state_norule.exp @@ -2,6 +2,6 @@ lex: No rules defined for state 'example' Traceback (most recent call last): File "./lex_state_norule.py", line 40, in <module> lex.lex() - File "../ply/lex.py", line 758, in lex + File "../ply/lex.py", line 759, in lex raise SyntaxError,"lex: Unable to build lexer." SyntaxError: lex: Unable to build lexer. diff --git a/test/yacc_noerror.exp b/test/yacc_noerror.exp index 658f907..3ae7712 100644 --- a/test/yacc_noerror.exp +++ b/test/yacc_noerror.exp @@ -1,2 +1,2 @@ -yacc: Generating LALR parsing table... yacc: Warning. no p_error() function is defined. +yacc: Generating LALR parsing table... |