From 40494fb90e8d3c00a9f9a6ba79707242ca8cd5e8 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Sun, 27 May 2018 21:19:04 -0500 Subject: [PATCH] CLEANUP: Comment cleanup. --- src/parse/mod.rs | 12 ------------ src/tokenizer/mod.rs | 6 +++--- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/parse/mod.rs b/src/parse/mod.rs index 9a0c828..51b2de6 100644 --- a/src/parse/mod.rs +++ b/src/parse/mod.rs @@ -132,8 +132,6 @@ named!(number, )) | do_parse!( // 1 prefix: match_type!(DIGIT) >> -// The peek!(not!(..)) make this whole combinator slightly -// safer for partial inputs. (Some(prefix.clone()), None, None) )), triple_to_number @@ -754,16 +752,6 @@ named!(non_op_expression, simple_expression) ); -// NOTE(jwall): HERE THERE BE DRAGONS. The order for these matters -// a lot. We need to process alternatives in order of decreasing -// specificity. Unfortunately this means we are required to go in a -// decreasing size order which messes with alt!'s completion logic. To -// work around this we have to force Incomplete to be Error so that -// alt! will try the next in the series instead of aborting. -// -// *IMPORTANT* -// It also means this combinator is risky when used with partial -// inputs. So handle with care. named!(expression, alt!(complete!(op_expression) | complete!(non_op_expression)) ); diff --git a/src/tokenizer/mod.rs b/src/tokenizer/mod.rs index fcb32a4..2eeefa8 100644 --- a/src/tokenizer/mod.rs +++ b/src/tokenizer/mod.rs @@ -116,9 +116,9 @@ named!(booleantok( Span ) -> Token, /// less code. macro_rules! do_tag_tok { // NOTE(jwall): Nom macros do magic with their inputs. They in fact - // rewrite your macro argumets for you. Which means we require this $i - // paramater even though we don't explicitely pass it below. I don't - // particularly like this but I'm living with it for now. + // rewrite your macro argumets for you by adding an initial argument + // for all their sub-macros. Which means we require this $i paramater + // on the first macro invocation but not the rest. ($i:expr, $type:expr, $tag:expr) => { do_parse!( $i,