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

Side by Side Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 2722153003: Always parse 'x.y' as a prefixed identifier. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_fasta_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6339 matching lines...) Expand 10 before | Expand all | Expand 10 after
6350 expression = astFactory.functionExpressionInvocation( 6350 expression = astFactory.functionExpressionInvocation(
6351 expression, typeArguments, argumentList); 6351 expression, typeArguments, argumentList);
6352 } 6352 }
6353 if (!primaryAllowed) { 6353 if (!primaryAllowed) {
6354 isOptional = false; 6354 isOptional = false;
6355 } 6355 }
6356 } 6356 }
6357 Expression selectorExpression = parseAssignableSelector( 6357 Expression selectorExpression = parseAssignableSelector(
6358 expression, isOptional || (expression is PrefixedIdentifier)); 6358 expression, isOptional || (expression is PrefixedIdentifier));
6359 if (identical(selectorExpression, expression)) { 6359 if (identical(selectorExpression, expression)) {
6360 if (!isOptional && (expression is PrefixedIdentifier)) {
6361 PrefixedIdentifier identifier = expression as PrefixedIdentifier;
6362 expression = astFactory.propertyAccess(
6363 identifier.prefix, identifier.period, identifier.identifier);
6364 }
6365 return expression; 6360 return expression;
6366 } 6361 }
6367 expression = selectorExpression; 6362 expression = selectorExpression;
6368 isOptional = true; 6363 isOptional = true;
6369 } 6364 }
6370 } 6365 }
6371 6366
6372 /** 6367 /**
6373 * Parse a block when we need to check for an open curly brace and recover 6368 * Parse a block when we need to check for an open curly brace and recover
6374 * when there isn't one. Return the block that was parsed. 6369 * when there isn't one. Return the block that was parsed.
(...skipping 2124 matching lines...) Expand 10 before | Expand all | Expand 10 after
8499 */ 8494 */
8500 Parser_SyntheticKeywordToken(Keyword keyword, int offset) 8495 Parser_SyntheticKeywordToken(Keyword keyword, int offset)
8501 : super(keyword, offset); 8496 : super(keyword, offset);
8502 8497
8503 @override 8498 @override
8504 int get length => 0; 8499 int get length => 0;
8505 8500
8506 @override 8501 @override
8507 Token copy() => new Parser_SyntheticKeywordToken(keyword, offset); 8502 Token copy() => new Parser_SyntheticKeywordToken(keyword, offset);
8508 } 8503 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_fasta_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698