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 typescript code producing errors #19

Closed
stifflerus opened this issue May 29, 2018 · 1 comment
Closed

Generated typescript code producing errors #19

stifflerus opened this issue May 29, 2018 · 1 comment

Comments

@stifflerus
Copy link
Contributor

stifflerus commented May 29, 2018

This is for v0.1.14

The generated typescript code is produces the following errors when compiled (parser.ts is the output of pegjs):

parser.ts(49,40): error TS4070: Parameter 'expected' of public static method from exported class has or is using private name 'Expectation'.

parser.ts(140,20): error TS4031: Public property 'expected' of exported class has or is using private name 'Expectation'.

parser.ts(145,42): error TS4063: Parameter 'expected' of constructor from exported class has or is using private name 'Expectation'.

This happens no matter what grammar I specify in my .pegjs file. For example, the errors occur with a trivial grammar such as
trivial = 'x'

The error seems to stem from generated types Expectation, IOtherExpectation, IEndExpectation, IAnyExpectation, IClassExpectation, IClassParts, and ILiteralExpectation not being exported from the generated parser source file. I can fix this manually to remove the errors but ts-pegjs should not be generating them in the first place.

ts-pegjs: 0.1.14
typescript: 2.8.3
pegjs: 0.10.0

@stifflerus stifflerus changed the title Generated code typescript producing errors Generated typescript code producing errors May 29, 2018
@pjmolina
Copy link
Contributor

Thanks for reporting @stifflerus
Duplicate of #18 Tracking the issue there.
Need more info to reproduce the conditions to make evident the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants