aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/parsing/grammar/items/consts.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-02-21 10:46:17 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-02-21 10:46:17 +0000
commitd77b5857c2420666e84dcd433f254e000e2843aa (patch)
tree416e333019e349bf4ee369f2548d9e6f6a9c67e9 /crates/ra_syntax/src/parsing/grammar/items/consts.rs
parent18b0c509f77a8e06141fee6668532cced1ebf5d8 (diff)
parent46179230a05331b1debd4dfa3bb197fa38d92347 (diff)
Merge #867
867: This moves the parser to separate crate r=matklad a=matklad That makes parser independent form both the token and the tree representation. Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/parsing/grammar/items/consts.rs')
-rw-r--r--crates/ra_syntax/src/parsing/grammar/items/consts.rs21
1 files changed, 0 insertions, 21 deletions
diff --git a/crates/ra_syntax/src/parsing/grammar/items/consts.rs b/crates/ra_syntax/src/parsing/grammar/items/consts.rs
deleted file mode 100644
index 5a5852f83..000000000
--- a/crates/ra_syntax/src/parsing/grammar/items/consts.rs
+++ /dev/null
@@ -1,21 +0,0 @@
1use super::*;
2
3pub(super) fn static_def(p: &mut Parser) {
4 const_or_static(p, STATIC_KW)
5}
6
7pub(super) fn const_def(p: &mut Parser) {
8 const_or_static(p, CONST_KW)
9}
10
11fn const_or_static(p: &mut Parser, kw: SyntaxKind) {
12 assert!(p.at(kw));
13 p.bump();
14 p.eat(MUT_KW); // TODO: validator to forbid const mut
15 name(p);
16 types::ascription(p);
17 if p.eat(EQ) {
18 expressions::expr(p);
19 }
20 p.expect(SEMI);
21}