-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add async/await/sync/yield and toImport/ExportBuilder (dart-archive/c…
…ode_builder#46) * Various changes. * Update presubmit. * Add async, await, yield * . * . * Update CHANGELOG.md * Update pubspec.yaml
- Loading branch information
1 parent
3a28214
commit 75c8c69
Showing
15 changed files
with
309 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
part of code_builder.src.builders.expression; | ||
|
||
class _AsAwait extends AbstractExpressionMixin with TopLevelMixin { | ||
final ExpressionBuilder _expression; | ||
|
||
_AsAwait(this._expression); | ||
|
||
@override | ||
AstNode buildAst([Scope scope]) => buildExpression(scope); | ||
|
||
@override | ||
Expression buildExpression([Scope scope]) { | ||
return new AwaitExpression( | ||
$await, | ||
_expression.buildExpression(scope), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
part of code_builder.src.builders.expression; | ||
|
||
class _AsYield extends TopLevelMixin implements StatementBuilder { | ||
final ExpressionBuilder _expression; | ||
final bool _isStar; | ||
|
||
_AsYield(this._expression, this._isStar); | ||
|
||
@override | ||
Statement buildAst([Scope scope]) => buildStatement(scope); | ||
|
||
@override | ||
Statement buildStatement([Scope scope]) { | ||
return new YieldStatement( | ||
$yield, | ||
_isStar ? $star : null, | ||
_expression.buildExpression(scope), | ||
$semicolon, | ||
); | ||
} | ||
} |
Oops, something went wrong.