-
Notifications
You must be signed in to change notification settings - Fork 32
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
Options documentation is confusing. #44
Comments
Yep can confirm. Just spent a few hours trying to get
There is more information about this in this issue: #11 . Especially in this comment by @pjmolina. If I get this right, @pjmolina suggest wrapping I am struggling a bit with typing intermediate production rules. Which always seem to fail. A bit of documentation around this would be nice as well. |
So if I understand it right, there is no way to specify types for |
@wy193777 as far as I understand it this is correct. But you can do what I did and wrap |
You are right, I will prepare a better documentation for this. As commented, ts-pegjs is a plugin for pegjs this involves:
|
Also I tested the example, and it has the same issue I described. The export ends up getting typed as any. I filed the issue because I was wondering if this was intentional. I mean, I guess it's a bit helpful for the output to be typed, but I was expecting the plugin to type the
Yeah too bad development seems to have stalled. Anyways, I have something satisfactory working, and at least now there's this issue if others are wondering about this. |
Oh. About camelCase and snake-case. It is the same POSIX standard uses snake-case. When used on json objects converted to camelCase. Typing |
First in the readme some options are named with dashes and others aren't, not sure why?
Also I was trying to get
returnTypes
working and since there's no examples and it was grouped with the plugin options that went under thetspegjs
property, I assumed it would go there. Had to search the code to find out what was going on.A example in the readme using all the options possible would be nice.
Additionally I can't get returnTypes to work. I mean I can see it's typing all the rule functions, but since
peg$parsestart
is wrapped bypeg$startRuleFunction
andpeg$parse
is further typed asParseFunction
, both returning any, even if I set the start rule type, the type of parse is always any. Is this intended? Should I open an issue?The text was updated successfully, but these errors were encountered: