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 JS code generation for ID regular expressions #39

Open
rsek opened this issue Jun 11, 2024 · 1 comment
Open

Add JS code generation for ID regular expressions #39

rsek opened this issue Jun 11, 2024 · 1 comment
Labels
➕ enhancement New feature or request 🪪 IDs Relates to Datasworn's path-like IDs js/ts Generated code for Javascript and Typescript

Comments

@rsek
Copy link
Owner

rsek commented Jun 11, 2024

These are already generated for (and made available in) the JSON schema. But offering them as JS RegExp objects offers a few benefits to folks using the language:

  • don't have to load and traverse the Datasworn schema (which is pretty big) to get them
  • provide features like named capture groups; the group names can correspond to the parts of the type prefix

This is mainly a matter of adding another script to Node package codegen; most of the required parts already exist. I think it's a good candidate for v0.1.0.

@rsek rsek added ➕ enhancement New feature or request js/ts Generated code for Javascript and Typescript 🪪 IDs Relates to Datasworn's path-like IDs labels Jun 11, 2024
@rsek rsek modified the milestone: v0.1.0 Jun 11, 2024
@rsek
Copy link
Owner Author

rsek commented Jun 16, 2024

Deferring this until after v0.1.0. I want to give some more thought to how this could be generalized in code generation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
➕ enhancement New feature or request 🪪 IDs Relates to Datasworn's path-like IDs js/ts Generated code for Javascript and Typescript
Projects
None yet
Development

No branches or pull requests

1 participant