diff options
| author | Carol Nichols <carol.nichols@gmail.com> | 2015-05-05 19:32:26 -0400 |
|---|---|---|
| committer | Carol Nichols <carol.nichols@gmail.com> | 2015-05-05 19:47:50 -0400 |
| commit | 9c7d5ae57c27ebfc019c2c23283bb905d8c3b74f (patch) | |
| tree | 354f43ea6e7d1e51616487670153f7d043816cf3 | |
| parent | 1ca9ed61d62b529aa403229b0a23dac69a091fe3 (diff) | |
Panic if the grammar verifier sees a token it doesn't recognize
To prevent the reference grammar from getting out of sync with the real grammar, panic if RustLexer.tokens contains an unknown token in a similar way that verify.rs panics if it encounters an unknown binary operation token.
| -rw-r--r-- | src/grammar/verify.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/grammar/verify.rs b/src/grammar/verify.rs index dec797747c2..10b8abfc786 100644 --- a/src/grammar/verify.rs +++ b/src/grammar/verify.rs @@ -111,7 +111,7 @@ fn parse_token_list(file: &str) -> HashMap<String, token::Token> { "LIT_BINARY_RAW" => token::Literal(token::BinaryRaw(Name(0), 0), None), "QUESTION" => token::Question, "SHEBANG" => token::Shebang(Name(0)), - _ => continue, + _ => panic!("Bad token str `{}`", val), }; res.insert(num.to_string(), tok); |
