| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.scope; | 5 library fasta.scope; |
| 6 | 6 |
| 7 import 'builder.dart' show Builder, MixedAccessor; | 7 import 'builder.dart' show Builder, MixedAccessor; |
| 8 | 8 |
| 9 import '../errors.dart' show internalError; | 9 import '../errors.dart' show internalError; |
| 10 | 10 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 } | 101 } |
| 102 } | 102 } |
| 103 | 103 |
| 104 void forwardDeclareLabel(String name, Builder target) { | 104 void forwardDeclareLabel(String name, Builder target) { |
| 105 declareLabel(name, target); | 105 declareLabel(name, target); |
| 106 forwardDeclaredLabels ??= <String, Builder>{}; | 106 forwardDeclaredLabels ??= <String, Builder>{}; |
| 107 forwardDeclaredLabels[name] = target; | 107 forwardDeclaredLabels[name] = target; |
| 108 } | 108 } |
| 109 | 109 |
| 110 void claimLabel(String name) { | 110 void claimLabel(String name) { |
| 111 if (forwardDeclaredLabels == null) return; |
| 111 forwardDeclaredLabels.remove(name); | 112 forwardDeclaredLabels.remove(name); |
| 112 if (forwardDeclaredLabels.length == 0) { | 113 if (forwardDeclaredLabels.length == 0) { |
| 113 forwardDeclaredLabels = null; | 114 forwardDeclaredLabels = null; |
| 114 } | 115 } |
| 115 } | 116 } |
| 116 | 117 |
| 117 Map<String, Builder> get unclaimedForwardDeclarations { | 118 Map<String, Builder> get unclaimedForwardDeclarations { |
| 118 return forwardDeclaredLabels; | 119 return forwardDeclaredLabels; |
| 119 } | 120 } |
| 120 | 121 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 class AmbiguousBuilder extends Builder { | 169 class AmbiguousBuilder extends Builder { |
| 169 final Builder builder; | 170 final Builder builder; |
| 170 | 171 |
| 171 AmbiguousBuilder(this.builder, int charOffset, Uri fileUri) | 172 AmbiguousBuilder(this.builder, int charOffset, Uri fileUri) |
| 172 : super(null, charOffset, fileUri); | 173 : super(null, charOffset, fileUri); |
| 173 | 174 |
| 174 get target => null; | 175 get target => null; |
| 175 | 176 |
| 176 bool get hasProblem => true; | 177 bool get hasProblem => true; |
| 177 } | 178 } |
| OLD | NEW |