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

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

Issue 11090016: Change core lib, dart2js, and more for new optional parameters syntax (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
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 const bool VERBOSE = false; 5 const bool VERBOSE = false;
6 6
7 /** 7 /**
8 * A parser event listener that does nothing except throw exceptions 8 * A parser event listener that does nothing except throw exceptions
9 * on parser errors. 9 * on parser errors.
10 */ 10 */
(...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after
1817 if (cachedNode != null) return cachedNode; 1817 if (cachedNode != null) return cachedNode;
1818 cachedNode = parse(listener, 1818 cachedNode = parse(listener,
1819 getCompilationUnit(), 1819 getCompilationUnit(),
1820 (p) => p.parseVariablesDeclaration(beginToken)); 1820 (p) => p.parseVariablesDeclaration(beginToken));
1821 if (!cachedNode.modifiers.isVar() && 1821 if (!cachedNode.modifiers.isVar() &&
1822 !cachedNode.modifiers.isFinal() && 1822 !cachedNode.modifiers.isFinal() &&
1823 !cachedNode.modifiers.isConst() && 1823 !cachedNode.modifiers.isConst() &&
1824 cachedNode.type === null) { 1824 cachedNode.type === null) {
1825 listener.cancel('A field declaration must start with var, final, ' 1825 listener.cancel('A field declaration must start with var, final, '
1826 'const, or a type annotation.', 1826 'const, or a type annotation.',
1827 cachedNode); 1827 node: cachedNode);
1828 } 1828 }
1829 return cachedNode; 1829 return cachedNode;
1830 } 1830 }
1831 1831
1832 Token position() => beginToken; // findMyName doesn't work. I'm nameless. 1832 Token position() => beginToken; // findMyName doesn't work. I'm nameless.
1833 1833
1834 PartialFieldListElement cloneTo(Element enclosing, 1834 PartialFieldListElement cloneTo(Element enclosing,
1835 DiagnosticListener listener) { 1835 DiagnosticListener listener) {
1836 PartialFieldListElement result = new PartialFieldListElement( 1836 PartialFieldListElement result = new PartialFieldListElement(
1837 beginToken, endToken, modifiers, enclosing); 1837 beginToken, endToken, modifiers, enclosing);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 1882
1883 Node parse(DiagnosticListener diagnosticListener, 1883 Node parse(DiagnosticListener diagnosticListener,
1884 CompilationUnitElement element, 1884 CompilationUnitElement element,
1885 doParse(Parser parser)) { 1885 doParse(Parser parser)) {
1886 NodeListener listener = new NodeListener(diagnosticListener, element); 1886 NodeListener listener = new NodeListener(diagnosticListener, element);
1887 doParse(new Parser(listener)); 1887 doParse(new Parser(listener));
1888 Node node = listener.popNode(); 1888 Node node = listener.popNode();
1889 assert(listener.nodes.isEmpty()); 1889 assert(listener.nodes.isEmpty());
1890 return node; 1890 return node;
1891 } 1891 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/scanner/keyword.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698