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

Side by Side Diff: dart/frog/leg/scanner/parser.dart

Issue 9817006: Parse function expressions correctly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/tests/co19/co19-leg.status » ('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) 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 /** 5 /**
6 * An event generating parser of Dart programs. This parser expects 6 * An event generating parser of Dart programs. This parser expects
7 * all tokens in a linked list. 7 * all tokens in a linked list.
8 */ 8 */
9 class Parser { 9 class Parser {
10 final Listener listener; 10 final Listener listener;
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 return parseLiteralNull(token); 994 return parseLiteralNull(token);
995 } else if (value === 'this') { 995 } else if (value === 'this') {
996 return parseThisExpression(token); 996 return parseThisExpression(token);
997 } else if (value === 'super') { 997 } else if (value === 'super') {
998 return parseSuperExpression(token); 998 return parseSuperExpression(token);
999 } else if (value === 'new') { 999 } else if (value === 'new') {
1000 return parseNewExpression(token); 1000 return parseNewExpression(token);
1001 } else if (value === 'const') { 1001 } else if (value === 'const') {
1002 return parseConstExpression(token); 1002 return parseConstExpression(token);
1003 } else if (value === 'void') { 1003 } else if (value === 'void') {
1004 return parseFunction(token, null); 1004 return parseFunctionExpression(token);
1005 } else if (isIdentifier(token)) { 1005 } else if (isIdentifier(token)) {
1006 return parseSendOrFunctionLiteral(token); 1006 return parseSendOrFunctionLiteral(token);
1007 } else { 1007 } else {
1008 return listener.expectedExpression(token); 1008 return listener.expectedExpression(token);
1009 } 1009 }
1010 } else if (kind === OPEN_PAREN_TOKEN) { 1010 } else if (kind === OPEN_PAREN_TOKEN) {
1011 return parseParenthesizedExpressionOrFunctionLiteral(token); 1011 return parseParenthesizedExpressionOrFunctionLiteral(token);
1012 } else if ((kind === LT_TOKEN) || 1012 } else if ((kind === LT_TOKEN) ||
1013 (kind === OPEN_SQUARE_BRACKET_TOKEN) || 1013 (kind === OPEN_SQUARE_BRACKET_TOKEN) ||
1014 (kind === OPEN_CURLY_BRACKET_TOKEN) || 1014 (kind === OPEN_CURLY_BRACKET_TOKEN) ||
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 } 1579 }
1580 listener.handleContinueStatement(hasTarget, continueKeyword, token); 1580 listener.handleContinueStatement(hasTarget, continueKeyword, token);
1581 return expectSemicolon(token); 1581 return expectSemicolon(token);
1582 } 1582 }
1583 1583
1584 Token parseEmptyStatement(Token token) { 1584 Token parseEmptyStatement(Token token) {
1585 listener.handleEmptyStatement(token); 1585 listener.handleEmptyStatement(token);
1586 return expectSemicolon(token); 1586 return expectSemicolon(token);
1587 } 1587 }
1588 } 1588 }
OLDNEW
« no previous file with comments | « no previous file | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698