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

Side by Side Diff: lib/compiler/implementation/scanner/parser.dart

Issue 10915122: Fix source locations for inlined and patched functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 3 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 | « lib/compiler/implementation/leg.dart ('k') | lib/compiler/implementation/scanner/token.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) 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 (aka a token stream). 7 * all tokens in a linked list (aka a token stream).
8 * 8 *
9 * The class [Scanner] is used to generate a token stream. See the 9 * The class [Scanner] is used to generate a token stream. See the
10 * file scanner.dart. 10 * file scanner.dart.
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 if (value !== 'this') { 199 if (value !== 'this') {
200 Token peek = peekAfterExpectedType(token); 200 Token peek = peekAfterExpectedType(token);
201 if (isIdentifier(peek) || optional('this', peek)) { 201 if (isIdentifier(peek) || optional('this', peek)) {
202 return parseType(token); 202 return parseType(token);
203 } 203 }
204 } 204 }
205 listener.handleNoType(token); 205 listener.handleNoType(token);
206 return token; 206 return token;
207 } 207 }
208 208
209 bool isIdentifier(Token token) { 209 bool isIdentifier(Token token) => token.isIdentifier();
210 final kind = token.kind;
211 if (kind === IDENTIFIER_TOKEN) return true;
212 if (kind === KEYWORD_TOKEN) return token.value.isPseudo;
213 return false;
214 }
215 210
216 Token parseDefaultClauseOpt(Token token) { 211 Token parseDefaultClauseOpt(Token token) {
217 if (isDefaultKeyword(token)) { 212 if (isDefaultKeyword(token)) {
218 // TODO(ahe): Remove support for 'factory' in this position. 213 // TODO(ahe): Remove support for 'factory' in this position.
219 Token defaultKeyword = token; 214 Token defaultKeyword = token;
220 listener.beginDefaultClause(defaultKeyword); 215 listener.beginDefaultClause(defaultKeyword);
221 token = parseIdentifier(token.next); 216 token = parseIdentifier(token.next);
222 token = parseQualifiedRestOpt(token); 217 token = parseQualifiedRestOpt(token);
223 token = parseTypeVariablesOpt(token); 218 token = parseTypeVariablesOpt(token);
224 listener.endDefaultClause(defaultKeyword); 219 listener.endDefaultClause(defaultKeyword);
(...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 } 1846 }
1852 listener.handleContinueStatement(hasTarget, continueKeyword, token); 1847 listener.handleContinueStatement(hasTarget, continueKeyword, token);
1853 return expectSemicolon(token); 1848 return expectSemicolon(token);
1854 } 1849 }
1855 1850
1856 Token parseEmptyStatement(Token token) { 1851 Token parseEmptyStatement(Token token) {
1857 listener.handleEmptyStatement(token); 1852 listener.handleEmptyStatement(token);
1858 return expectSemicolon(token); 1853 return expectSemicolon(token);
1859 } 1854 }
1860 } 1855 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/leg.dart ('k') | lib/compiler/implementation/scanner/token.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698