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

Unified Diff: pkg/compiler/lib/src/scanner/scanner.dart

Issue 1225273002: Remove flag for enabling null-aware operators. They are now on by default. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months 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
« no previous file with comments | « pkg/compiler/lib/src/scanner/listener.dart ('k') | pkg/compiler/lib/src/scanner/scanner_task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/scanner/scanner.dart
diff --git a/pkg/compiler/lib/src/scanner/scanner.dart b/pkg/compiler/lib/src/scanner/scanner.dart
index 65db47ebbbd0a91bd8e9c5266e57c5d5ad18479f..d9ab3123aa52e67f42569b3cff92ab92bb2bd7fb 100644
--- a/pkg/compiler/lib/src/scanner/scanner.dart
+++ b/pkg/compiler/lib/src/scanner/scanner.dart
@@ -8,13 +8,11 @@ abstract class Scanner {
Token tokenize();
factory Scanner(SourceFile file,
- {bool includeComments: false, bool enableNullAwareOperators: false}) {
+ {bool includeComments: false}) {
if (file is Utf8BytesSourceFile) {
- return new Utf8BytesScanner(file, includeComments: includeComments,
- enableNullAwareOperators: enableNullAwareOperators);
+ return new Utf8BytesScanner(file, includeComments: includeComments);
} else {
- return new StringScanner(file, includeComments: includeComments,
- enableNullAwareOperators: enableNullAwareOperators);
+ return new StringScanner(file, includeComments: includeComments);
}
}
}
@@ -23,7 +21,6 @@ abstract class AbstractScanner implements Scanner {
// TODO(ahe): Move this class to implementation.
final bool includeComments;
- final bool enableNullAwareOperators;
/**
* The string offset for the next token that will be created.
@@ -58,7 +55,7 @@ abstract class AbstractScanner implements Scanner {
final List<int> lineStarts = <int>[0];
AbstractScanner(
- this.file, this.includeComments, this.enableNullAwareOperators) {
+ this.file, this.includeComments) {
this.tail = this.tokens;
}
@@ -458,27 +455,9 @@ abstract class AbstractScanner implements Scanner {
// ? ?. ?? ??=
next = advance();
if (identical(next, $QUESTION)) {
- if (enableNullAwareOperators) {
- return select($EQ, QUESTION_QUESTION_EQ_INFO, QUESTION_QUESTION_INFO);
- } else {
- next = advance();
- PrecedenceInfo info;
- if (identical(next, $EQ)) {
- info = QUESTION_QUESTION_EQ_INFO;
- next = advance();
- } else {
- info = QUESTION_QUESTION_INFO;
- }
- appendErrorToken(new UnsupportedNullAwareToken(info.value, tokenStart));
- return next;
- }
+ return select($EQ, QUESTION_QUESTION_EQ_INFO, QUESTION_QUESTION_INFO);
} else if (identical(next, $PERIOD)) {
- if (enableNullAwareOperators) {
- appendPrecedenceToken(QUESTION_PERIOD_INFO);
- } else {
- appendErrorToken(new UnsupportedNullAwareToken(
- QUESTION_PERIOD_INFO.value, tokenStart));
- }
+ appendPrecedenceToken(QUESTION_PERIOD_INFO);
return advance();
} else {
appendPrecedenceToken(QUESTION_INFO);
« no previous file with comments | « pkg/compiler/lib/src/scanner/listener.dart ('k') | pkg/compiler/lib/src/scanner/scanner_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698