Index: pkg/front_end/lib/src/fasta/parser/parser.dart |
diff --git a/pkg/front_end/lib/src/fasta/parser/parser.dart b/pkg/front_end/lib/src/fasta/parser/parser.dart |
index 19512820017d87d353339ceba1ae7bad30986160..0ea4a4a49bbe8622e6dc6300b4a00576f262c777 100644 |
--- a/pkg/front_end/lib/src/fasta/parser/parser.dart |
+++ b/pkg/front_end/lib/src/fasta/parser/parser.dart |
@@ -478,11 +478,13 @@ class Parser { |
// TODO(ahe): Validate that there are formal parameters if void. |
token = parseReturnTypeOpt(token); |
Token thisKeyword = null; |
+ Token period = null; |
if (optional('this', token)) { |
thisKeyword = token; |
+ period = token.next; |
Paul Berry
2017/02/22 20:41:09
This seems problematic for error recovery. If the
scheglov
2017/02/23 06:43:50
This is the pattern that is used everywhere else i
ahe
2017/02/23 16:27:11
I agree that it is a problem for error recovery.
|
// TODO(ahe): Validate field initializers are only used in |
// constructors, and not for function-typed arguments. |
- token = expect('.', token.next); |
+ token = expect('.', period); |
} |
token = parseIdentifier(token); |
if (optional('(', token)) { |
@@ -510,7 +512,7 @@ class Parser { |
equal, ErrorKind.PositionalParameterWithEquals); |
} |
} |
- listener.endFormalParameter(thisKeyword); |
+ listener.endFormalParameter(thisKeyword, period); |
ahe
2017/02/23 16:27:11
This isn't necessary. The period can be found with
|
return token; |
} |