aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-14 14:38:01 +0000
committerGitHub <[email protected]>2019-11-14 14:38:01 +0000
commitf2c64ba15d3ef87f731f17d90c873383d5f3e432 (patch)
treeff8a962228a7532a5f468862bc4b0c62535f5069 /crates/ra_parser/src
parent5c3ccc55082838524f695ffe40138fd8e805db70 (diff)
parent1583ab1558022d0fdbbc10d3a440a2d3daa4a840 (diff)
Merge #2243
2243: Move body queries to hir_def r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_parser/src')
-rw-r--r--crates/ra_parser/src/grammar/expressions/atom.rs34
-rw-r--r--crates/ra_parser/src/token_set.rs4
2 files changed, 19 insertions, 19 deletions
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs
index 4952bd189..f06191963 100644
--- a/crates/ra_parser/src/grammar/expressions/atom.rs
+++ b/crates/ra_parser/src/grammar/expressions/atom.rs
@@ -40,24 +40,24 @@ pub(crate) fn literal(p: &mut Parser) -> Option<CompletedMarker> {
40// E.g. for after the break in `if break {}`, this should not match 40// E.g. for after the break in `if break {}`, this should not match
41pub(super) const ATOM_EXPR_FIRST: TokenSet = 41pub(super) const ATOM_EXPR_FIRST: TokenSet =
42 LITERAL_FIRST.union(paths::PATH_FIRST).union(token_set![ 42 LITERAL_FIRST.union(paths::PATH_FIRST).union(token_set![
43 L_PAREN, 43 T!['('],
44 L_CURLY, 44 T!['{'],
45 L_BRACK, 45 T!['['],
46 PIPE, 46 T![|],
47 MOVE_KW, 47 T![move],
48 BOX_KW, 48 T![box],
49 IF_KW, 49 T![if],
50 WHILE_KW, 50 T![while],
51 MATCH_KW, 51 T![match],
52 UNSAFE_KW, 52 T![unsafe],
53 RETURN_KW, 53 T![return],
54 BREAK_KW, 54 T![break],
55 CONTINUE_KW, 55 T![continue],
56 T![async],
57 T![try],
58 T![loop],
59 T![for],
56 LIFETIME, 60 LIFETIME,
57 ASYNC_KW,
58 TRY_KW,
59 LOOP_KW,
60 FOR_KW,
61 ]); 61 ]);
62 62
63const EXPR_RECOVERY_SET: TokenSet = token_set![LET_KW]; 63const EXPR_RECOVERY_SET: TokenSet = token_set![LET_KW];
diff --git a/crates/ra_parser/src/token_set.rs b/crates/ra_parser/src/token_set.rs
index 6dc061889..2a6952c01 100644
--- a/crates/ra_parser/src/token_set.rs
+++ b/crates/ra_parser/src/token_set.rs
@@ -30,8 +30,8 @@ const fn mask(kind: SyntaxKind) -> u128 {
30 30
31#[macro_export] 31#[macro_export]
32macro_rules! token_set { 32macro_rules! token_set {
33 ($($t:ident),*) => { TokenSet::empty()$(.union(TokenSet::singleton($t)))* }; 33 ($($t:expr),*) => { TokenSet::empty()$(.union(TokenSet::singleton($t)))* };
34 ($($t:ident),* ,) => { token_set!($($t),*) }; 34 ($($t:expr),* ,) => { token_set!($($t),*) };
35} 35}
36 36
37#[test] 37#[test]