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

Flatten Pest to Ion sequence/choice Nodes #37

Closed
almann opened this issue Jun 7, 2021 · 0 comments · Fixed by #46
Closed

Flatten Pest to Ion sequence/choice Nodes #37

almann opened this issue Jun 7, 2021 · 0 comments · Fixed by #46
Labels
enhancement New feature or request

Comments

@almann
Copy link
Contributor

almann commented Jun 7, 2021

The sequence/choice nodes in the Pest grammar AST are binary. We should allow them to flatten such that:

(choice
  (choice
    (identifier "a")
    (identifier "b")
  )
  (identifier "c")
)

Turn into:

(choice
  (identifier "a")
  (identifier "b")
  (identifier "c")
)

This makes downstream consumption easier. Note that sequence has higher precedence than choice.

@almann almann added the enhancement New feature or request label Jun 8, 2021
almann added a commit to almann/partiql-lang-rust that referenced this issue Jun 11, 2021
Need to refactor this to be a bit more generic so we can re-use logic
for `sequence` operator

Towards partiql#37.
almann added a commit to almann/partiql-lang-rust that referenced this issue Jun 12, 2021
Implements a `flatten` a higher-order function to operate on binary
operators that have associativity like `choice`/`sequence`.

Resolves partiql#37.
almann added a commit to almann/partiql-lang-rust that referenced this issue Jun 12, 2021
Implements a `flatten` a higher-order function to operate on binary
operators that have associativity like `choice`/`sequence`.

Resolves partiql#37.
almann added a commit that referenced this issue Jun 15, 2021
Implements a `flatten` a higher-order function to operate on binary
operators that have associativity like `choice`/`sequence`.

Resolves #37.
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

Successfully merging a pull request may close this issue.

1 participant