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

Ability to nest expressions #492

Closed
KieranTH opened this issue Aug 19, 2024 · 2 comments
Closed

Ability to nest expressions #492

KieranTH opened this issue Aug 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@KieranTH
Copy link

Is your feature request related to a problem? Please describe.

It would be really nice if we could have the ability to nest expressions in each other. This is especially nice for when dealing with complex JSON structures in the data for Player.

An example of this would be:

value: "@[merge2Objects({{objA}}, @[parseObjectB({{objB}})]@)]@"

Currently that expression fails purely due to what seems like string splitting on the special characters, @, {{}} and [].

Describe the solution you'd like

For the string splitting logic to be aware of possible nested occurrences of special characters, and to deal with them appropriately. It should probably work "backwards" - Where the deepest expression is ran first, so that the returned instance of that expression can be fed into the parent expression - Unless the expression parser itself can deal with this is in the translation layer.

Cheers!

@KieranTH KieranTH added the enhancement New feature or request label Aug 19, 2024
@adierkens
Copy link
Member

Hey @KieranTH

This should actually be supported today (a good push for us to update the docs to make this clearer)

Once you're inside of an expression block (the contents wrapped by @[ ]@), you're free to use and nest any number of expression calls. In your example, it would be something like:

value: "@[ merge2Objects({{objA}}, parseObjectB({{objB}})) ]@"

@KieranTH
Copy link
Author

Hey @KieranTH

This should actually be supported today (a good push for us to update the docs to make this clearer)

Once you're inside of an expression block (the contents wrapped by @[ ]@), you're free to use and nest any number of expression calls. In your example, it would be something like:

value: "@[ merge2Objects({{objA}}, parseObjectB({{objB}})) ]@"

That's amazing!

Feel free to close this issue in that case 😄

Great way of solving the issue too without having to repeat @[]@ instances!

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants