diff options
author | Ben Smith <binjimin@gmail.com> | 2017-08-15 14:36:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-15 14:36:20 -0700 |
commit | 3d3920f6d9388c46af6725dabb34d98752958d8d (patch) | |
tree | cf77acb6d4140b2fb791f91d4af38d59ad8f66a3 /test/spec/token.txt | |
parent | 68e8642fea319253466bb3bddece75306f808a69 (diff) | |
download | wabt-3d3920f6d9388c46af6725dabb34d98752958d8d.tar.gz wabt-3d3920f6d9388c46af6725dabb34d98752958d8d.tar.bz2 wabt-3d3920f6d9388c46af6725dabb34d98752958d8d.zip |
Rewrite parser as recursive descent (#591)
* Remove Bison dependency
* Remove pre-generated parser files
* Rename build config from no-re2c-bison to no-re2c
* Add a simple make_unique implementation
* Move handling of module bindings into ir.cc
* Simplify lexer
- Remove lookahead, the parser handles this now
- Unify Token/LexerToken, it only contains terminal values now
- Refactor setting token type and value into one function (e.g.
LITERAL, RETURN => RETURN_LITERAL)
* New Parser
- Uses two tokens of lookahead (use Peek(0) or Peek(1))
- Consume() consumes one token of any kind
- Match(t) consumes the current token if it matches
- PeekMatch(t) returns true iff the token matches, but doesn't consume
- Basic error synchronization; plenty of room for improvement here
Diffstat (limited to 'test/spec/token.txt')
-rw-r--r-- | test/spec/token.txt | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/test/spec/token.txt b/test/spec/token.txt index bab6656e..4c114f55 100644 --- a/test/spec/token.txt +++ b/test/spec/token.txt @@ -2,18 +2,12 @@ ;;; STDIN_FILE: third_party/testsuite/token.wast (;; STDOUT ;;; out/third_party/testsuite/token.wast:4: assert_malformed passed: - out/third_party/testsuite/token/token.0.wast:1:14: error: unexpected token "i32.const0" + out/third_party/testsuite/token/token.0.wast:1:14: error: unexpected token "i32.const0", expected an expr. (func (drop (i32.const0))) ^^^^^^^^^^ - out/third_party/testsuite/token/token.0.wast:1:24: error: syntax error, unexpected ) - (func (drop (i32.const0))) - ^ out/third_party/testsuite/token.wast:8: assert_malformed passed: - out/third_party/testsuite/token/token.1.wast:1:10: error: unexpected token "0drop" + out/third_party/testsuite/token/token.1.wast:1:10: error: unexpected token "0drop", expected a numeric index or a name (e.g. 12 or $foo). (func br 0drop) ^^^^^ - out/third_party/testsuite/token/token.1.wast:1:15: error: syntax error, unexpected ), expecting NAT or VAR - (func br 0drop) - ^ 2/2 tests passed. ;;; STDOUT ;;) |