usethesource / rascal

The implementation of the Rascal meta-programming language (including interpreter, type checker, parser generator, compiler and JVM based run-time system)
http://www.rascal-mpl.org
Other
401 stars 77 forks source link

loc splicing does not build URIs the right way (e.g. spaces end up being not encoded when the loc is printed) #916

Open jurgenvinju opened 8 years ago

jurgenvinju commented 8 years ago
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|
DavyLandman commented 8 years ago

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.

DavyLandman commented 8 years ago

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.

jurgenvinju commented 8 years ago

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).

jurgenvinju commented 4 months ago

This is still broken.