Skip to content

serialize relation modifier and alias before the recursion marker#2810

Open
Noethix55555 wants to merge 1 commit into
Vincit:mainfrom
Noethix55555:fix/relationexpression-tostring-recursion
Open

serialize relation modifier and alias before the recursion marker#2810
Noethix55555 wants to merge 1 commit into
Vincit:mainfrom
Noethix55555:fix/relationexpression-tostring-recursion

Conversation

@Noethix55555

Copy link
Copy Markdown

RelationExpression.toString appends the recursion suffix (.^, .^N, .*) to the relation name before it appends the $modify modifier ((f1)) and the alias ( as b). The expression grammar requires name args? alias? before the recursion subexpression, so the output does not round-trip when recursion is combined with a modifier or alias:

a(f1).^   serializes to  a.^(f1)    (modifier dropped on reparse)
a as b.^  serializes to  a.^ as b   (mis-parsed as a relation named ^)

Fix emits the modifier and alias before the recursion marker. Added round-trip cases (a(f1).^, a(f1).^3, a as b.^, a(f1) as b.^) to the toString tests; they fail on the current code and pass with the change.

RelationExpression.toString appended the recursion suffix (.^, .^N, .*) before the modifier (f1) and alias (as b). The grammar requires name, args and alias before the recursion subexpression, so a node like a(f1).^ serialized to a.^(f1) (modifier dropped on reparse) and a as b.^ to a.^ as b (mis-parsed). Emit modifier and alias first so the output round-trips.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant