aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-07 12:52:03 +0100
committerAleksey Kladov <[email protected]>2018-08-07 12:52:03 +0100
commit1a25cb0b1e0f81e7b76c0b41b94d18eca3bd3bfb (patch)
tree3683c0849bccbe1aaf0d0b4373beebf5b62999f2 /src
parentba21da52741bf207db5081811e00eacf45796429 (diff)
simplify unary expr grammar
Diffstat (limited to 'src')
-rw-r--r--src/grammar.ron4
-rw-r--r--src/grammar/expressions/mod.rs14
-rw-r--r--src/syntax_kinds/generated.rs8
3 files changed, 5 insertions, 21 deletions
diff --git a/src/grammar.ron b/src/grammar.ron
index 5181e296e..960838c97 100644
--- a/src/grammar.ron
+++ b/src/grammar.ron
@@ -171,9 +171,7 @@ Grammar(
171 171
172 // unary 172 // unary
173 "REF_EXPR", 173 "REF_EXPR",
174 "DEREF_EXPR", 174 "PREFIX_EXPR",
175 "NOT_EXPR",
176 "NEG_EXPR",
177 175
178 "RANGE_EXPR", // just weird 176 "RANGE_EXPR", // just weird
179 "BIN_EXPR", 177 "BIN_EXPR",
diff --git a/src/grammar/expressions/mod.rs b/src/grammar/expressions/mod.rs
index 739c2f80f..853a9411c 100644
--- a/src/grammar/expressions/mod.rs
+++ b/src/grammar/expressions/mod.rs
@@ -130,28 +130,18 @@ fn lhs(p: &mut Parser, r: Restrictions) -> Option<CompletedMarker> {
130 // fn foo() { 130 // fn foo() {
131 // **&1; 131 // **&1;
132 // } 132 // }
133 STAR => {
134 m = p.start();
135 p.bump();
136 DEREF_EXPR
137 }
138 // test not_expr 133 // test not_expr
139 // fn foo() { 134 // fn foo() {
140 // !!true; 135 // !!true;
141 // } 136 // }
142 EXCL => {
143 m = p.start();
144 p.bump();
145 NOT_EXPR
146 }
147 // test neg_expr 137 // test neg_expr
148 // fn foo() { 138 // fn foo() {
149 // --1; 139 // --1;
150 // } 140 // }
151 MINUS => { 141 STAR | EXCL | MINUS => {
152 m = p.start(); 142 m = p.start();
153 p.bump(); 143 p.bump();
154 NEG_EXPR 144 PREFIX_EXPR
155 } 145 }
156 DOTDOT => { 146 DOTDOT => {
157 m = p.start(); 147 m = p.start();
diff --git a/src/syntax_kinds/generated.rs b/src/syntax_kinds/generated.rs
index c8ddf333c..cf286a0f1 100644
--- a/src/syntax_kinds/generated.rs
+++ b/src/syntax_kinds/generated.rs
@@ -157,9 +157,7 @@ pub enum SyntaxKind {
157 TRY_EXPR, 157 TRY_EXPR,
158 CAST_EXPR, 158 CAST_EXPR,
159 REF_EXPR, 159 REF_EXPR,
160 DEREF_EXPR, 160 PREFIX_EXPR,
161 NOT_EXPR,
162 NEG_EXPR,
163 RANGE_EXPR, 161 RANGE_EXPR,
164 BIN_EXPR, 162 BIN_EXPR,
165 EXTERN_BLOCK_EXPR, 163 EXTERN_BLOCK_EXPR,
@@ -397,9 +395,7 @@ impl SyntaxKind {
397 TRY_EXPR => &SyntaxInfo { name: "TRY_EXPR" }, 395 TRY_EXPR => &SyntaxInfo { name: "TRY_EXPR" },
398 CAST_EXPR => &SyntaxInfo { name: "CAST_EXPR" }, 396 CAST_EXPR => &SyntaxInfo { name: "CAST_EXPR" },
399 REF_EXPR => &SyntaxInfo { name: "REF_EXPR" }, 397 REF_EXPR => &SyntaxInfo { name: "REF_EXPR" },
400 DEREF_EXPR => &SyntaxInfo { name: "DEREF_EXPR" }, 398 PREFIX_EXPR => &SyntaxInfo { name: "PREFIX_EXPR" },
401 NOT_EXPR => &SyntaxInfo { name: "NOT_EXPR" },
402 NEG_EXPR => &SyntaxInfo { name: "NEG_EXPR" },
403 RANGE_EXPR => &SyntaxInfo { name: "RANGE_EXPR" }, 399 RANGE_EXPR => &SyntaxInfo { name: "RANGE_EXPR" },
404 BIN_EXPR => &SyntaxInfo { name: "BIN_EXPR" }, 400 BIN_EXPR => &SyntaxInfo { name: "BIN_EXPR" },
405 EXTERN_BLOCK_EXPR => &SyntaxInfo { name: "EXTERN_BLOCK_EXPR" }, 401 EXTERN_BLOCK_EXPR => &SyntaxInfo { name: "EXTERN_BLOCK_EXPR" },