aboutsummaryrefslogtreecommitdiff
path: root/crates/libeditor/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-27 20:03:19 +0100
committerAleksey Kladov <[email protected]>2018-08-27 20:03:19 +0100
commit57518153147ad53639f16cc940d219dc582c550a (patch)
tree5c1708cf8ea4e2344c8dfc96af82343be0b0271c /crates/libeditor/src
parentb79c8b6d8a3b38c94de992a54ffb9055c1ad6f31 (diff)
Add runnables
Diffstat (limited to 'crates/libeditor/src')
-rw-r--r--crates/libeditor/src/scope.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/crates/libeditor/src/scope.rs b/crates/libeditor/src/scope.rs
index 76104b2cf..3d398a74c 100644
--- a/crates/libeditor/src/scope.rs
+++ b/crates/libeditor/src/scope.rs
@@ -61,7 +61,19 @@ fn compute_expr_scopes(expr: ast::Expr, scopes: &mut FnScopes, scope: ScopeId) {
61 compute_block_scopes(block, scopes, scope); 61 compute_block_scopes(block, scopes, scope);
62 } 62 }
63 } 63 }
64 // ForExpr(e) => TODO, 64 ast::Expr::ForExpr(e) => {
65 if let Some(expr) = e.iterable() {
66 compute_expr_scopes(expr, scopes, scope);
67 }
68 let mut scope = scope;
69 if let Some(pat) = e.pat() {
70 scope = scopes.new_scope(scope);
71 scopes.add_bindings(scope, pat);
72 }
73 if let Some(block) = e.body() {
74 compute_block_scopes(block, scopes, scope);
75 }
76 },
65 _ => { 77 _ => {
66 expr.syntax().children() 78 expr.syntax().children()
67 .filter_map(ast::Expr::cast) 79 .filter_map(ast::Expr::cast)