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

Parameterized nonterminals not (fully) supported in concrete patterns #1967

Open
rodinaarssen opened this issue Jun 7, 2024 · 0 comments
Open

Comments

@rodinaarssen
Copy link
Member

Describe the bug

Parameterized nonterminals in concrete patterns are not fully supported by the interpreter. There is a workaround where one would use the "filled in" nonterminal in a grammar production to ensure that the quotes are generated, but this only works when type parameters are bound to syntactic nonterminals, not when bound to lexical ones.

To Reproduce

rascal>syntax A = "a";
ok
rascal>lexical B = "b";
ok
rascal>syntax C[&T] = &T;
ok
rascal>syntax D = C[A];
ok
rascal>syntax E = C[B];
ok
rascal>(C[A])`a`
C[A]: (C[A]) `a`
rascal>(C[B])`b`
|prompt:///|(7,1):Undeclared non-terminal: C_W3NvcnQoIkIiKV000 in module $GENERATED_PARSER$1842140283
Advice: |https://www.rascal-mpl.org/docs/Rascal/Errors/CompileTimeErrors/UndeclaredNonTerminal|
|prompt:///|(7,1):Undeclared non-terminal: C_W3NvcnQoIkIiKV000 in module $GENERATED_PARSER$1842140283
Advice: |https://www.rascal-mpl.org/docs/Rascal/Errors/CompileTimeErrors/UndeclaredNonTerminal|
|prompt:///|(0,9,<1,0>,<1,9>): Parse error in concrete syntax fragment
Advice: |https://www.rascal-mpl.org/docs/Rascal/Errors/CompileTimeErrors/SyntaxError|
ok

Desktop (please complete the following information):

  • Context: VS Code plugin
  • Rascal Version: 0.34.1
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

1 participant