docs: Add comment re expr_call duplication#4638
Open
Conversation
Not sure why this doesn't work. We don't necessarily need to merge this but pushing in case anyone knows offhand...
expr_call duplicationexpr_call duplication
aljazerzen
reviewed
Jun 21, 2024
|
|
||
| // This simply inlines `expr_call`. But if we call `expr_call` here, we get a | ||
| // stack overflow — possibly because this is a recursive parser? | ||
| // let nested_expr = pipeline(expr_call().boxed()).boxed(); |
Member
There was a problem hiding this comment.
It's not exactly an inline:
- the
exprin this function is the reference to the "recursive" node, - the
exprinexpr_call()is the whole expr parser, reconstructed.
Member
There was a problem hiding this comment.
To be fair the is the most confusing part of the parser (and prql cfg).
It stems from the fact that some locations is PRQL allow "expression that can have function calls at top-level" and other locations allow only "expression that don't have function calls at top-level".
For example:
let a = ____is the first case,join ____ (owner==id)is the second case. Here, the___cannot be expr with function calls at the top-level (for examplefrom db.mytable) because that would also consume the last argument tojoin. It would parse as(join (from db.mytable (owner==id))instead of(join (from db.mytable) (owner==id).
This stems from the fact that we don't require parenthesis for func calls or even commas.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not sure why this doesn't work. We don't necessarily need to merge this but pushing in case anyone knows offhand...