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

Generated parser compiles with TypeScript's strict mode #8

Merged
merged 3 commits into from Jan 29, 2018

Conversation

yokljo
Copy link

@yokljo yokljo commented Jan 13, 2018

Added any types where required, and also made a few interfaces where it was simple to do so.

@pjmolina
Copy link
Contributor

pjmolina commented Jan 15, 2018

Hi @yokljo
Thanks for the effort on typing it!
Is the pull request complete?
I tried your branch with npm test and then tsc --strict output/arithmetics.ts with the following result.

On the other hand, forcing strict mode compile into more complex samples:

  • output/css.ts
  • output/json.ts
  • output/javascript.ts
  • output/st.ts
    hangs the TS compiler. I think it is a bug into the TS compiler related to this one already reported: TS 17033.

Looks like pegjs medium-size generated parsers are hard to digest for the TS compiler.

@yokljo
Copy link
Author

yokljo commented Jan 23, 2018

Ah sorry, my sample size was 1: The grammar I wrote for my own project.
I'll see what I can do. Adding all the appropriate types required for the tests should definitely be doable.

@yokljo
Copy link
Author

yokljo commented Jan 23, 2018

Now all the tests pass. I think that css.pegjs example is lost cause for now... I can't be bothered debugging the Typescript compiler.

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 this pull request may close these issues.

None yet

2 participants