Chromium Code Reviews| Index: pkg/analyzer/lib/src/summary/summarize_ast.dart |
| diff --git a/pkg/analyzer/lib/src/summary/summarize_ast.dart b/pkg/analyzer/lib/src/summary/summarize_ast.dart |
| index 2ca188cf564af7ee1a547cf7de40862e2bbb3e31..2ac4cd391bea5ecc24c42de7697f3cd2d0e6c9ac 100644 |
| --- a/pkg/analyzer/lib/src/summary/summarize_ast.dart |
| +++ b/pkg/analyzer/lib/src/summary/summarize_ast.dart |
| @@ -251,8 +251,8 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor { |
| final List<UnlinkedTypedefBuilder> typedefs = <UnlinkedTypedefBuilder>[]; |
| /** |
| - * List of objects which should be written to [UnlinkedUnit.variables], |
| - * [UnlinkedClass.fields] or [UnlinkedExecutable.localVariables]. |
| + * List of objects which should be written to [UnlinkedUnit.variables] or |
| + * [UnlinkedClass.fields]. |
| */ |
| List<UnlinkedVariableBuilder> variables = <UnlinkedVariableBuilder>[]; |
| @@ -559,36 +559,6 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor { |
| } |
| /** |
| - * Serialize the given [declaredIdentifier] into [UnlinkedVariable], and |
| - * store it in [variables]. |
| - */ |
| - void serializeDeclaredIdentifier( |
| - AstNode scopeNode, |
| - Comment documentationComment, |
| - NodeList<Annotation> annotations, |
| - bool isFinal, |
| - bool isConst, |
| - TypeAnnotation type, |
| - bool assignPropagatedTypeSlot, |
| - SimpleIdentifier declaredIdentifier) { |
| - UnlinkedVariableBuilder b = new UnlinkedVariableBuilder(); |
| - b.isFinal = isFinal; |
| - b.isConst = isConst; |
| - b.name = declaredIdentifier.name; |
| - b.nameOffset = declaredIdentifier.offset; |
| - b.type = serializeTypeName(type); |
| - b.documentationComment = serializeDocumentation(documentationComment); |
| - b.annotations = serializeAnnotations(annotations); |
| - b.codeRange = serializeCodeRange(declaredIdentifier); |
| - if (assignPropagatedTypeSlot) { |
| - b.propagatedTypeSlot = assignSlot(); |
| - } |
| - b.visibleOffset = scopeNode?.offset; |
| - b.visibleLength = scopeNode?.length; |
| - this.variables.add(b); |
| - } |
| - |
| - /** |
| * Serialize a [Comment] node into an [UnlinkedDocumentationComment] object. |
| */ |
| UnlinkedDocumentationCommentBuilder serializeDocumentation( |
| @@ -734,12 +704,10 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor { |
| } |
| List<UnlinkedExecutableBuilder> oldExecutables = executables; |
| List<UnlinkedLabelBuilder> oldLabels = labels; |
| - List<UnlinkedVariableBuilder> oldVariables = variables; |
| Map<int, int> oldLocalClosureIndexMap = _localClosureIndexMap; |
| bool oldSerializeClosureBodyExprs = _serializeClosureBodyExprs; |
| executables = <UnlinkedExecutableBuilder>[]; |
| labels = <UnlinkedLabelBuilder>[]; |
| - variables = <UnlinkedVariableBuilder>[]; |
| _localClosureIndexMap = <int, int>{}; |
| _serializeClosureBodyExprs = serializeBodyExpr; |
| if (initializers != null) { |
| @@ -763,11 +731,9 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor { |
| } |
| b.localFunctions = executables; |
| b.localLabels = labels; |
| - b.localVariables = variables; |
| Map<int, int> localClosureIndexMap = _localClosureIndexMap; |
| executables = oldExecutables; |
| labels = oldLabels; |
| - variables = oldVariables; |
| _localClosureIndexMap = oldLocalClosureIndexMap; |
| _serializeClosureBodyExprs = oldSerializeClosureBodyExprs; |
| return localClosureIndexMap; |
| @@ -1002,7 +968,6 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor { |
| * in [this.variables]. |
| */ |
| void serializeVariables( |
| - AstNode scopeNode, |
| VariableDeclarationList variables, |
| bool isDeclaredStatic, |
| Comment documentationComment, |
| @@ -1040,8 +1005,6 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor { |
| (variable.initializer != null || !isSemanticallyStatic)) { |
| b.inferredTypeSlot = assignSlot(); |
| } |
| - b.visibleOffset = scopeNode?.offset; |
| - b.visibleLength = scopeNode?.length; |
| this.variables.add(b); |
| } |
| } |
| @@ -1055,21 +1018,6 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor { |
| } |
| @override |
| - void visitCatchClause(CatchClause node) { |
| - SimpleIdentifier exception = node.exceptionParameter; |
| - SimpleIdentifier st = node.stackTraceParameter; |
| - if (exception != null) { |
| - serializeDeclaredIdentifier( |
| - node, null, null, false, false, node.exceptionType, false, exception); |
| - } |
| - if (st != null) { |
| - serializeDeclaredIdentifier( |
| - node, null, null, false, false, null, false, st); |
| - } |
| - super.visitCatchClause(node); |
| - } |
| - |
| - @override |
| void visitClassDeclaration(ClassDeclaration node) { |
| TypeName superclass = |
| node.extendsClause == null ? null : node.extendsClause.superclass; |
| @@ -1207,7 +1155,7 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor { |
| @override |
| void visitFieldDeclaration(FieldDeclaration node) { |
| - serializeVariables(null, node.fields, node.staticKeyword != null, |
| + serializeVariables(node.fields, node.staticKeyword != null, |
| node.documentationComment, node.metadata, true); |
| } |
| @@ -1227,32 +1175,6 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor { |
| } |
| @override |
| - void visitForEachStatement(ForEachStatement node) { |
| - DeclaredIdentifier loopVariable = node.loopVariable; |
| - if (loopVariable != null) { |
| - serializeDeclaredIdentifier( |
| - node, |
| - loopVariable.documentationComment, |
| - loopVariable.metadata, |
| - loopVariable.isFinal, |
| - loopVariable.isConst, |
| - loopVariable.type, |
| - true, |
| - loopVariable.identifier); |
| - } |
| - super.visitForEachStatement(node); |
| - } |
| - |
| - @override |
| - void visitForStatement(ForStatement node) { |
| - VariableDeclarationList declaredVariables = node.variables; |
| - if (declaredVariables != null) { |
| - serializeVariables(node, declaredVariables, false, null, null, false); |
| - } |
| - super.visitForStatement(node); |
| - } |
| - |
| - @override |
| void visitFunctionDeclaration(FunctionDeclaration node) { |
| executables.add(serializeExecutable( |
| node, |
| @@ -1450,8 +1372,8 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor { |
| @override |
| void visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { |
| - serializeVariables(null, node.variables, false, node.documentationComment, |
| - node.metadata, false); |
| + serializeVariables( |
| + node.variables, false, node.documentationComment, node.metadata, false); |
| } |
| @override |
| @@ -1469,8 +1391,7 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor { |
| @override |
| void visitVariableDeclarationStatement(VariableDeclarationStatement node) { |
| - serializeVariables( |
| - enclosingBlock, node.variables, false, null, null, false); |
| +// serializeVariables(node.variables, false, null, null, false); |
|
Paul Berry
2017/06/29 21:34:33
Should we just remove this override entirely?
scheglov
2017/06/29 21:39:54
We cannot do this.
If there are function expressio
|
| } |
| /** |