Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to generate list expressions #225

Closed
filiph opened this issue Aug 11, 2018 · 1 comment
Closed

Add ability to generate list expressions #225

filiph opened this issue Aug 11, 2018 · 1 comment
Labels
closed-as-intended Closed as the reported issue is expected behavior

Comments

@filiph
Copy link
Contributor

filiph commented Aug 11, 2018

It's possible to build literal lists with literalList. But it's not possible to build a list of expressions.

Something like:

list(refer('a'), refer('b'));

I tried to build it myself, but I had to revert to building a string using DartEmitter. The classes that might help me do it the proper way (like BinaryExpression) are private.

This might be solved by an overarching fix, like adding a class that interleaves literal strings with expressions (see proposal in #223 (comment)) or some ability to plug in custom visitor methods.

@matanlurey
Copy link
Contributor

matanlurey commented Aug 11, 2018

I am on mobile but literalList supports arbitrary expressions or references as well.

The name literal just means the list literal syntax, i.e.:

listLiteral([refer('a'), refer('b')])

... should just work. Let me know if it doesn't!

@matanlurey matanlurey added the closed-as-intended Closed as the reported issue is expected behavior label Aug 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-as-intended Closed as the reported issue is expected behavior
Projects
None yet
Development

No branches or pull requests

2 participants