Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: pkg/analyzer/lib/src/dart/ast/ast.dart

Issue 1700263002: Add data structures to AST to indicate potentially mutated variables. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.dart.ast.ast; 5 library analyzer.src.dart.ast.ast;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 4703 matching lines...) Expand 10 before | Expand all | Expand 10 after
4714 4714
4715 /** 4715 /**
4716 * A node representing the body of a function or method. 4716 * A node representing the body of a function or method.
4717 * 4717 *
4718 * > functionBody ::= 4718 * > functionBody ::=
4719 * > [BlockFunctionBody] 4719 * > [BlockFunctionBody]
4720 * > | [EmptyFunctionBody] 4720 * > | [EmptyFunctionBody]
4721 * > | [ExpressionFunctionBody] 4721 * > | [ExpressionFunctionBody]
4722 */ 4722 */
4723 abstract class FunctionBodyImpl extends AstNodeImpl implements FunctionBody { 4723 abstract class FunctionBodyImpl extends AstNodeImpl implements FunctionBody {
4724 @override
4725 LocalVariableInfoImpl localVariableInfo;
4726
4724 /** 4727 /**
4725 * Return `true` if this function body is asynchronous. 4728 * Return `true` if this function body is asynchronous.
4726 */ 4729 */
4727 bool get isAsynchronous => false; 4730 bool get isAsynchronous => false;
4728 4731
4729 /** 4732 /**
4730 * Return `true` if this function body is a generator. 4733 * Return `true` if this function body is a generator.
4731 */ 4734 */
4732 bool get isGenerator => false; 4735 bool get isGenerator => false;
4733 4736
(...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after
6550 * > | [MapLiteral] 6553 * > | [MapLiteral]
6551 * > | [NullLiteral] 6554 * > | [NullLiteral]
6552 * > | [StringLiteral] 6555 * > | [StringLiteral]
6553 */ 6556 */
6554 abstract class LiteralImpl extends ExpressionImpl implements Literal { 6557 abstract class LiteralImpl extends ExpressionImpl implements Literal {
6555 @override 6558 @override
6556 int get precedence => 16; 6559 int get precedence => 16;
6557 } 6560 }
6558 6561
6559 /** 6562 /**
6563 * Concrete implementation of [LocalVariableInfo].
6564 */
6565 class LocalVariableInfoImpl extends LocalVariableInfo {
6566 @override
6567 final Set<VariableElement> potentiallyMutatedInClosure =
6568 new Set<VariableElement>();
6569
6570 @override
6571 final Set<VariableElement> potentiallyMutatedInScope =
6572 new Set<VariableElement>();
6573 }
6574
6575 /**
6560 * A single key/value pair in a map literal. 6576 * A single key/value pair in a map literal.
6561 * 6577 *
6562 * > mapLiteralEntry ::= 6578 * > mapLiteralEntry ::=
6563 * > [Expression] ':' [Expression] 6579 * > [Expression] ':' [Expression]
6564 */ 6580 */
6565 class MapLiteralEntryImpl extends AstNodeImpl implements MapLiteralEntry { 6581 class MapLiteralEntryImpl extends AstNodeImpl implements MapLiteralEntry {
6566 /** 6582 /**
6567 * The expression computing the key with which the value will be associated. 6583 * The expression computing the key with which the value will be associated.
6568 */ 6584 */
6569 Expression _key; 6585 Expression _key;
(...skipping 4235 matching lines...) Expand 10 before | Expand all | Expand 10 after
10805 } 10821 }
10806 10822
10807 @override 10823 @override
10808 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); 10824 accept(AstVisitor visitor) => visitor.visitYieldStatement(this);
10809 10825
10810 @override 10826 @override
10811 void visitChildren(AstVisitor visitor) { 10827 void visitChildren(AstVisitor visitor) {
10812 _safelyVisitChild(_expression, visitor); 10828 _safelyVisitChild(_expression, visitor);
10813 } 10829 }
10814 } 10830 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698