diff options
Diffstat (limited to 'src/parser_api.rs')
-rw-r--r-- | src/parser_api.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/parser_api.rs b/src/parser_api.rs index 58002a8fc..c78c6e43a 100644 --- a/src/parser_api.rs +++ b/src/parser_api.rs | |||
@@ -29,6 +29,15 @@ macro_rules! token_set_union { | |||
29 | ($($ts:expr),* ,) => { token_set_union!($($ts),*) }; | 29 | ($($ts:expr),* ,) => { token_set_union!($($ts),*) }; |
30 | } | 30 | } |
31 | 31 | ||
32 | #[test] | ||
33 | fn token_set_works_for_tokens() { | ||
34 | use SyntaxKind::*; | ||
35 | let ts = token_set! { EOF, SHEBANG }; | ||
36 | assert!(ts.contains(EOF)); | ||
37 | assert!(ts.contains(SHEBANG)); | ||
38 | assert!(!ts.contains(PLUS)); | ||
39 | } | ||
40 | |||
32 | /// `Parser` struct provides the low-level API for | 41 | /// `Parser` struct provides the low-level API for |
33 | /// navigating through the stream of tokens and | 42 | /// navigating through the stream of tokens and |
34 | /// constructing the parse tree. The actual parsing | 43 | /// constructing the parse tree. The actual parsing |