aboutsummaryrefslogtreecommitdiff
path: root/src/parser/event_parser/parser.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-01-20 21:31:29 +0000
committerAleksey Kladov <[email protected]>2018-01-20 21:31:29 +0000
commitefd538d793c714a3167a216f032be7b7d34c1d57 (patch)
tree4b6a58c1922de2a7aba018375f365752baa5cd80 /src/parser/event_parser/parser.rs
parent0b5d39f2a204e5ec6cd6205440e4cdc763162814 (diff)
Remove high-order bits from attributes
Diffstat (limited to 'src/parser/event_parser/parser.rs')
-rw-r--r--src/parser/event_parser/parser.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/parser/event_parser/parser.rs b/src/parser/event_parser/parser.rs
index 2bc9dd34f..2cbe370be 100644
--- a/src/parser/event_parser/parser.rs
+++ b/src/parser/event_parser/parser.rs
@@ -67,6 +67,29 @@ impl CompleteMarker {
67 } 67 }
68} 68}
69 69
70pub(crate) struct TokenSet {
71 pub tokens: &'static [SyntaxKind]
72}
73
74impl TokenSet {
75 pub fn contains(&self, kind: SyntaxKind) -> bool {
76 self.tokens.contains(&kind)
77 }
78}
79
80#[macro_export]
81macro_rules! token_set {
82 ($($t:ident),*) => {
83 TokenSet {
84 tokens: &[$($t),*],
85 }
86 };
87
88 ($($t:ident),* ,) => {
89 token_set!($($t),*)
90 };
91}
92
70 93
71pub(crate) struct Parser<'t> { 94pub(crate) struct Parser<'t> {
72 #[allow(unused)] 95 #[allow(unused)]