aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/codegen
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-31 16:08:58 +0100
committerAleksey Kladov <[email protected]>2020-07-31 16:08:58 +0100
commit633aace41108b74fe6c93c5ab04272067db033f9 (patch)
treed071a03fb2c191629da532c14c002c30328d1e04 /xtask/src/codegen
parentbfcee63e75d6feb21cafbdf3887e0efd508b6b2e (diff)
Rename LambdaExpr -> ClosureExpr
Diffstat (limited to 'xtask/src/codegen')
-rw-r--r--xtask/src/codegen/gen_syntax.rs14
-rw-r--r--xtask/src/codegen/rust.ungram16
2 files changed, 21 insertions, 9 deletions
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs
index 90f746e96..059538696 100644
--- a/xtask/src/codegen/gen_syntax.rs
+++ b/xtask/src/codegen/gen_syntax.rs
@@ -579,7 +579,19 @@ fn lower_rule(acc: &mut Vec<Field>, grammar: &Grammar, label: Option<&String>, r
579 } 579 }
580 Rule::Labeled { label: l, rule } => { 580 Rule::Labeled { label: l, rule } => {
581 assert!(label.is_none()); 581 assert!(label.is_none());
582 if l == "op" { 582 let manually_implemented = matches!(
583 l.as_str(),
584 "lhs"
585 | "rhs"
586 | "then_branch"
587 | "else_branch"
588 | "start"
589 | "end"
590 | "op"
591 | "index"
592 | "base"
593 );
594 if manually_implemented {
583 return; 595 return;
584 } 596 }
585 lower_rule(acc, grammar, Some(l), rule); 597 lower_rule(acc, grammar, Some(l), rule);
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram
index 93195befe..aef07cb1e 100644
--- a/xtask/src/codegen/rust.ungram
+++ b/xtask/src/codegen/rust.ungram
@@ -222,7 +222,7 @@ Expr =
222| IfExpr 222| IfExpr
223| IndexExpr 223| IndexExpr
224| Label 224| Label
225| LambdaExpr 225| ClosureExpr
226| Literal 226| Literal
227| LoopExpr 227| LoopExpr
228| MacroCall 228| MacroCall
@@ -266,14 +266,14 @@ PrefixExpr =
266 266
267BinExpr = 267BinExpr =
268 Attr* 268 Attr*
269 Expr 269 lhs:Expr
270 op:( 270 op:(
271 '||' | '&&' 271 '||' | '&&'
272 | '==' | '!=' | '<=' | '>=' | '<' | '>' 272 | '==' | '!=' | '<=' | '>=' | '<' | '>'
273 | '+' | '*' | '-' | '/' | '%' | '<<' | '>>' | '^' | '|' | '&' 273 | '+' | '*' | '-' | '/' | '%' | '<<' | '>>' | '^' | '|' | '&'
274 | '=' | '+=' | '/=' | '*=' | '%=' | '>>=' | '<<=' | '-=' | '|=' | '&=' | '^=' 274 | '=' | '+=' | '/=' | '*=' | '%=' | '>>=' | '<<=' | '-=' | '|=' | '&=' | '^='
275 ) 275 )
276 Expr 276 rhs:Expr
277 277
278CastExpr = 278CastExpr =
279 Attr* Expr 'as' Type 279 Attr* Expr 'as' Type
@@ -288,7 +288,7 @@ ArrayExpr =
288 ) ']' 288 ) ']'
289 289
290IndexExpr = 290IndexExpr =
291 Attr* Expr '[' Expr ']' 291 Attr* base:Expr '[' index:Expr ']'
292 292
293TupleExpr = 293TupleExpr =
294 Attr* '(' Attr* (Expr (',' Expr)* ','?)? ')' 294 Attr* '(' Attr* (Expr (',' Expr)* ','?)? ')'
@@ -318,13 +318,13 @@ MethodCallExpr =
318FieldExpr = 318FieldExpr =
319 Attr* Expr '.' NameRef 319 Attr* Expr '.' NameRef
320 320
321LambdaExpr = 321ClosureExpr =
322 Attr* 'static'? 'async'? 'move'? ParamList RetType? 322 Attr* 'static'? 'async'? 'move'? ParamList RetType?
323 body:Expr 323 body:Expr
324 324
325IfExpr = 325IfExpr =
326 Attr* 'if' Condition BlockExpr 326 Attr* 'if' Condition then_branch:BlockExpr
327 ('else' (IfExpr | BlockExpr))? 327 ('else' else_branch:(IfExpr | BlockExpr))?
328 328
329Condition = 329Condition =
330 'let' Pat '=' Expr 330 'let' Pat '=' Expr
@@ -352,7 +352,7 @@ ContinueExpr =
352 Attr* 'continue' 'lifetime'? 352 Attr* 'continue' 'lifetime'?
353 353
354RangeExpr = 354RangeExpr =
355 Attr* Expr? op:('..' | '..=') Expr? 355 Attr* start:Expr? op:('..' | '..=') end:Expr?
356 356
357MatchExpr = 357MatchExpr =
358 Attr* 'match' Expr MatchArmList 358 Attr* 'match' Expr MatchArmList