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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart

Issue 11416004: Reject deprecated language features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: abstract class in resolver test Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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..783be1ce0aab47f07f517ba3a52a39943d80c74d 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) {
@@ -1005,8 +1007,9 @@ class ElementListener extends Listener {
metadata = metadata.prepend(annotation);
}
+ // TODO(ahe): Remove this method.
void addScriptTag(ScriptTag tag) {
- // TODO(ahe): Remove this method.
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698