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

Side by Side Diff: pkg/compiler/lib/src/scanner/parser.dart

Issue 1151163004: Implementation of null-aware operators. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of scanner; 5 part of scanner;
6 6
7 class FormalParameterType { 7 class FormalParameterType {
8 final String type; 8 final String type;
9 const FormalParameterType(this.type); 9 const FormalParameterType(this.type);
10 bool get isRequired => this == REQUIRED; 10 bool get isRequired => this == REQUIRED;
(...skipping 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after
1782 if (!allowCascades) { 1782 if (!allowCascades) {
1783 return token; 1783 return token;
1784 } 1784 }
1785 token = parseCascadeExpression(token); 1785 token = parseCascadeExpression(token);
1786 } else if (identical(tokenLevel, ASSIGNMENT_PRECEDENCE)) { 1786 } else if (identical(tokenLevel, ASSIGNMENT_PRECEDENCE)) {
1787 // Right associative, so we recurse at the same precedence 1787 // Right associative, so we recurse at the same precedence
1788 // level. 1788 // level.
1789 token = parsePrecedenceExpression(token.next, level, allowCascades); 1789 token = parsePrecedenceExpression(token.next, level, allowCascades);
1790 listener.handleAssignmentExpression(operator); 1790 listener.handleAssignmentExpression(operator);
1791 } else if (identical(tokenLevel, POSTFIX_PRECEDENCE)) { 1791 } else if (identical(tokenLevel, POSTFIX_PRECEDENCE)) {
1792 if (identical(info, PERIOD_INFO)) { 1792 if (identical(info, PERIOD_INFO) ||
1793 identical(info, QUESTION_PERIOD_INFO)) {
1793 // Left associative, so we recurse at the next higher 1794 // Left associative, so we recurse at the next higher
1794 // precedence level. However, POSTFIX_PRECEDENCE is the 1795 // precedence level. However, POSTFIX_PRECEDENCE is the
1795 // highest level, so we just call parseUnaryExpression 1796 // highest level, so we just call parseUnaryExpression
1796 // directly. 1797 // directly.
1797 token = parseUnaryExpression(token.next, allowCascades); 1798 token = parseUnaryExpression(token.next, allowCascades);
1798 listener.handleBinaryExpression(operator); 1799 listener.handleBinaryExpression(operator);
1799 } else if ((identical(info, OPEN_PAREN_INFO)) || 1800 } else if ((identical(info, OPEN_PAREN_INFO)) ||
1800 (identical(info, OPEN_SQUARE_BRACKET_INFO))) { 1801 (identical(info, OPEN_SQUARE_BRACKET_INFO))) {
1801 token = parseArgumentOrIndexStar(token); 1802 token = parseArgumentOrIndexStar(token);
1802 } else if ((identical(info, PLUS_PLUS_INFO)) || 1803 } else if ((identical(info, PLUS_PLUS_INFO)) ||
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 } 2664 }
2664 listener.handleContinueStatement(hasTarget, continueKeyword, token); 2665 listener.handleContinueStatement(hasTarget, continueKeyword, token);
2665 return expectSemicolon(token); 2666 return expectSemicolon(token);
2666 } 2667 }
2667 2668
2668 Token parseEmptyStatement(Token token) { 2669 Token parseEmptyStatement(Token token) {
2669 listener.handleEmptyStatement(token); 2670 listener.handleEmptyStatement(token);
2670 return expectSemicolon(token); 2671 return expectSemicolon(token);
2671 } 2672 }
2672 } 2673 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698