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

Adds Pest Grammar to Ion Conversion #38

Merged
merged 3 commits into from
Jun 8, 2021
Merged

Adds Pest Grammar to Ion Conversion #38

merged 3 commits into from
Jun 8, 2021

Commits on Jun 7, 2021

  1. Adds Pest Grammar to Ion Conversion

    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 committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    2807cdb View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2021

  1. Adds fixes to avoid heap allocations

    As per feedback from @zslayton.
    
    Renames `PestToElement` to `TryPestToElement` which captures the
    fallible conversion (e.g. from `str` slices) and makes `PestToElement`
    be an infallible version of the API.  This is a more correct factoring,
    but also needed to avoid the intermediate copy for `Vec<AstNode>`
    conversion.
    
    Changes `AstRule` structure generation to use an array as it has a fixed
    number of fields.
    
    Adds `smallvec` to make it easier to model dynamically sized yet stack
    allocated fields for sub-structures for `Expr` conversion.
    
    Adjusts the doc test to be more illustrative.
    almann committed Jun 8, 2021
    Configuration menu
    Copy the full SHA
    783de7f View commit details
    Browse the repository at this point in the history
  2. Renames pestion to pest-ion.

    Updates surrounding meta-data and README.
    
    Also renames the following types:
    * `PestionResult` => `PestToIonResult`
    * `PestionError` => `PestToIonError`
    almann committed Jun 8, 2021
    Configuration menu
    Copy the full SHA
    5ae9e61 View commit details
    Browse the repository at this point in the history