-
Notifications
You must be signed in to change notification settings - Fork 19
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
Can't find type of argument #166
Comments
The error message is misleading and I will have a look at this. |
@nblei ,
you have at least made your grammar unnecessary complex. The types parol would normally derive from your grammar have been doubled and the compile time for parol’s grammar analysis has increased. On the other hand, from a user’s perspective the types may be structural identical, but they can be different in terms of their implementation. I will think about this, but currently I tend to think this is a bug in |
Yeah, I get that, hence why I didn't report this as a bug :-). In my use case, which is using parol as a parser for a hardware description language, I am all in favor of increased capabilities at increased computational cost, since lexing/parsing the language is computationally insignificant in relation to logic synthesis, APR, etc. |
@nblei |
=> eliminate_duplicates * This fixes issue Can't find type of argument #166
I am trying to add support for unions to veryl:
The relevant addition to the grammar is below
Note that this is largely mimicking the existing grammar for structs:
If I replace
UnionItem
in the definition ofUnionGroup
withStructItem
and remove the definition ofUnionItem
, parol generates a parser successfully, otherwise it errors withI would like to have
UnionItem
as a separate non-terminal, as the auto-generated data structures do not include parent references, thus distinguishing between aStructItem
in aStructDeclaration
and aStructItem
in aUnionDeclaration
would involve something let setting global state, which I would like to avoid.Full grammar: https://github.com/nblei/veryl/blob/add_token/crates/parser/veryl.par
The text was updated successfully, but these errors were encountered: