diff options
author | Lenard Pratt <l3np27@gmail.com> | 2019-04-03 23:23:58 +0100 |
---|---|---|
committer | Lenard Pratt <l3np27@gmail.com> | 2019-04-07 13:23:12 +0100 |
commit | 2d73c909fe03c799b488aa0f97a588e13bbd7006 (patch) | |
tree | b96bf7ccc6cc6e0ebb86e52ffad104f44f53d556 /crates/ra_syntax/src | |
parent | 36f5d997565b6390a4b524e7e1d0d805f0f26bdb (diff) |
Added inference of array length
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 4 | ||||
-rw-r--r-- | crates/ra_syntax/src/grammar.ron | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 0376c91c8..39b760551 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -108,6 +108,10 @@ impl ArrayExpr { | |||
108 | pub fn exprs(&self) -> impl Iterator<Item = &Expr> { | 108 | pub fn exprs(&self) -> impl Iterator<Item = &Expr> { |
109 | super::children(self) | 109 | super::children(self) |
110 | } | 110 | } |
111 | |||
112 | pub fn repeat(&self) -> Option<&Expr> { | ||
113 | super::child_opt(self) | ||
114 | } | ||
111 | } | 115 | } |
112 | 116 | ||
113 | // ArrayType | 117 | // ArrayType |
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 0a35e25d5..c7116c69b 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron | |||
@@ -395,7 +395,8 @@ Grammar( | |||
395 | collections: [["exprs", "Expr"]] | 395 | collections: [["exprs", "Expr"]] |
396 | ), | 396 | ), |
397 | "ArrayExpr": ( | 397 | "ArrayExpr": ( |
398 | collections: [["exprs", "Expr"]] | 398 | collections: [["exprs", "Expr"]], |
399 | options:[["repeat","Expr"]] | ||
399 | ), | 400 | ), |
400 | "ParenExpr": (options: ["Expr"]), | 401 | "ParenExpr": (options: ["Expr"]), |
401 | "PathExpr": (options: ["Path"]), | 402 | "PathExpr": (options: ["Path"]), |