Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: pkg/compiler/lib/src/elements/elements.dart

Issue 2897273002: Add FunctionEntity.asyncMarker and refactor SourceInformationStrategy to avoid ResolvedAst (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/common/codegen.dart ('k') | pkg/compiler/lib/src/elements/entities.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/elements.dart
diff --git a/pkg/compiler/lib/src/elements/elements.dart b/pkg/compiler/lib/src/elements/elements.dart
index 9e3e5056928a74e32a0615cae3b67bccdb0b21b6..c1387a68ba9a8e1136c05e764744e9381f657b57 100644
--- a/pkg/compiler/lib/src/elements/elements.dart
+++ b/pkg/compiler/lib/src/elements/elements.dart
@@ -4,9 +4,6 @@
library elements;
-import 'package:front_end/src/fasta/parser/async_modifier.dart'
- show AsyncModifier;
-
import '../common.dart';
import '../common/resolution.dart' show Resolution;
import '../constants/constructors.dart';
@@ -1342,58 +1339,6 @@ abstract class SetterElement extends AccessorElement {
GetterElement get getter;
}
-/// Enum for the synchronous/asynchronous function body modifiers.
-class AsyncMarker {
- /// The default function body marker.
- static const AsyncMarker SYNC = const AsyncMarker._(AsyncModifier.Sync);
-
- /// The `sync*` function body marker.
- static const AsyncMarker SYNC_STAR =
- const AsyncMarker._(AsyncModifier.SyncStar, isYielding: true);
-
- /// The `async` function body marker.
- static const AsyncMarker ASYNC =
- const AsyncMarker._(AsyncModifier.Async, isAsync: true);
-
- /// The `async*` function body marker.
- static const AsyncMarker ASYNC_STAR = const AsyncMarker._(
- AsyncModifier.AsyncStar,
- isAsync: true,
- isYielding: true);
-
- /// Is `true` if this marker defines the function body to have an
- /// asynchronous result, that is, either a [Future] or a [Stream].
- final bool isAsync;
-
- /// Is `true` if this marker defines the function body to have a plural
- /// result, that is, either an [Iterable] or a [Stream].
- final bool isYielding;
-
- final AsyncModifier asyncParserState;
-
- const AsyncMarker._(this.asyncParserState,
- {this.isAsync: false, this.isYielding: false});
-
- String toString() {
- return '${isAsync ? 'async' : 'sync'}${isYielding ? '*' : ''}';
- }
-
- /// Canonical list of marker values.
- ///
- /// Added to make [AsyncMarker] enum-like.
- static const List<AsyncMarker> values = const <AsyncMarker>[
- SYNC,
- SYNC_STAR,
- ASYNC,
- ASYNC_STAR
- ];
-
- /// Index to this marker within [values].
- ///
- /// Added to make [AsyncMarker] enum-like.
- int get index => values.indexOf(this);
-}
-
/// A top level, static or instance function.
abstract class MethodElement extends FunctionElement
implements MemberElement, FunctionEntity {}
« no previous file with comments | « pkg/compiler/lib/src/common/codegen.dart ('k') | pkg/compiler/lib/src/elements/entities.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698