| 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 #library("patchparser"); | 5 #library("patchparser"); |
| 6 #import("dart:uri"); | 6 #import("dart:uri"); |
| 7 | 7 |
| 8 #import("tree/tree.dart", prefix: "tree"); | 8 #import("tree/tree.dart", prefix: "tree"); |
| 9 #import("leg.dart", prefix: 'leg'); // CompilerTask, Compiler. | 9 #import("leg.dart", prefix: 'leg'); // CompilerTask, Compiler. |
| 10 #import("apiimpl.dart"); | 10 #import("apiimpl.dart"); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 assert(listener.nodes.isEmpty()); | 71 assert(listener.nodes.isEmpty()); |
| 72 return element.cachedNode; | 72 return element.cachedNode; |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 /** | 76 /** |
| 77 * Extension of the [Listener] interface to handle the extra "patch" pseudo- | 77 * Extension of the [Listener] interface to handle the extra "patch" pseudo- |
| 78 * keyword in patch files. | 78 * keyword in patch files. |
| 79 * Patch files shouldn't have a type named "patch". | 79 * Patch files shouldn't have a type named "patch". |
| 80 */ | 80 */ |
| 81 interface PatchListener extends Listener { | 81 abstract class PatchListener extends Listener { |
| 82 void beginPatch(Token patch); | 82 void beginPatch(Token patch); |
| 83 void endPatch(Token patch); | 83 void endPatch(Token patch); |
| 84 } | 84 } |
| 85 | 85 |
| 86 /** | 86 /** |
| 87 * Partial parser that extends the top-level and class grammars to allow the | 87 * Partial parser that extends the top-level and class grammars to allow the |
| 88 * word "patch" in front of some declarations. | 88 * word "patch" in front of some declarations. |
| 89 */ | 89 */ |
| 90 class PatchParser extends PartialParser { | 90 class PatchParser extends PartialParser { |
| 91 PatchParser(PatchListener listener) : super(listener); | 91 PatchParser(PatchListener listener) : super(listener); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 super.addMember(element); | 290 super.addMember(element); |
| 291 } | 291 } |
| 292 } | 292 } |
| 293 | 293 |
| 294 // TODO(ahe): Get rid of this class. | 294 // TODO(ahe): Get rid of this class. |
| 295 class PatchMetadataAnnotation extends MetadataAnnotation { | 295 class PatchMetadataAnnotation extends MetadataAnnotation { |
| 296 final leg.Constant value = null; | 296 final leg.Constant value = null; |
| 297 | 297 |
| 298 PatchMetadataAnnotation() : super(STATE_DONE); | 298 PatchMetadataAnnotation() : super(STATE_DONE); |
| 299 } | 299 } |
| OLD | NEW |