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 elements; | 5 library elements; |
6 | 6 |
7 import 'dart:uri'; | 7 import 'dart:uri'; |
8 | 8 |
9 // TODO(ahe): Rename prefix to 'api' when VM bug is fixed. | 9 // TODO(ahe): Rename prefix to 'api' when VM bug is fixed. |
10 import '../../compiler.dart' as api_e; | 10 import '../../compiler.dart' as api_e; |
(...skipping 1915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1926 } | 1926 } |
1927 } | 1927 } |
1928 | 1928 |
1929 class LabelElement extends Element { | 1929 class LabelElement extends Element { |
1930 // We store the original label here so it can be returned by [parseNode]. | 1930 // We store the original label here so it can be returned by [parseNode]. |
1931 final Label label; | 1931 final Label label; |
1932 final String labelName; | 1932 final String labelName; |
1933 final TargetElement target; | 1933 final TargetElement target; |
1934 bool isBreakTarget = false; | 1934 bool isBreakTarget = false; |
1935 bool isContinueTarget = false; | 1935 bool isContinueTarget = false; |
1936 LabelElement(Label label, this.labelName, this.target, | 1936 LabelElement(Label label, String labelName, this.target, |
1937 Element enclosingElement) | 1937 Element enclosingElement) |
1938 : this.label = label, | 1938 : this.label = label, |
1939 super(label.identifier.source, ElementKind.LABEL, enclosingElement); | 1939 this.labelName = labelName, |
1940 super(label == null | |
1941 ? new SourceString(labelName) | |
1942 : label.identifier.source, | |
1943 ElementKind.LABEL, | |
Lasse Reichstein Nielsen
2012/11/16 15:09:11
So you can have a LabelElement without a Label?
Is
ngeoffray
2012/11/16 16:45:28
Done.
| |
1944 enclosingElement); | |
1940 | 1945 |
1941 void setBreakTarget() { | 1946 void setBreakTarget() { |
1942 isBreakTarget = true; | 1947 isBreakTarget = true; |
1943 target.isBreakTarget = true; | 1948 target.isBreakTarget = true; |
1944 } | 1949 } |
1945 void setContinueTarget() { | 1950 void setContinueTarget() { |
1946 isContinueTarget = true; | 1951 isContinueTarget = true; |
1947 target.isContinueTarget = true; | 1952 target.isContinueTarget = true; |
1948 } | 1953 } |
1949 | 1954 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2039 | 2044 |
2040 MetadataAnnotation ensureResolved(Compiler compiler) { | 2045 MetadataAnnotation ensureResolved(Compiler compiler) { |
2041 if (resolutionState == STATE_NOT_STARTED) { | 2046 if (resolutionState == STATE_NOT_STARTED) { |
2042 compiler.resolver.resolveMetadataAnnotation(this); | 2047 compiler.resolver.resolveMetadataAnnotation(this); |
2043 } | 2048 } |
2044 return this; | 2049 return this; |
2045 } | 2050 } |
2046 | 2051 |
2047 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 2052 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
2048 } | 2053 } |
OLD | NEW |