diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-28 20:56:28 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-29 15:11:01 +0100 |
commit | a0c75cde8a0680047bc4e9bc0a2bb24099e271fe (patch) | |
tree | 3d033ea9c4e75046c766c2c051eb49c6ad7803a3 /src | |
parent | 2b84e92f4f0981b099f30759330d00a73c90dee8 (diff) |
refactor: remove no longer needed macro rules
Diffstat (limited to 'src')
-rw-r--r-- | src/tokenizer/mod.rs | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/tokenizer/mod.rs b/src/tokenizer/mod.rs index fc8bd7f..299f612 100644 --- a/src/tokenizer/mod.rs +++ b/src/tokenizer/mod.rs @@ -602,24 +602,10 @@ macro_rules! sh_trace ( ( $me:ident : $($cmds:tt)* ) => ( shorthand!($me: $($cmd // A little DSL for sequencing shorthand actions. macro_rules! go ( - // A pattern like $($cmd:tt)* ; $($rest:tt)* causes parse ambiguity. - // We have to tell the parser how much lookahead we need. - - ( $me:ident : $a:tt ; $($rest:tt)* ) => ({ sh_trace!($me: $a); go!($me: $($rest)*); }); - ( $me:ident : $a:tt $b:tt ; $($rest:tt)* ) => ({ sh_trace!($me: $a $b); go!($me: $($rest)*); }); - ( $me:ident : $a:tt $b:tt $c:tt ; $($rest:tt)* ) => ({ sh_trace!($me: $a $b $c); go!($me: $($rest)*); }); - ( $me:ident : $a:tt $b:tt $c:tt $d:tt ; $($rest:tt)* ) => ({ sh_trace!($me: $a $b $c $d); go!($me: $($rest)*); }); - - // These can only come at the end. - ( $me:ident : to $s:ident ) => ({ $me.state = states::$s; return ProcessResult::Continue; }); ( $me:ident : to $s:ident $k1:expr ) => ({ $me.state = states::$s($k1); return ProcessResult::Continue; }); ( $me:ident : to $s:ident $k1:ident $k2:expr ) => ({ $me.state = states::$s($k1($k2)); return ProcessResult::Continue; }); - ( $me:ident : reconsume $s:ident ) => ({ $me.reconsume = true; go!($me: to $s); }); - ( $me:ident : reconsume $s:ident $k1:expr ) => ({ $me.reconsume = true; go!($me: to $s $k1); }); - ( $me:ident : reconsume $s:ident $k1:ident $k2:expr ) => ({ $me.reconsume = true; go!($me: to $s $k1 $k2); }); - ( $me:ident : consume_char_ref ) => ({ $me.consume_char_ref(None); return ProcessResult::Continue; }); ( $me:ident : consume_char_ref $addnl:expr ) => ({ $me.consume_char_ref(Some($addnl)); return ProcessResult::Continue; }); |