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

Add Pest Syntax to Ion Conversion #35

Closed
almann opened this issue Jun 6, 2021 · 0 comments · Fixed by #38
Closed

Add Pest Syntax to Ion Conversion #35

almann opened this issue Jun 6, 2021 · 0 comments · Fixed by #38
Assignees
Labels
enhancement New feature or request

Comments

@almann
Copy link
Contributor

almann commented Jun 6, 2021

It would be good to be able to use the Pest grammar definition to create other artifacts. For example, we could use the Pest grammar to generate LaTeX figures for the specification, and also derive things like a TextMate.

To make this easier to do, we should have a way to convert the Pest AST into Ion representation. This generalized representation can be used outside of Rust (e.g. a Python script) to make some of these non-critical path cases easier to write.

I propose we add a simple library to convert Pest to Ion and then a CLI that to do the conversion.

@almann almann added the enhancement New feature or request label Jun 6, 2021
@almann almann self-assigned this Jun 6, 2021
almann added a commit to almann/partiql-lang-rust that referenced this issue Jun 6, 2021
Adds the `pestion` crate to provide a simple trait `PestToElement` and
implementations over the Pest AST and `&str` syntax definitions to
create Ion `Element` serialized forms.

Fixes partiql#35.
almann added a commit to almann/partiql-lang-rust that referenced this issue Jun 7, 2021
Adds the `pestion` crate to provide a simple trait `PestToElement` and
implementations over the Pest AST and `&str` syntax definitions to
create Ion `Element` serialized forms.

Resolves partiql#35.
almann added a commit to almann/partiql-lang-rust that referenced this issue Jun 7, 2021
Adds the `pestion` crate to provide a simple trait `PestToElement` and
implementations over the Pest AST and `&str` syntax definitions to
create Ion `Element` serialized forms.

Resolves partiql#35.
almann added a commit to almann/partiql-lang-rust that referenced this issue Jun 7, 2021
The purpose of this commit is the start of a tool to generate Ion
formatted ASTs from Pest grammars, particularly that of PartiQL.
We could then easily process the grammar outside of Rust in scripts that
could be used to generate things like TextMate grammars for IDE support
or LaTeX fragments for the specification document.

Adds the `pestion` crate to provide a simple trait `PestToElement` and
implementations over the Pest AST and `&str` syntax definitions to
create Ion `Element` serialized forms.

Resolves partiql#35.
@almann almann closed this as completed in #38 Jun 8, 2021
almann added a commit that referenced this issue Jun 8, 2021
The purpose of this commit is the start of a tool to generate Ion
formatted ASTs from Pest grammars, particularly that of PartiQL.
We could then easily process the grammar outside of Rust in scripts that
could be used to generate things like TextMate grammars for IDE support
or LaTeX fragments for the specification document.

Adds the `pest-ion` crate to provide a simple trait `TryPestToElement`
and implementations over `&str` syntax definitions to parse Pest grammars
and create their Ion `Element` serialized forms.  Also adds `PestToElement`
which is the infallible version of the trait (used mostly for Pest AST elements).

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