| 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 // In case of a synthetic label, just use [labelName] for |
| 1941 // identifying the element. |
| 1942 super(label == null |
| 1943 ? new SourceString(labelName) |
| 1944 : label.identifier.source, |
| 1945 ElementKind.LABEL, |
| 1946 enclosingElement); |
| 1940 | 1947 |
| 1941 void setBreakTarget() { | 1948 void setBreakTarget() { |
| 1942 isBreakTarget = true; | 1949 isBreakTarget = true; |
| 1943 target.isBreakTarget = true; | 1950 target.isBreakTarget = true; |
| 1944 } | 1951 } |
| 1945 void setContinueTarget() { | 1952 void setContinueTarget() { |
| 1946 isContinueTarget = true; | 1953 isContinueTarget = true; |
| 1947 target.isContinueTarget = true; | 1954 target.isContinueTarget = true; |
| 1948 } | 1955 } |
| 1949 | 1956 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2039 | 2046 |
| 2040 MetadataAnnotation ensureResolved(Compiler compiler) { | 2047 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 2041 if (resolutionState == STATE_NOT_STARTED) { | 2048 if (resolutionState == STATE_NOT_STARTED) { |
| 2042 compiler.resolver.resolveMetadataAnnotation(this); | 2049 compiler.resolver.resolveMetadataAnnotation(this); |
| 2043 } | 2050 } |
| 2044 return this; | 2051 return this; |
| 2045 } | 2052 } |
| 2046 | 2053 |
| 2047 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 2054 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 2048 } | 2055 } |
| OLD | NEW |