rascal
rascal copied to clipboard
Fully qualified name not accepted inside `start[...]`
Describe the bug
When calling parse(start[...], source), I am not able to specify a fully qualified name inside the square brackets.
To Reproduce
sandbox/Syntax.rsc:
module sandbox::Syntax
start syntax Person = "person";
layout Layout = [\ \n\t\r]* !>> [\ \n\t\r\n];
sandbox/Parse.rsc:
module sandbox::Parse
import ParseTree;
import sandbox::Syntax;
Person parsePerson1(str source) = parse(#Person, source);
Person parsePerson2(str source) = parse(#sandbox::Syntax::Person, source);
Person parsePerson3(str source) = parse(#start[Person], source).top;
Person parsePerson4(str source) = parse(#start[sandbox::Syntax::Person], source);
PS C:\Users\pieter\sandbox> java -jar ..\rascal\rascal-shell-stable.jar
Version: 0.33.8
INFO: detected |lib://rascal| at |jar+file:///C:/Users/pieter/rascal/rascal-shell-stable.jar!/|
rascal>import sandbox::Parse;
Loading module |file:///C:/Users/pieter/sandbox/src/main/rascal/sandbox/Parse.rsc|
Warning: Could not load sandbox::Parse due to: Parse error at |prompt:///|(0,22,<1,0>,<1,22>)
Parse error
at file:///C:/Users/pieter/sandbox/src/main/rascal/sandbox/Parse.rsc offset=325 length=1 begin=10:47 end=10:48
at org.rascalmpl.parser.gtd.SGTDBF.parse(SGTDBF.java:1197)
at org.rascalmpl.parser.gtd.SGTDBF.parse(SGTDBF.java:1235)
...
In VS Code, a parse error is shown on the parsePerson4 line on the s from sandbox.
When the parsePerson4 line is removed from sandbox/Parse.rsc everything works fine. All three remaning parsePerson functions work as expected.