Skip to content

Commit

Permalink
Panic if the grammar verifier sees a token it doesn't recognize
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
carols10cents committed May 5, 2015
1 parent 1ca9ed6 commit 9c7d5ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/grammar/verify.rs
Expand Up @@ -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);
Expand Down

0 comments on commit 9c7d5ae

Please sign in to comment.