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

hocc code generation #246

Merged
merged 10 commits into from
Aug 25, 2024
Merged

hocc code generation #246

merged 10 commits into from
Aug 25, 2024

Commits on Aug 25, 2024

  1. Revamp source directive documentation

    The original source directive documentation used an implausible parser generator
    example to demonstrate nuances that are irrelevant to e.g. `hocc` code
    generation. Add a practical `hocc`-based example, and replace the original
    contrived example with another that focuses on the edge case nuances.
    Jason Evans committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    329601f View commit details
    Browse the repository at this point in the history
  2. Implement Option.{value,some}_or_thunk

    Jason Evans committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    fc1388e View commit details
    Browse the repository at this point in the history
  3. Fix String.C.Slice.Pattern.find

    A cursor computation double-counted characters preceding the beginning of the
    slice being searched. Remove the double counting and add a test on non-maximal
    slices.
    Jason Evans committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    b2305ea View commit details
    Browse the repository at this point in the history
  4. Update the String.length deprecation string to refer to the correct a…

    …lternatives
    Jason Evans committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    c51f79b View commit details
    Browse the repository at this point in the history
  5. Fix some type constructor examples

    Jason Evans committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    64bf996 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c58471c View commit details
    Browse the repository at this point in the history
  7. Implement hocc Hemlock/OCaml code generation

    This is the last version based on the hand-written recursive descent parser.
    Jason Evans committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    ca05cc6 View commit details
    Browse the repository at this point in the history
  8. Bootstrap the hocc parser

    Replace the hand-written recursive descent hocc parser with a hocc-generated
    parser. The parsers have equivalent behavior with the inconsequential exception
    of how leading/trailing comments are associated with reduction callback code and
    the postlude.
    Jason Evans committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    456d281 View commit details
    Browse the repository at this point in the history
  9. Merge {Abstract,Concrete}Token into Token

    This data structure simplification removes unnecessary complexity dating to
    before the finalization of hocc's generated parser API.
    Jason Evans committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    7c0cf53 View commit details
    Browse the repository at this point in the history
  10. Make myriad hocc enhancements and fixes

    Add hocc bootstrapping instructions in a comment at the top of `Parse.hmh`. Dune
    refuses to allow writes outside the build directory, so this is a more manual
    process than ideal.
    
    Enhance symbol type syntax in the hocc grammar, which previously supported types
    of the form `M.t` to support unqualified types (e.g. `t`), as well as general
    qualified types (e.g. `M.N.t`).
    
    Mangle `tl` as `tl__hocc__` in generated code.
    
    Fix callback generation for prods sharing a callback block.
    
    Implement richer binding pattern syntax.
    
    Remove syntax support for embedded code within the hocc block, and make keywords
    contextual rather than global. Incidentally, codegen failed to emit such
    embedded code.
    Jason Evans committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    bd11103 View commit details
    Browse the repository at this point in the history