| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 library engine.ast; | 3 library engine.ast; |
| 4 import 'dart:collection'; | 4 import 'dart:collection'; |
| 5 import 'java_core.dart'; | 5 import 'java_core.dart'; |
| 6 import 'java_engine.dart'; | 6 import 'java_engine.dart'; |
| 7 import 'source.dart' show LineInfo; | 7 import 'source.dart' show LineInfo; |
| 8 import 'scanner.dart'; | 8 import 'scanner.dart'; |
| 9 import 'engine.dart' show AnalysisEngine; | 9 import 'engine.dart' show AnalysisEngine; |
| 10 import 'utilities_dart.dart'; | 10 import 'utilities_dart.dart'; |
| 11 import 'utilities_collection.dart' show TokenMap; |
| 11 import 'element.dart'; | 12 import 'element.dart'; |
| 12 /** | 13 /** |
| 13 * The abstract class `ASTNode` defines the behavior common to all nodes in the
AST structure | 14 * The abstract class `ASTNode` defines the behavior common to all nodes in the
AST structure |
| 14 * for a Dart program. | 15 * for a Dart program. |
| 15 * | 16 * |
| 16 * @coverage dart.engine.ast | 17 * @coverage dart.engine.ast |
| 17 */ | 18 */ |
| 18 abstract class ASTNode { | 19 abstract class ASTNode { |
| 19 | 20 |
| 20 /** | 21 /** |
| (...skipping 14597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14618 } | 14619 } |
| 14619 List clone3(NodeList nodes) { | 14620 List clone3(NodeList nodes) { |
| 14620 List clonedNodes = new List(); | 14621 List clonedNodes = new List(); |
| 14621 for (ASTNode node in nodes) { | 14622 for (ASTNode node in nodes) { |
| 14622 clonedNodes.add(node.accept(this) as ASTNode); | 14623 clonedNodes.add(node.accept(this) as ASTNode); |
| 14623 } | 14624 } |
| 14624 return clonedNodes; | 14625 return clonedNodes; |
| 14625 } | 14626 } |
| 14626 } | 14627 } |
| 14627 /** | 14628 /** |
| 14629 * Instances of the class `IncrementalASTCloner` implement an object that will c
lone any AST |
| 14630 * structure that it visits. The cloner will clone the structure, replacing the
specified ASTNode |
| 14631 * with a new ASTNode, mapping the old token stream to a new token stream, and p
reserving resolution |
| 14632 * results. |
| 14633 */ |
| 14634 class IncrementalASTCloner implements ASTVisitor<ASTNode> { |
| 14635 |
| 14636 /** |
| 14637 * The node to be replaced during the cloning process. |
| 14638 */ |
| 14639 ASTNode _oldNode; |
| 14640 |
| 14641 /** |
| 14642 * The replacement node used during the cloning process. |
| 14643 */ |
| 14644 ASTNode _newNode; |
| 14645 |
| 14646 /** |
| 14647 * A mapping of old tokens to new tokens used during the cloning process. |
| 14648 */ |
| 14649 TokenMap _tokenMap; |
| 14650 |
| 14651 /** |
| 14652 * Construct a new instance that will replace `oldNode` with `newNode` in the
process |
| 14653 * of cloning an existing AST structure. |
| 14654 * |
| 14655 * @param oldNode the node to be replaced |
| 14656 * @param newNode the replacement node |
| 14657 * @param tokenMap a mapping of old tokens to new tokens (not `null`) |
| 14658 */ |
| 14659 IncrementalASTCloner(ASTNode oldNode, ASTNode newNode, TokenMap tokenMap) { |
| 14660 this._oldNode = oldNode; |
| 14661 this._newNode = newNode; |
| 14662 this._tokenMap = tokenMap; |
| 14663 } |
| 14664 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri
ngs.full(clone5(node.strings)); |
| 14665 Annotation visitAnnotation(Annotation node) { |
| 14666 Annotation copy = new Annotation.full(map(node.atSign), clone4(node.name), m
ap(node.period), clone4(node.constructorName), clone4(node.arguments)); |
| 14667 copy.element = node.element; |
| 14668 return copy; |
| 14669 } |
| 14670 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node
) { |
| 14671 ArgumentDefinitionTest copy = new ArgumentDefinitionTest.full(map(node.quest
ion), clone4(node.identifier)); |
| 14672 copy.propagatedType = node.propagatedType; |
| 14673 copy.staticType = node.staticType; |
| 14674 return copy; |
| 14675 } |
| 14676 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList.full(map
(node.leftParenthesis), clone5(node.arguments), map(node.rightParenthesis)); |
| 14677 AsExpression visitAsExpression(AsExpression node) { |
| 14678 AsExpression copy = new AsExpression.full(clone4(node.expression), map(node.
asOperator), clone4(node.type)); |
| 14679 copy.propagatedType = node.propagatedType; |
| 14680 copy.staticType = node.staticType; |
| 14681 return copy; |
| 14682 } |
| 14683 ASTNode visitAssertStatement(AssertStatement node) => new AssertStatement.full
(map(node.keyword), map(node.leftParenthesis), clone4(node.condition), map(node.
rightParenthesis), map(node.semicolon)); |
| 14684 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) { |
| 14685 AssignmentExpression copy = new AssignmentExpression.full(clone4(node.leftHa
ndSide), map(node.operator), clone4(node.rightHandSide)); |
| 14686 copy.propagatedElement = node.propagatedElement; |
| 14687 copy.staticElement = node.staticElement; |
| 14688 return copy; |
| 14689 } |
| 14690 BinaryExpression visitBinaryExpression(BinaryExpression node) { |
| 14691 BinaryExpression copy = new BinaryExpression.full(clone4(node.leftOperand),
map(node.operator), clone4(node.rightOperand)); |
| 14692 copy.propagatedElement = node.propagatedElement; |
| 14693 copy.propagatedType = node.propagatedType; |
| 14694 copy.staticElement = node.staticElement; |
| 14695 copy.staticType = node.staticType; |
| 14696 return copy; |
| 14697 } |
| 14698 Block visitBlock(Block node) => new Block.full(map(node.leftBracket), clone5(n
ode.statements), map(node.rightBracket)); |
| 14699 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF
unctionBody.full(clone4(node.block)); |
| 14700 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) { |
| 14701 BooleanLiteral copy = new BooleanLiteral.full(map(node.literal), node.value)
; |
| 14702 copy.propagatedType = node.propagatedType; |
| 14703 copy.staticType = node.staticType; |
| 14704 return copy; |
| 14705 } |
| 14706 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement.
full(map(node.keyword), clone4(node.label), map(node.semicolon)); |
| 14707 CascadeExpression visitCascadeExpression(CascadeExpression node) { |
| 14708 CascadeExpression copy = new CascadeExpression.full(clone4(node.target), clo
ne5(node.cascadeSections)); |
| 14709 copy.propagatedType = node.propagatedType; |
| 14710 copy.staticType = node.staticType; |
| 14711 return copy; |
| 14712 } |
| 14713 CatchClause visitCatchClause(CatchClause node) => new CatchClause.full(map(nod
e.onKeyword), clone4(node.exceptionType), map(node.catchKeyword), map(node.leftP
arenthesis), clone4(node.exceptionParameter), map(node.comma), clone4(node.stack
TraceParameter), map(node.rightParenthesis), clone4(node.body)); |
| 14714 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { |
| 14715 ClassDeclaration copy = new ClassDeclaration.full(clone4(node.documentationC
omment), clone5(node.metadata), map(node.abstractKeyword), map(node.classKeyword
), clone4(node.name), clone4(node.typeParameters), clone4(node.extendsClause), c
lone4(node.withClause), clone4(node.implementsClause), map(node.leftBracket), cl
one5(node.members), map(node.rightBracket)); |
| 14716 copy.nativeClause = clone4(node.nativeClause); |
| 14717 return copy; |
| 14718 } |
| 14719 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias.
full(clone4(node.documentationComment), clone5(node.metadata), map(node.keyword)
, clone4(node.name), clone4(node.typeParameters), map(node.equals), map(node.abs
tractKeyword), clone4(node.superclass), clone4(node.withClause), clone4(node.imp
lementsClause), map(node.semicolon)); |
| 14720 Comment visitComment(Comment node) { |
| 14721 if (node.isDocumentation) { |
| 14722 return Comment.createDocumentationComment2(map2(node.tokens), clone5(node.
references)); |
| 14723 } else if (node.isBlock) { |
| 14724 return Comment.createBlockComment(map2(node.tokens)); |
| 14725 } |
| 14726 return Comment.createEndOfLineComment(map2(node.tokens)); |
| 14727 } |
| 14728 CommentReference visitCommentReference(CommentReference node) => new CommentRe
ference.full(map(node.newKeyword), clone4(node.identifier)); |
| 14729 CompilationUnit visitCompilationUnit(CompilationUnit node) { |
| 14730 CompilationUnit copy = new CompilationUnit.full(map(node.beginToken), clone4
(node.scriptTag), clone5(node.directives), clone5(node.declarations), map(node.e
ndToken)); |
| 14731 copy.lineInfo = node.lineInfo; |
| 14732 copy.element = node.element; |
| 14733 return copy; |
| 14734 } |
| 14735 ConditionalExpression visitConditionalExpression(ConditionalExpression node) { |
| 14736 ConditionalExpression copy = new ConditionalExpression.full(clone4(node.cond
ition), map(node.question), clone4(node.thenExpression), map(node.colon), clone4
(node.elseExpression)); |
| 14737 copy.propagatedType = node.propagatedType; |
| 14738 copy.staticType = node.staticType; |
| 14739 return copy; |
| 14740 } |
| 14741 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node
) { |
| 14742 ConstructorDeclaration copy = new ConstructorDeclaration.full(clone4(node.do
cumentationComment), clone5(node.metadata), map(node.externalKeyword), map(node.
constKeyword), map(node.factoryKeyword), clone4(node.returnType), map(node.perio
d), clone4(node.name), clone4(node.parameters), map(node.separator), clone5(node
.initializers), clone4(node.redirectedConstructor), clone4(node.body)); |
| 14743 copy.element = node.element; |
| 14744 return copy; |
| 14745 } |
| 14746 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI
nitializer node) => new ConstructorFieldInitializer.full(map(node.keyword), map(
node.period), clone4(node.fieldName), map(node.equals), clone4(node.expression))
; |
| 14747 ConstructorName visitConstructorName(ConstructorName node) { |
| 14748 ConstructorName copy = new ConstructorName.full(clone4(node.type), map(node.
period), clone4(node.name)); |
| 14749 copy.staticElement = node.staticElement; |
| 14750 return copy; |
| 14751 } |
| 14752 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin
ueStatement.full(map(node.keyword), clone4(node.label), map(node.semicolon)); |
| 14753 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec
laredIdentifier.full(clone4(node.documentationComment), clone5(node.metadata), m
ap(node.keyword), clone4(node.type), clone4(node.identifier)); |
| 14754 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node
) => new DefaultFormalParameter.full(clone4(node.parameter), node.kind, map(node
.separator), clone4(node.defaultValue)); |
| 14755 DoStatement visitDoStatement(DoStatement node) => new DoStatement.full(map(nod
e.doKeyword), clone4(node.body), map(node.whileKeyword), map(node.leftParenthesi
s), clone4(node.condition), map(node.rightParenthesis), map(node.semicolon)); |
| 14756 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) { |
| 14757 DoubleLiteral copy = new DoubleLiteral.full(map(node.literal), node.value); |
| 14758 copy.propagatedType = node.propagatedType; |
| 14759 copy.staticType = node.staticType; |
| 14760 return copy; |
| 14761 } |
| 14762 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF
unctionBody.full(map(node.semicolon)); |
| 14763 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement.
full(map(node.semicolon)); |
| 14764 ExportDirective visitExportDirective(ExportDirective node) { |
| 14765 ExportDirective copy = new ExportDirective.full(clone4(node.documentationCom
ment), clone5(node.metadata), map(node.keyword), clone4(node.uri), clone5(node.c
ombinators), map(node.semicolon)); |
| 14766 copy.element = node.element; |
| 14767 return copy; |
| 14768 } |
| 14769 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node
) => new ExpressionFunctionBody.full(map(node.functionDefinition), clone4(node.e
xpression), map(node.semicolon)); |
| 14770 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new
ExpressionStatement.full(clone4(node.expression), map(node.semicolon)); |
| 14771 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause.full
(map(node.keyword), clone4(node.superclass)); |
| 14772 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl
aration.full(clone4(node.documentationComment), clone5(node.metadata), map(node.
staticKeyword), clone4(node.fields), map(node.semicolon)); |
| 14773 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n
ew FieldFormalParameter.full(clone4(node.documentationComment), clone5(node.meta
data), map(node.keyword), clone4(node.type), map(node.thisToken), map(node.perio
d), clone4(node.identifier), clone4(node.parameters)); |
| 14774 ForEachStatement visitForEachStatement(ForEachStatement node) { |
| 14775 DeclaredIdentifier loopVariable = node.loopVariable; |
| 14776 if (loopVariable == null) { |
| 14777 return new ForEachStatement.con2_full(map(node.forKeyword), map(node.leftP
arenthesis), clone4(node.identifier), map(node.inKeyword), clone4(node.iterator)
, map(node.rightParenthesis), clone4(node.body)); |
| 14778 } |
| 14779 return new ForEachStatement.con1_full(map(node.forKeyword), map(node.leftPar
enthesis), clone4(loopVariable), map(node.inKeyword), clone4(node.iterator), map
(node.rightParenthesis), clone4(node.body)); |
| 14780 } |
| 14781 FormalParameterList visitFormalParameterList(FormalParameterList node) => new
FormalParameterList.full(map(node.leftParenthesis), clone5(node.parameters), map
(node.leftDelimiter), map(node.rightDelimiter), map(node.rightParenthesis)); |
| 14782 ForStatement visitForStatement(ForStatement node) => new ForStatement.full(map
(node.forKeyword), map(node.leftParenthesis), clone4(node.variables), clone4(nod
e.initialization), map(node.leftSeparator), clone4(node.condition), map(node.rig
htSeparator), clone5(node.updaters), map(node.rightParenthesis), clone4(node.bod
y)); |
| 14783 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new
FunctionDeclaration.full(clone4(node.documentationComment), clone5(node.metadata
), map(node.externalKeyword), clone4(node.returnType), map(node.propertyKeyword)
, clone4(node.name), clone4(node.functionExpression)); |
| 14784 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara
tionStatement node) => new FunctionDeclarationStatement.full(clone4(node.functio
nDeclaration)); |
| 14785 FunctionExpression visitFunctionExpression(FunctionExpression node) { |
| 14786 FunctionExpression copy = new FunctionExpression.full(clone4(node.parameters
), clone4(node.body)); |
| 14787 copy.element = node.element; |
| 14788 copy.propagatedType = node.propagatedType; |
| 14789 copy.staticType = node.staticType; |
| 14790 return copy; |
| 14791 } |
| 14792 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress
ionInvocation node) { |
| 14793 FunctionExpressionInvocation copy = new FunctionExpressionInvocation.full(cl
one4(node.function), clone4(node.argumentList)); |
| 14794 copy.propagatedElement = node.propagatedElement; |
| 14795 copy.propagatedType = node.propagatedType; |
| 14796 copy.staticElement = node.staticElement; |
| 14797 copy.staticType = node.staticType; |
| 14798 return copy; |
| 14799 } |
| 14800 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi
onTypeAlias.full(clone4(node.documentationComment), clone5(node.metadata), map(n
ode.keyword), clone4(node.returnType), clone4(node.name), clone4(node.typeParame
ters), clone4(node.parameters), map(node.semicolon)); |
| 14801 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo
rmalParameter node) => new FunctionTypedFormalParameter.full(clone4(node.documen
tationComment), clone5(node.metadata), clone4(node.returnType), clone4(node.iden
tifier), clone4(node.parameters)); |
| 14802 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator.
full(map(node.keyword), clone5(node.hiddenNames)); |
| 14803 IfStatement visitIfStatement(IfStatement node) => new IfStatement.full(map(nod
e.ifKeyword), map(node.leftParenthesis), clone4(node.condition), map(node.rightP
arenthesis), clone4(node.thenStatement), map(node.elseKeyword), clone4(node.else
Statement)); |
| 14804 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement
sClause.full(map(node.keyword), clone5(node.interfaces)); |
| 14805 ImportDirective visitImportDirective(ImportDirective node) => new ImportDirect
ive.full(clone4(node.documentationComment), clone5(node.metadata), map(node.keyw
ord), clone4(node.uri), map(node.asToken), clone4(node.prefix), clone5(node.comb
inators), map(node.semicolon)); |
| 14806 IndexExpression visitIndexExpression(IndexExpression node) { |
| 14807 Token period = map(node.period); |
| 14808 IndexExpression copy; |
| 14809 if (period == null) { |
| 14810 copy = new IndexExpression.forTarget_full(clone4(node.target), map(node.le
ftBracket), clone4(node.index), map(node.rightBracket)); |
| 14811 } else { |
| 14812 copy = new IndexExpression.forCascade_full(period, map(node.leftBracket),
clone4(node.index), map(node.rightBracket)); |
| 14813 } |
| 14814 copy.auxiliaryElements = node.auxiliaryElements; |
| 14815 copy.propagatedElement = node.propagatedElement; |
| 14816 copy.propagatedType = node.propagatedType; |
| 14817 copy.staticElement = node.staticElement; |
| 14818 copy.staticType = node.staticType; |
| 14819 return copy; |
| 14820 } |
| 14821 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp
ression node) { |
| 14822 InstanceCreationExpression copy = new InstanceCreationExpression.full(map(no
de.keyword), clone4(node.constructorName), clone4(node.argumentList)); |
| 14823 copy.propagatedType = node.propagatedType; |
| 14824 copy.staticElement = node.staticElement; |
| 14825 copy.staticType = node.staticType; |
| 14826 return copy; |
| 14827 } |
| 14828 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) { |
| 14829 IntegerLiteral copy = new IntegerLiteral.full(map(node.literal), node.value)
; |
| 14830 copy.propagatedType = node.propagatedType; |
| 14831 copy.staticType = node.staticType; |
| 14832 return copy; |
| 14833 } |
| 14834 InterpolationExpression visitInterpolationExpression(InterpolationExpression n
ode) => new InterpolationExpression.full(map(node.leftBracket), clone4(node.expr
ession), map(node.rightBracket)); |
| 14835 InterpolationString visitInterpolationString(InterpolationString node) => new
InterpolationString.full(map(node.contents), node.value); |
| 14836 IsExpression visitIsExpression(IsExpression node) { |
| 14837 IsExpression copy = new IsExpression.full(clone4(node.expression), map(node.
isOperator), map(node.notOperator), clone4(node.type)); |
| 14838 copy.propagatedType = node.propagatedType; |
| 14839 copy.staticType = node.staticType; |
| 14840 return copy; |
| 14841 } |
| 14842 Label visitLabel(Label node) => new Label.full(clone4(node.label), map(node.co
lon)); |
| 14843 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt
atement.full(clone5(node.labels), clone4(node.statement)); |
| 14844 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi
rective.full(clone4(node.documentationComment), clone5(node.metadata), map(node.
libraryToken), clone4(node.name), map(node.semicolon)); |
| 14845 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) { |
| 14846 LibraryIdentifier copy = new LibraryIdentifier.full(clone5(node.components))
; |
| 14847 copy.propagatedType = node.propagatedType; |
| 14848 copy.staticType = node.staticType; |
| 14849 return copy; |
| 14850 } |
| 14851 ListLiteral visitListLiteral(ListLiteral node) { |
| 14852 ListLiteral copy = new ListLiteral.full(map(node.constKeyword), clone4(node.
typeArguments), map(node.leftBracket), clone5(node.elements), map(node.rightBrac
ket)); |
| 14853 copy.propagatedType = node.propagatedType; |
| 14854 copy.staticType = node.staticType; |
| 14855 return copy; |
| 14856 } |
| 14857 MapLiteral visitMapLiteral(MapLiteral node) { |
| 14858 MapLiteral copy = new MapLiteral.full(map(node.constKeyword), clone4(node.ty
peArguments), map(node.leftBracket), clone5(node.entries), map(node.rightBracket
)); |
| 14859 copy.propagatedType = node.propagatedType; |
| 14860 copy.staticType = node.staticType; |
| 14861 return copy; |
| 14862 } |
| 14863 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn
try.full(clone4(node.key), map(node.separator), clone4(node.value)); |
| 14864 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method
Declaration.full(clone4(node.documentationComment), clone5(node.metadata), map(n
ode.externalKeyword), map(node.modifierKeyword), clone4(node.returnType), map(no
de.propertyKeyword), map(node.operatorKeyword), clone4(node.name), clone4(node.p
arameters), clone4(node.body)); |
| 14865 MethodInvocation visitMethodInvocation(MethodInvocation node) { |
| 14866 MethodInvocation copy = new MethodInvocation.full(clone4(node.target), map(n
ode.period), clone4(node.methodName), clone4(node.argumentList)); |
| 14867 copy.propagatedType = node.propagatedType; |
| 14868 copy.staticType = node.staticType; |
| 14869 return copy; |
| 14870 } |
| 14871 NamedExpression visitNamedExpression(NamedExpression node) { |
| 14872 NamedExpression copy = new NamedExpression.full(clone4(node.name), clone4(no
de.expression)); |
| 14873 copy.propagatedType = node.propagatedType; |
| 14874 copy.staticType = node.staticType; |
| 14875 return copy; |
| 14876 } |
| 14877 ASTNode visitNativeClause(NativeClause node) => new NativeClause.full(map(node
.keyword), clone4(node.name)); |
| 14878 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat
iveFunctionBody.full(map(node.nativeToken), clone4(node.stringLiteral), map(node
.semicolon)); |
| 14879 NullLiteral visitNullLiteral(NullLiteral node) { |
| 14880 NullLiteral copy = new NullLiteral.full(map(node.literal)); |
| 14881 copy.propagatedType = node.propagatedType; |
| 14882 copy.staticType = node.staticType; |
| 14883 return copy; |
| 14884 } |
| 14885 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n
ode) { |
| 14886 ParenthesizedExpression copy = new ParenthesizedExpression.full(map(node.lef
tParenthesis), clone4(node.expression), map(node.rightParenthesis)); |
| 14887 copy.propagatedType = node.propagatedType; |
| 14888 copy.staticType = node.staticType; |
| 14889 return copy; |
| 14890 } |
| 14891 PartDirective visitPartDirective(PartDirective node) { |
| 14892 PartDirective copy = new PartDirective.full(clone4(node.documentationComment
), clone5(node.metadata), map(node.partToken), clone4(node.uri), map(node.semico
lon)); |
| 14893 copy.element = node.element; |
| 14894 return copy; |
| 14895 } |
| 14896 PartOfDirective visitPartOfDirective(PartOfDirective node) { |
| 14897 PartOfDirective copy = new PartOfDirective.full(clone4(node.documentationCom
ment), clone5(node.metadata), map(node.partToken), map(node.ofToken), clone4(nod
e.libraryName), map(node.semicolon)); |
| 14898 copy.element = node.element; |
| 14899 return copy; |
| 14900 } |
| 14901 PostfixExpression visitPostfixExpression(PostfixExpression node) { |
| 14902 PostfixExpression copy = new PostfixExpression.full(clone4(node.operand), ma
p(node.operator)); |
| 14903 copy.propagatedType = node.propagatedType; |
| 14904 copy.staticType = node.staticType; |
| 14905 return copy; |
| 14906 } |
| 14907 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) { |
| 14908 PrefixedIdentifier copy = new PrefixedIdentifier.full(clone4(node.prefix), m
ap(node.period), clone4(node.identifier)); |
| 14909 copy.propagatedType = node.propagatedType; |
| 14910 copy.staticType = node.staticType; |
| 14911 return copy; |
| 14912 } |
| 14913 PrefixExpression visitPrefixExpression(PrefixExpression node) { |
| 14914 PrefixExpression copy = new PrefixExpression.full(map(node.operator), clone4
(node.operand)); |
| 14915 copy.propagatedElement = node.propagatedElement; |
| 14916 copy.propagatedType = node.propagatedType; |
| 14917 copy.staticElement = node.staticElement; |
| 14918 copy.staticType = node.staticType; |
| 14919 return copy; |
| 14920 } |
| 14921 PropertyAccess visitPropertyAccess(PropertyAccess node) { |
| 14922 PropertyAccess copy = new PropertyAccess.full(clone4(node.target), map(node.
operator), clone4(node.propertyName)); |
| 14923 copy.propagatedType = node.propagatedType; |
| 14924 copy.staticType = node.staticType; |
| 14925 return copy; |
| 14926 } |
| 14927 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec
tingConstructorInvocation node) { |
| 14928 RedirectingConstructorInvocation copy = new RedirectingConstructorInvocation
.full(map(node.keyword), map(node.period), clone4(node.constructorName), clone4(
node.argumentList)); |
| 14929 copy.staticElement = node.staticElement; |
| 14930 return copy; |
| 14931 } |
| 14932 RethrowExpression visitRethrowExpression(RethrowExpression node) { |
| 14933 RethrowExpression copy = new RethrowExpression.full(map(node.keyword)); |
| 14934 copy.propagatedType = node.propagatedType; |
| 14935 copy.staticType = node.staticType; |
| 14936 return copy; |
| 14937 } |
| 14938 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem
ent.full(map(node.keyword), clone4(node.expression), map(node.semicolon)); |
| 14939 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag.full(map(node.script
Tag)); |
| 14940 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator.
full(map(node.keyword), clone5(node.shownNames)); |
| 14941 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) =
> new SimpleFormalParameter.full(clone4(node.documentationComment), clone5(node.
metadata), map(node.keyword), clone4(node.type), clone4(node.identifier)); |
| 14942 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) { |
| 14943 SimpleIdentifier copy = new SimpleIdentifier.full(map(node.token)); |
| 14944 copy.auxiliaryElements = node.auxiliaryElements; |
| 14945 copy.propagatedElement = node.propagatedElement; |
| 14946 copy.propagatedType = node.propagatedType; |
| 14947 copy.staticElement = node.staticElement; |
| 14948 copy.staticType = node.staticType; |
| 14949 return copy; |
| 14950 } |
| 14951 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) { |
| 14952 SimpleStringLiteral copy = new SimpleStringLiteral.full(map(node.literal), n
ode.value); |
| 14953 copy.propagatedType = node.propagatedType; |
| 14954 copy.staticType = node.staticType; |
| 14955 return copy; |
| 14956 } |
| 14957 StringInterpolation visitStringInterpolation(StringInterpolation node) { |
| 14958 StringInterpolation copy = new StringInterpolation.full(clone5(node.elements
)); |
| 14959 copy.propagatedType = node.propagatedType; |
| 14960 copy.staticType = node.staticType; |
| 14961 return copy; |
| 14962 } |
| 14963 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv
ocation node) { |
| 14964 SuperConstructorInvocation copy = new SuperConstructorInvocation.full(map(no
de.keyword), map(node.period), clone4(node.constructorName), clone4(node.argumen
tList)); |
| 14965 copy.staticElement = node.staticElement; |
| 14966 return copy; |
| 14967 } |
| 14968 SuperExpression visitSuperExpression(SuperExpression node) { |
| 14969 SuperExpression copy = new SuperExpression.full(map(node.keyword)); |
| 14970 copy.propagatedType = node.propagatedType; |
| 14971 copy.staticType = node.staticType; |
| 14972 return copy; |
| 14973 } |
| 14974 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase.full(clone5(node
.labels), map(node.keyword), clone4(node.expression), map(node.colon), clone5(no
de.statements)); |
| 14975 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault.full
(clone5(node.labels), map(node.keyword), map(node.colon), clone5(node.statements
)); |
| 14976 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem
ent.full(map(node.keyword), map(node.leftParenthesis), clone4(node.expression),
map(node.rightParenthesis), map(node.leftBracket), clone5(node.members), map(nod
e.rightBracket)); |
| 14977 ASTNode visitSymbolLiteral(SymbolLiteral node) { |
| 14978 SymbolLiteral copy = new SymbolLiteral.full(map(node.poundSign), map2(node.c
omponents)); |
| 14979 copy.propagatedType = node.propagatedType; |
| 14980 copy.staticType = node.staticType; |
| 14981 return copy; |
| 14982 } |
| 14983 ThisExpression visitThisExpression(ThisExpression node) { |
| 14984 ThisExpression copy = new ThisExpression.full(map(node.keyword)); |
| 14985 copy.propagatedType = node.propagatedType; |
| 14986 copy.staticType = node.staticType; |
| 14987 return copy; |
| 14988 } |
| 14989 ThrowExpression visitThrowExpression(ThrowExpression node) { |
| 14990 ThrowExpression copy = new ThrowExpression.full(map(node.keyword), clone4(no
de.expression)); |
| 14991 copy.propagatedType = node.propagatedType; |
| 14992 copy.staticType = node.staticType; |
| 14993 return copy; |
| 14994 } |
| 14995 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD
eclaration node) => new TopLevelVariableDeclaration.full(clone4(node.documentati
onComment), clone5(node.metadata), clone4(node.variables), map(node.semicolon)); |
| 14996 TryStatement visitTryStatement(TryStatement node) => new TryStatement.full(map
(node.tryKeyword), clone4(node.body), clone5(node.catchClauses), map(node.finall
yKeyword), clone4(node.finallyBlock)); |
| 14997 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum
entList.full(map(node.leftBracket), clone5(node.arguments), map(node.rightBracke
t)); |
| 14998 TypeName visitTypeName(TypeName node) { |
| 14999 TypeName copy = new TypeName.full(clone4(node.name), clone4(node.typeArgumen
ts)); |
| 15000 copy.type = node.type; |
| 15001 return copy; |
| 15002 } |
| 15003 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter.full
(clone4(node.documentationComment), clone5(node.metadata), clone4(node.name), ma
p(node.keyword), clone4(node.bound)); |
| 15004 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa
rameterList.full(map(node.leftBracket), clone5(node.typeParameters), map(node.ri
ghtBracket)); |
| 15005 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new
VariableDeclaration.full(null, clone5(node.metadata), clone4(node.name), map(nod
e.equals), clone4(node.initializer)); |
| 15006 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n
ode) => new VariableDeclarationList.full(null, clone5(node.metadata), map(node.k
eyword), clone4(node.type), clone5(node.variables)); |
| 15007 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara
tionStatement node) => new VariableDeclarationStatement.full(clone4(node.variabl
es), map(node.semicolon)); |
| 15008 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement.
full(map(node.keyword), map(node.leftParenthesis), clone4(node.condition), map(n
ode.rightParenthesis), clone4(node.body)); |
| 15009 WithClause visitWithClause(WithClause node) => new WithClause.full(map(node.wi
thKeyword), clone5(node.mixinTypes)); |
| 15010 ASTNode clone4(ASTNode node) { |
| 15011 if (node == null) { |
| 15012 return null; |
| 15013 } |
| 15014 if (identical(node, _oldNode)) { |
| 15015 return _newNode as ASTNode; |
| 15016 } |
| 15017 return node.accept(this) as ASTNode; |
| 15018 } |
| 15019 List clone5(NodeList nodes) { |
| 15020 List clonedNodes = new List(); |
| 15021 for (ASTNode node in nodes) { |
| 15022 clonedNodes.add(clone4(node)); |
| 15023 } |
| 15024 return clonedNodes; |
| 15025 } |
| 15026 Token map(Token oldToken) { |
| 15027 if (oldToken == null) { |
| 15028 return null; |
| 15029 } |
| 15030 return _tokenMap.get(oldToken); |
| 15031 } |
| 15032 List<Token> map2(List<Token> oldTokens) { |
| 15033 List<Token> newTokens = new List<Token>(oldTokens.length); |
| 15034 for (int index = 0; index < newTokens.length; index++) { |
| 15035 newTokens[index] = map(oldTokens[index]); |
| 15036 } |
| 15037 return newTokens; |
| 15038 } |
| 15039 } |
| 15040 /** |
| 14628 * Traverse the AST from initial child node to successive parents, building a co
llection of local | 15041 * Traverse the AST from initial child node to successive parents, building a co
llection of local |
| 14629 * variable and parameter names visible to the initial child node. In case of na
me shadowing, the | 15042 * variable and parameter names visible to the initial child node. In case of na
me shadowing, the |
| 14630 * first name seen is the most specific one so names are not redefined. | 15043 * first name seen is the most specific one so names are not redefined. |
| 14631 * | 15044 * |
| 14632 * Completion test code coverage is 95%. The two basic blocks that are not execu
ted cannot be | 15045 * Completion test code coverage is 95%. The two basic blocks that are not execu
ted cannot be |
| 14633 * executed. They are included for future reference. | 15046 * executed. They are included for future reference. |
| 14634 * | 15047 * |
| 14635 * @coverage com.google.dart.engine.services.completion | 15048 * @coverage com.google.dart.engine.services.completion |
| 14636 */ | 15049 */ |
| 14637 class ScopedNameFinder extends GeneralizingASTVisitor<Object> { | 15050 class ScopedNameFinder extends GeneralizingASTVisitor<Object> { |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14891 void operator[]=(int index, E node) { | 15304 void operator[]=(int index, E node) { |
| 14892 if (index < 0 || index >= _elements.length) { | 15305 if (index < 0 || index >= _elements.length) { |
| 14893 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); | 15306 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); |
| 14894 } | 15307 } |
| 14895 _elements[index] as E; | 15308 _elements[index] as E; |
| 14896 owner.becomeParentOf(node); | 15309 owner.becomeParentOf(node); |
| 14897 _elements[index] = node; | 15310 _elements[index] = node; |
| 14898 } | 15311 } |
| 14899 int get length => _elements.length; | 15312 int get length => _elements.length; |
| 14900 } | 15313 } |
| OLD | NEW |