Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Conversation

@matanlurey
Copy link
Contributor

@matanlurey matanlurey commented Jun 25, 2017

... as requested by the Dart analyzer/front end team.

Started using built_value (since it gives it a nicer API anyway) and modeled method bodies as code blocks instead, since in reality it makes writing code generation that much easier if you only use typed structures for the API.

[I realize this change is scary, hence why it's going on the V2 branch instead until complete]

@matanlurey
Copy link
Contributor Author

/cc @natebosch @hterkelsen @kevmoo

Copy link
Contributor

@alorenzen alorenzen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, really like the new approach here. Obviously, it's still missing some features, like the scoping / imports, which was my favorite part of v1. But it's a great start.

visitClass(Class spec, [StringSink output]) {
output ??= new StringBuffer();
spec.docs.forEach(output.writeln);
spec.annotations.forEach((a) => visitAnnotation(a, output));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix style nits in next PR.

}
output.write(' {');
spec.constructors.forEach((c) => visitConstructor(c, spec.name, output));
spec.fields.forEach((f) => visitField(f, output));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, just use a for-loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix style nits in next PR.

T visitTypeParameters(Iterable<TypeReference> specs) => null;
}

class RecursiveSpecVisitor<T> extends SimpleSpecVisitor<T> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO here for implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix or remove in next PR.

@matanlurey
Copy link
Contributor Author

@alorenzen Yeah, I think I can re-add scoping and imports in the next PR, just wanted to make sure I was covering all feature requirements for the injection package first so I can land this internally.

@matanlurey matanlurey merged commit 09b4dff into dart-archive:v2 Jun 27, 2017
matanlurey added a commit that referenced this pull request Jul 14, 2017
* Initial 2.0.

* Add some classes.

* Start using BuiltCollection|Value.

* Add generics, inheritance.

* Add methods (without bodies).

* Added method bodies.

* Further augment methods.

* Add method parameters.

* Added methods, bodies, and constructors.

* Fix travis.

* Add annotation support.

* Add fields and constructor initializers.

* Add e2e example.
mosuem pushed a commit to dart-lang/tools that referenced this pull request Oct 25, 2024
* Initial 2.0.

* Add some classes.

* Start using BuiltCollection|Value.

* Add generics, inheritance.

* Add methods (without bodies).

* Added method bodies.

* Further augment methods.

* Add method parameters.

* Added methods, bodies, and constructors.

* Fix travis.

* Add annotation support.

* Add fields and constructor initializers.

* Add e2e example.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants