aboutsummaryrefslogtreecommitdiff
path: root/src/parser_api.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser_api.rs')
-rw-r--r--src/parser_api.rs20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/parser_api.rs b/src/parser_api.rs
index 3cad91976..95394e39d 100644
--- a/src/parser_api.rs
+++ b/src/parser_api.rs
@@ -18,24 +18,14 @@ impl TokenSet {
18 18
19#[macro_export] 19#[macro_export]
20macro_rules! token_set { 20macro_rules! token_set {
21 ($($t:ident),*) => { 21 ($($t:ident),*) => { TokenSet($(1u128 << ($t as usize))|*) };
22 TokenSet($(1u128 << ($t as usize))|*) 22 ($($t:ident),* ,) => { token_set!($($t),*) };
23 };
24
25 ($($t:ident),* ,) => {
26 token_set!($($t),*)
27 };
28} 23}
29 24
30#[macro_export] 25#[macro_export]
31macro_rules! token_set_union { 26macro_rules! token_set_union {
32 ($($ts:expr),*) => { 27 ($($ts:expr),*) => { TokenSet($($ts.0)|*) };
33 TokenSet($($ts.0)|*) 28 ($($ts:expr),* ,) => { token_set_union!($($ts),*) };
34 };
35
36 ($($ts:expr),* ,) => {
37 token_set_union!($($ts),*)
38 };
39} 29}
40 30
41/// `Parser` struct provides the low-level API for 31/// `Parser` struct provides the low-level API for
@@ -141,7 +131,7 @@ impl Marker {
141 fn new(pos: u32) -> Marker { 131 fn new(pos: u32) -> Marker {
142 Marker { 132 Marker {
143 pos, 133 pos,
144 bomb: DropBomb::new("Marker must be either completed or abandoned") 134 bomb: DropBomb::new("Marker must be either completed or abandoned"),
145 } 135 }
146 } 136 }
147 137