| OLD | NEW |
| 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; | |
| 6 | |
| 7 const bool VERBOSE = false; | 5 const bool VERBOSE = false; |
| 8 | 6 |
| 9 /** | 7 /** |
| 10 * A parser event listener that does nothing except throw exceptions | 8 * A parser event listener that does nothing except throw exceptions |
| 11 * on parser errors. | 9 * on parser errors. |
| 12 */ | 10 */ |
| 13 class Listener { | 11 class Listener { |
| 14 void beginArgumentDefinitionTest(Token token) { | 12 void beginArgumentDefinitionTest(Token token) { |
| 15 } | 13 } |
| 16 | 14 |
| (...skipping 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1911 | 1909 |
| 1912 Node parse(DiagnosticListener diagnosticListener, | 1910 Node parse(DiagnosticListener diagnosticListener, |
| 1913 CompilationUnitElement element, | 1911 CompilationUnitElement element, |
| 1914 doParse(Parser parser)) { | 1912 doParse(Parser parser)) { |
| 1915 NodeListener listener = new NodeListener(diagnosticListener, element); | 1913 NodeListener listener = new NodeListener(diagnosticListener, element); |
| 1916 doParse(new Parser(listener)); | 1914 doParse(new Parser(listener)); |
| 1917 Node node = listener.popNode(); | 1915 Node node = listener.popNode(); |
| 1918 assert(listener.nodes.isEmpty()); | 1916 assert(listener.nodes.isEmpty()); |
| 1919 return node; | 1917 return node; |
| 1920 } | 1918 } |
| OLD | NEW |