Index: pkg/analyzer/lib/src/fasta/ast_builder.dart |
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart |
index 85e6241043014e0c61a35ca2336a9dd7ea812de3..8baab7cbe24322f052c5fe9e8a7ebca8114b13fd 100644 |
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart |
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart |
@@ -416,10 +416,6 @@ class AstBuilder extends ScopeListener { |
elsePart)); |
} |
- void prepareInitializers() { |
- debugEvent("prepareInitializers"); |
- } |
- |
void handleNoInitializers() { |
debugEvent("NoInitializers"); |
push(NullValue.ConstructorInitializerSeparator); |
@@ -541,8 +537,12 @@ class AstBuilder extends ScopeListener { |
internalError("unhandled identifier: ${node.runtimeType}"); |
} |
push(variable); |
- scope[variable.name.name] = variable.name.staticElement = |
- new AnalyzerLocalVariableElemment(variable); |
+ scope.declare( |
+ variable.name.name, |
+ variable.name.staticElement = |
+ new AnalyzerLocalVariableElemment(variable), |
+ nameToken.charOffset, |
+ uri); |
} |
void endVariablesDeclaration(int count, Token endToken) { |
@@ -901,8 +901,11 @@ class AstBuilder extends ScopeListener { |
} |
if (name != null) { |
- scope[name.name] = |
- name.staticElement = new AnalyzerParameterElement(node); |
+ scope.declare( |
+ name.name, |
+ name.staticElement = new AnalyzerParameterElement(node), |
+ name.offset, |
+ uri); |
} |
push(node); |
} |
@@ -948,7 +951,11 @@ class AstBuilder extends ScopeListener { |
parameters: formalParameters); |
} |
- scope[name.name] = name.staticElement = new AnalyzerParameterElement(node); |
+ scope.declare( |
+ name.name, |
+ name.staticElement = new AnalyzerParameterElement(node), |
+ name.offset, |
+ uri); |
push(node); |
} |
@@ -1987,6 +1994,12 @@ class AstBuilder extends ScopeListener { |
} |
return firstToken; |
} |
+ |
+ @override |
+ void addCompileTimeErrorFromMessage(FastaMessage message) { |
+ library.addCompileTimeError(message.charOffset, message.message, |
+ fileUri: message.uri); |
+ } |
} |
/// Data structure placed on the stack to represent a class body. |