Allow a sequence of function items in dynamic function calls - #2503
Closed
GuntherRademacher wants to merge 1 commit into
Closed
GuntherRademacher wants to merge 1 commit into
GuntherRademacher wants to merge 1 commit into
Conversation
Member
Yes, I assume this will be the best way forward. It will also cover other cases that would otherwise need to be handled by the parser, such as sequences delivered by the arrow expression: 'x' => (substring-before('abxyz', ?), substring-after('abxyz', ?))()I will have more thoughts on it. |
Member
|
I close with PR as I believe I have found an alternative solution (6acd7dd) that does not endanger our TCO rewritings, and that will work for other syntax constructs as well. |
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.
These changes add support for PR 1975, i.e. allowing dynamic function calls to operate on a sequence of function items, fixing the corresponding QT4-Tests. Unfortunately there are 3 errors in BaseX-Tests, because tail-call optimization for dynamic function calls does not work any longer:
The approach taken here is to generate in iteration from within the parser. Effectively,
is translated to
but there also is special treatment without an interation for the case where the static type indicates exactly one function item.
An alternative approach might be enhancing the
DynFuncCalloperator to support a sequence of function items, but that has not been investigated yet.