From 111743d82c31bcaeb3cd7abbb261c0e038c2d909 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 20 Jan 2018 21:07:34 +0300 Subject: Drop more high-order stuff --- src/parser/event_parser/grammar/items.rs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/parser/event_parser') diff --git a/src/parser/event_parser/grammar/items.rs b/src/parser/event_parser/grammar/items.rs index 7ae48b5db..f96f4cc9c 100644 --- a/src/parser/event_parser/grammar/items.rs +++ b/src/parser/event_parser/grammar/items.rs @@ -22,7 +22,7 @@ fn item(p: &mut Parser){ err_token => { p.start(ERROR); let message = if err_token == SEMI { - //TODO: if the item is incomplete, this messsage is misleading + //TODO: if the item is incomplete, this message is misleading "expected item, found `;`\n\ consider removing this semicolon" } else { @@ -97,13 +97,12 @@ fn named_fields(p: &mut Parser) { })); fn named_field(p: &mut Parser) { - node(p, NAMED_FIELD, |p| { - visibility(p); - p.expect(IDENT) && p.expect(COLON) && { - types::type_ref(p); - true - }; - }) + p.start(NAMED_FIELD); + visibility(p); + if p.expect(IDENT) && p.expect(COLON) { + types::type_ref(p); + }; + p.finish() } } @@ -118,10 +117,10 @@ fn tuple_fields(p: &mut Parser) { p.expect(R_PAREN); fn tuple_field(p: &mut Parser) { - node(p, POS_FIELD, |p| { - visibility(p); - types::type_ref(p); - }) + p.start(POS_FIELD); + visibility(p); + types::type_ref(p); + p.finish(); } } -- cgit v1.2.3