rascal
rascal copied to clipboard
loc splicing does not build URIs the right way (e.g. spaces end up being not encoded when the loc is printed)
rascal>str myPath = " ";
str: " "
rascal>|hello://<myPath>|
|prompt:///|(0,18,<1,0>,<1,18>): MalFormedURI("hello:// ")
at $shell$(|prompt:///|(0,18,<1,0>,<1,18>))
rascal>|hello:///| + myPath
loc: |hello:///%20%20|
that could be solved by calling the correct overload of the sourceLocation method of the ValueFactory.
I think that now we first concat everything and then use new URI() on that string. Which is easier to code, but incorrect.
so it would mean that in java for the interpolated source location literal you have to find in which part (scheme, authority, path,...) the interpolation is.
Yes; we should change the template grammar to make sure we can store each field in the proper place (i.e. authority has a different notations from path, etc).