Chromium Code Reviews| Index: dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart |
| diff --git a/dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart b/dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart |
| index e426b8e27ea376e875f045363b428ae456be485f..2cdc13d08590efe5a5a5d9fffa6f41faf6680732 100644 |
| --- a/dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart |
| +++ b/dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart |
| @@ -605,6 +605,8 @@ class ParserError { |
| toString() => reason; |
| } |
| +typedef int IdGenerator(); |
| + |
| /** |
| * A parser event listener designed to work with [PartialParser]. It |
| * builds elements representing the top-level declarations found in |
| @@ -612,7 +614,7 @@ class ParserError { |
| * [compilationUnitElement]. |
| */ |
| class ElementListener extends Listener { |
| - Function idGenerator; |
| + final IdGenerator idGenerator; |
| final DiagnosticListener listener; |
| final CompilationUnitElement compilationUnitElement; |
| final StringValidator stringValidator; |
| @@ -623,10 +625,9 @@ class ElementListener extends Listener { |
| Link<MetadataAnnotation> metadata = const Link<MetadataAnnotation>(); |
| ElementListener(DiagnosticListener listener, |
| - CompilationUnitElement this.compilationUnitElement, |
| - int idGenerator()) |
| + this.compilationUnitElement, |
| + this.idGenerator) |
| : this.listener = listener, |
| - this.idGenerator = idGenerator, |
| stringValidator = new StringValidator(listener), |
| interpolationScope = const Link<StringQuoting>(); |
| @@ -791,6 +792,7 @@ class ElementListener extends Listener { |
| pushElement(new PartialClassElement( |
| name.source, interfaceKeyword, endToken, compilationUnitElement, id)); |
| rejectBuiltInIdentifier(name); |
| + listener.onDeprecatedFeature(interfaceKeyword, 'interface declarations'); |
| } |
| void endFunctionTypeAlias(Token typedefKeyword, Token endToken) { |
| @@ -1007,6 +1009,7 @@ class ElementListener extends Listener { |
| void addScriptTag(ScriptTag tag) { |
| // TODO(ahe): Remove this method. |
|
ngeoffray
2012/11/15 10:34:02
Move this comment before the declaration of the me
ahe
2012/11/16 07:07:36
Done.
|
| + listener.onDeprecatedFeature(tag, '# tags'); |
| addLibraryTag(tag.toLibraryTag()); |
| } |
| @@ -1338,6 +1341,9 @@ class NodeListener extends ElementListener { |
| NodeList arguments = new NodeList.singleton(argument); |
| pushNode(new Send(receiver, new Operator(token), arguments)); |
| } |
| + if (identical(tokenString, '===') || identical(tokenString, '!==')) { |
| + listener.onDeprecatedFeature(token, tokenString); |
| + } |
| } |
| void beginCascade(Token token) { |