Reputation: 43
I have run into and issue. I have been trying to read the content of a file for an example project which contains I single file. Below you will find the code and the error which I get. I have tried running this code with Rascal version 0.22.0, 0.23.0, and 0.24,2. In all versions I have the same issue, but I do not understand what is wrong, and I am pretty sure this code worked for me over a year ago.
void demoFunc() {
list[str] output = [];
m3x = createM3FromEclipseProject(|project://testProject|);
projectFiles = files(m3x);
for(file <- projectFiles) {
output = readFileLines(file);
}
}
rascal>demoFunc();
|std:///IO.rsc|(15157,756,<620,0>,<640,24>): IO("Unsupported scheme \'java+compilationUnit\'")
at *** somewhere ***(|std:///IO.rsc|(15157,756,<620,0>,<640,24>))
at readFileLines(|project://TQM/src/Helper.rsc|(998,4,<39,26>,<39,30>))
at $root$(|prompt:///|(0,11,<1,0>,<1,11>)ok
Upvotes: 1
Views: 202
Reputation: 6696
Looks like the latest rascal-eclipse release has a new bug. To work around this one you could resolve the source file from the logical name yourself:
loc sourceFile(loc logical, M3 model) {
if (loc f <- model.declarations[logical]) {
return f;
}
throw FileNotFound(logical);
}
That simulates what analysis::m3::Registry
would have done for you. The returned loc
is a slice of the file where the declared entity is found. If you want the entire file, use myLoc.top
.
Upvotes: 1