You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
stifflerus
changed the title
Generated code typescript producing errors
Generated typescript code producing errors
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
, andILiteralExpectation
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
The text was updated successfully, but these errors were encountered: