OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer.src.generated.parser; | 5 library analyzer.src.generated.parser; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import "dart:math" as math; | 8 import "dart:math" as math; |
9 | 9 |
10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 4134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4145 if (_matchesKeyword(Keyword.COVARIANT)) { | 4145 if (_matchesKeyword(Keyword.COVARIANT)) { |
4146 // Check to ensure that 'covariant' isn't being used as the parameter name
. | 4146 // Check to ensure that 'covariant' isn't being used as the parameter name
. |
4147 Token next = _peek(); | 4147 Token next = _peek(); |
4148 if (_tokenMatchesKeyword(next, Keyword.FINAL) || | 4148 if (_tokenMatchesKeyword(next, Keyword.FINAL) || |
4149 _tokenMatchesKeyword(next, Keyword.CONST) || | 4149 _tokenMatchesKeyword(next, Keyword.CONST) || |
4150 _tokenMatchesKeyword(next, Keyword.VAR) || | 4150 _tokenMatchesKeyword(next, Keyword.VAR) || |
4151 _tokenMatchesKeyword(next, Keyword.THIS) || | 4151 _tokenMatchesKeyword(next, Keyword.THIS) || |
4152 _tokenMatchesIdentifier(next)) { | 4152 _tokenMatchesIdentifier(next)) { |
4153 covariantKeyword = getAndAdvance(); | 4153 covariantKeyword = getAndAdvance(); |
4154 } | 4154 } |
4155 while (_matchesKeyword(Keyword.COVARIANT)) { | |
4156 _reportErrorForCurrentToken( | |
4157 ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]); | |
4158 _advance(); | |
4159 } | |
4160 } | 4155 } |
4161 FinalConstVarOrType holder = parseFinalConstVarOrType(!inFunctionType, | 4156 FinalConstVarOrType holder = parseFinalConstVarOrType(!inFunctionType, |
4162 inFunctionType: inFunctionType); | 4157 inFunctionType: inFunctionType); |
4163 Token thisKeyword = null; | 4158 Token thisKeyword = null; |
4164 Token period = null; | 4159 Token period = null; |
4165 if (_matchesKeyword(Keyword.THIS)) { | 4160 if (_matchesKeyword(Keyword.THIS)) { |
4166 thisKeyword = getAndAdvance(); | 4161 thisKeyword = getAndAdvance(); |
4167 period = _expect(TokenType.PERIOD); | 4162 period = _expect(TokenType.PERIOD); |
4168 } | 4163 } |
4169 if (!_matchesIdentifier() && inFunctionType) { | 4164 if (!_matchesIdentifier() && inFunctionType) { |
(...skipping 4340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8510 */ | 8505 */ |
8511 Parser_SyntheticKeywordToken(Keyword keyword, int offset) | 8506 Parser_SyntheticKeywordToken(Keyword keyword, int offset) |
8512 : super(keyword, offset); | 8507 : super(keyword, offset); |
8513 | 8508 |
8514 @override | 8509 @override |
8515 int get length => 0; | 8510 int get length => 0; |
8516 | 8511 |
8517 @override | 8512 @override |
8518 Token copy() => new Parser_SyntheticKeywordToken(keyword, offset); | 8513 Token copy() => new Parser_SyntheticKeywordToken(keyword, offset); |
8519 } | 8514 } |
OLD | NEW |