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

Unified Diff: pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart

Issue 2710973002: Revert "Add support for the new function-type syntax." (Closed)
Patch Set: Created 3 years, 10 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/front_end/lib/src/fasta/parser/parser.dart ('k') | pkg/front_end/lib/src/fasta/scanner/keyword.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
diff --git a/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart b/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
index e1dd5f4d2eab75789939f0072a15dbe7e28f65c1..f4de827c7fa5399a8d90e8207653e0b2503b8d77 100644
--- a/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
+++ b/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
@@ -241,7 +241,7 @@ abstract class AbstractScanner implements Scanner {
if (($A <= next && next <= $Z) ||
identical(next, $_) ||
identical(next, $$)) {
- return tokenizeKeywordOrIdentifier(next, true);
+ return tokenizeIdentifier(next, scanOffset, true);
}
if (identical(next, $LT)) {
@@ -808,16 +808,6 @@ abstract class AbstractScanner implements Scanner {
int tokenizeKeywordOrIdentifier(int next, bool allowDollar) {
KeywordState state = KeywordState.KEYWORD_STATE;
int start = scanOffset;
- // We allow a leading capital character.
- if ($A <= next && next <= $Z) {
- state = state.nextCapital(next);
- next = advance();
- } else if ($a <= next && next <= $z){
- // Do the first next call outside the loop to avoid an additional test
- // and to make the loop monomorphic.
- state = state.next(next);
- next = advance();
- }
while (state != null && $a <= next && next <= $z) {
state = state.next(next);
next = advance();
@@ -955,11 +945,12 @@ abstract class AbstractScanner implements Scanner {
int tokenizeInterpolatedIdentifier(int next) {
appendPrecedenceToken(STRING_INTERPOLATION_IDENTIFIER_INFO);
- if ($a <= next && next <= $z ||
- $A <= next && next <= $Z ||
- identical(next, $_)) {
+ if ($a <= next && next <= $z) {
beginToken(); // The identifier starts here.
next = tokenizeKeywordOrIdentifier(next, false);
+ } else if (($A <= next && next <= $Z) || identical(next, $_)) {
+ beginToken(); // The identifier starts here.
+ next = tokenizeIdentifier(next, scanOffset, false);
} else {
unterminated(r'$', shouldAdvance: false);
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/parser.dart ('k') | pkg/front_end/lib/src/fasta/scanner/keyword.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698