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

No psi interface generated for recursively-only used rule #297

Open
imkiva opened this issue Jun 15, 2022 · 0 comments
Open

No psi interface generated for recursively-only used rule #297

imkiva opened this issue Jun 15, 2022 · 0 comments

Comments

@imkiva
Copy link

imkiva commented Jun 15, 2022

Given the following BNF

{
  tokens = [
    ID = 'regexp:[a-zA-Z_][a-zA-Z0-9_]*'
    NUMBER = 'regexp:[0-9]+'
    LAMBDA = 'lambda'
    TO = '->'
  ]
  extends("expr|.+Expr") = expr
}
expr ::= lambdaExpr | literalExpr
lambdaExpr ::= 'lambda' expr '->' expr
literalExpr ::= ID | NUMBER

The expr is only used in its child rules (declared in the extends(...) clause), and after Ctrl + Shift + G, Grammar kit generated the following implementation:

image

It seems that GK cannot find the psi interface for expr rule. But everything works again after adding a rule that externally uses expr like

useIt ::= expr

I guess this is not the expected behavior, or there should at least be error reporting for this situation.

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

No branches or pull requests

1 participant