Skip to content

Any interest in pegjs-template features? #7

@sethfowler

Description

@sethfowler

I just discovered peggyjs. Really nice work!

This peggy-tag library plays a similar role to my pegjs-template library for PEG.js. I'd love to contribute the features from that library to this one. In particular, I'd be interested in contributing:

  1. The ability to interpolate in functions and use them as semantic actions. This allows you to get syntax highlighting and type checking for semantic actions, to use TypeScript in them, to capture JavaScript variables, etc etc. This isn't just interpolating the functions' source as a string; that would prevent things like capturing variables. Instead, under the hood, the functions are passed in to the parser via the grammar context.
  2. The ability to define "partial" grammars that you can interpolate into other grammars, allowing you to share common definitions across multiple grammars. I find this pretty useful for lexical stuff in particular. Again, this isn't just interpolating the shared definitions as a string, because we want to take functions along for the ride.

I've found these features quite useful in my own work. What do you think; do these feel like a good fit for peggy-tag?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions