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

Side by Side Diff: pkg/front_end/lib/src/fasta/parser/parser.dart

Issue 2747583003: Parse factory constructors with Fasta. (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
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 library fasta.parser.parser; 5 library fasta.parser.parser;
6 6
7 import '../scanner.dart' show ErrorToken; 7 import '../scanner.dart' show ErrorToken;
8 8
9 import '../scanner/recover.dart' show closeBraceFor, skipToEof; 9 import '../scanner/recover.dart' show closeBraceFor, skipToEof;
10 10
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 listener.beginFactoryMethod(factoryKeyword); 1851 listener.beginFactoryMethod(factoryKeyword);
1852 token = expect('factory', token); 1852 token = expect('factory', token);
1853 token = parseConstructorReference(token); 1853 token = parseConstructorReference(token);
1854 token = parseFormalParameters(token); 1854 token = parseFormalParameters(token);
1855 token = parseAsyncModifier(token); 1855 token = parseAsyncModifier(token);
1856 if (optional('=', token)) { 1856 if (optional('=', token)) {
1857 token = parseRedirectingFactoryBody(token); 1857 token = parseRedirectingFactoryBody(token);
1858 } else { 1858 } else {
1859 token = parseFunctionBody(token, false, isExternal); 1859 token = parseFunctionBody(token, false, isExternal);
1860 } 1860 }
1861 listener.endFactoryMethod(start, token); 1861 listener.endFactoryMethod(start, factoryKeyword, token);
1862 return token.next; 1862 return token.next;
1863 } 1863 }
1864 1864
1865 Token parseOperatorName(Token token) { 1865 Token parseOperatorName(Token token) {
1866 assert(optional('operator', token)); 1866 assert(optional('operator', token));
1867 if (isUserDefinableOperator(token.next.stringValue)) { 1867 if (isUserDefinableOperator(token.next.stringValue)) {
1868 Token operator = token; 1868 Token operator = token;
1869 token = token.next; 1869 token = token.next;
1870 listener.handleOperatorName(operator, token); 1870 listener.handleOperatorName(operator, token);
1871 return token.next; 1871 return token.next;
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after
3578 break; 3578 break;
3579 } 3579 }
3580 if (isRecoverable) { 3580 if (isRecoverable) {
3581 listener.handleRecoverableError(token, kind, arguments); 3581 listener.handleRecoverableError(token, kind, arguments);
3582 return null; 3582 return null;
3583 } else { 3583 } else {
3584 return listener.handleUnrecoverableError(token, kind, arguments)?.next; 3584 return listener.handleUnrecoverableError(token, kind, arguments)?.next;
3585 } 3585 }
3586 } 3586 }
3587 } 3587 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/listener.dart ('k') | pkg/front_end/lib/src/fasta/source/diet_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698