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

Better docs for parser options #10

Closed
hildjj opened this issue Apr 13, 2021 · 7 comments · Fixed by #88
Closed

Better docs for parser options #10

hildjj opened this issue Apr 13, 2021 · 7 comments · Fixed by #88
Assignees

Comments

@hildjj
Copy link
Contributor

hildjj commented Apr 13, 2021

There at least needs to be an example

See: pegjs/pegjs#666

@StoneCypher
Copy link
Contributor

If you would allow it, after the typescript fixing, we could set this up in tsdoc

Then tutorials could be in-boarded and there would be a very clear single place from which to teach

@hildjj
Copy link
Contributor Author

hildjj commented Apr 18, 2021

I'm open to using tsdoc, but I'm not ready to move the whole project to ts to get it, and the current mechanism of hand-maintaining the .d.ts file isn't good enough for the future. If we generate it with tsc and pass the tsdoc comments throught, that might work. Show me a prototype?

@StoneCypher
Copy link
Contributor

but I'm not ready to move the whole project to ts to get it

You don't need to. Also, you really ought to: when I already did it, I drove more than 100 bugs out of peg.

 

the current mechanism of hand-maintaining the .d.ts file isn't good enough for the future

It's a one-liner with dts-gen and should be in npm scripts

 

If we generate it with tsc and pass the tsdoc comments throught, that might work. Show me a prototype?

Will do. Probably next weekend - I mostly can only find time for open source on the weekends right now.

It's actually a pretty easy lift, you'll see. Basically all you do is turn allowJs on in the typescript config, then typescript happily pretends most of it is javascript

Granted you have some bugs to fix then, but that needs to happen anyway

@hildjj
Copy link
Contributor Author

hildjj commented Apr 18, 2021

Nod. I've gotten the first few bits of that working in a few other projects, but had to use jsdoc type annotations, which:

  • are only compatible with ts types for the most trivial types
  • are incompatible with tsdoc

I'm looking forward to seeing how a dts-gen approach makes those better. Thanks for taking this on. I'm going to assign this to you for the moment, assuming that you're going to fix the original bug along with this workflow after we look at the prototype.

@StoneCypher
Copy link
Contributor

meaning bug 666 about setting context data at runtime?

i was just talking about documentation generation

@hildjj
Copy link
Contributor Author

hildjj commented Apr 19, 2021

OK, I'll start a different bug for doc generation, and fix this one tactically for now.

@hildjj
Copy link
Contributor Author

hildjj commented Apr 19, 2021

See #87

hildjj added a commit to hildjj/peggy that referenced this issue Apr 19, 2021
…clear that you can pass in anything you want to options.
@hildjj hildjj assigned hildjj and unassigned StoneCypher Apr 19, 2021
hildjj added a commit to hildjj/peggy that referenced this issue Apr 19, 2021
…clear that you can pass in anything you want to options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants