-
Notifications
You must be signed in to change notification settings - Fork 66
Conversation
Partial support towards https://github.com/dart-lang/code_builder/issues/43
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests for increment and decrement?
@@ -210,8 +240,13 @@ abstract class AbstractExpressionMixin implements ExpressionBuilder { | |||
} | |||
|
|||
@override | |||
ExpressionBuilder increment([bool prefix = false]) { | |||
return new _IncrementExpression(this, prefix); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] how are you choosing between =>
and return
? Why is this one different from decrement
above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying not to use =>
when it creates a new line, but probably inconsistent.
ExpressionBuilder identical(ExpressionBuilder other) { | ||
return lib$core.identical.call([ | ||
return lib$core.identical.call(<ExpressionBuilder>[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this fixing an analyzer warning? I'd be surprised if this wasn't inferred in strong mode...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it could not infer the type and warned as such.
@@ -186,7 +186,18 @@ abstract class ConstructorBuilder | |||
HasStatements, | |||
ValidClassMember { | |||
/// Create a new [ConstructorBuilder], optionally with a [name]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc comment is no longer complete. This is a case where we can add useful information explaining the 'super' arguments ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acknowledged.
List<ExpressionBuilder> invokeSuper, | ||
}) = _NormalConstructorBuilder; | ||
|
||
/// Adds a constructor initializer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] 'constructor initializer' reads a bit strange to me... how about
/// Adds a field initializer to this constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -47,6 +47,9 @@ final Token $deferred = new KeywordToken(Keyword.DEFERRED, 0); | |||
/// The `/` token. | |||
final Token $divide = new Token(TokenType.SLASH, 0); | |||
|
|||
/// The `do` keyword. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we consider dropping this lint? The zero-information comments are very noisy throughout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it consistent I'll drop them all in another PR.
@@ -95,4 +95,48 @@ void main() { | |||
); | |||
}); | |||
}); | |||
|
|||
group('for statemnets', () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] typo in statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a test for increment/decrement in a followup
* Add for/for-in loop Closes https://github.com/dart-lang/code_builder/issues/49 * Add support for while/do-while * Add constructor initializers Closes https://github.com/dart-lang/code_builder/issues/50 * Update CHANGELOG and pubspec for beta * Add “name” getter for ParameterBuilder Partial support towards https://github.com/dart-lang/code_builder/issues/43 * Update CHANGELOG * Address feedback
I don't expect anyone to get to this before the new year
Closes dart-lang/tools#894
Closes dart-lang/tools#970
Closes dart-lang/tools#968
Partial support on dart-lang/tools#966
1.0.0-beta
async
,sync
,sync*
functionsasAwait
,asYield
,asYieldStar
toExportBuilder
andtoImportBuilder
to types and referencesreturn
statements and named constructor invocations.while
anddo {} while
loop supportfor
andfor-in
supportname
getter forParameterBuilder
/cc @alorenzen