From efcfaae34ac7a54e858aad82e6503a7c69d6c550 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 7 Jan 2018 12:32:29 +0300 Subject: Tests for partial parse --- src/parser/event_parser/grammar.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/parser/event_parser/grammar.rs b/src/parser/event_parser/grammar.rs index 7425526ef..79ef8b31c 100644 --- a/src/parser/event_parser/grammar.rs +++ b/src/parser/event_parser/grammar.rs @@ -74,7 +74,12 @@ fn many bool>(p: &mut Parser, f: F) { fn comma_list bool>(p: &mut Parser, f: F) { many(p, |p| { f(p); - p.is_eof() || p.expect(COMMA) + if p.is_eof() { + false + } else { + p.expect(COMMA); + true + } }) } -- cgit v1.2.3