diff options
author | Aleksey Kladov <[email protected]> | 2018-08-08 21:09:40 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-08 21:09:40 +0100 |
commit | 1f6c442a3f2f660803f598d70f3f69b469637829 (patch) | |
tree | 6fa236aa3a1cdfaef96603c9f3c6a76ec78246c8 /tests/data/parser/err/0012_broken_lambda.rs | |
parent | 8c598d3d8a9d6fe0b8303250c88c252ff98883fd (diff) |
Fix panic with EOF token
Diffstat (limited to 'tests/data/parser/err/0012_broken_lambda.rs')
-rw-r--r-- | tests/data/parser/err/0012_broken_lambda.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/data/parser/err/0012_broken_lambda.rs b/tests/data/parser/err/0012_broken_lambda.rs new file mode 100644 index 000000000..ad0d8eb4c --- /dev/null +++ b/tests/data/parser/err/0012_broken_lambda.rs | |||
@@ -0,0 +1,12 @@ | |||
1 | pub(super) fn process<'a, S: Sink<'a>>(builder: &mut S, tokens: &[Token], events: Vec<Event>) { | ||
2 | let mut next_tok_idx = 0; | ||
3 | let eat_ws = |idx: &mut usize, &mut | { | ||
4 | while let Some(token) = tokens.get(*idx) { | ||
5 | if !token.kind.is_trivia() { | ||
6 | break; | ||
7 | } | ||
8 | builder.leaf(token.kind, token.len); | ||
9 | *idx += 1 | ||
10 | } | ||
11 | }; | ||
12 | } | ||