Multiple places across VerCors assume that Readable#fileName will be a valid path to an existing path. This is not always true. (for example if an input originates from stdin)
Places I've found so far:
[ ] SilverToCol passes the path to the Silver parser and then creates a new RWFile in the origin of AST nodes using the path in Silver's SourcePosition class. In https://github.com/utwente-fmt/vercors/commit/b5e997d3c2e2f9a91e8860b076b86747aab7c56a I've changed it to use Readable#underlyingPath when that is not None but you can still get crashes if there is no underlyingPath.
[ ] Output.scala also uses fileName but it also creates these fileNames itself (so we know there are no folders that can get cut off and this is probably fine)
Multiple places across VerCors assume that
Readable#fileName
will be a valid path to an existing path. This is not always true. (for example if an input originates from stdin)Places I've found so far:
SilverToCol
passes the path to the Silver parser and then creates a newRWFile
in the origin of AST nodes using the path in Silver'sSourcePosition
class. In https://github.com/utwente-fmt/vercors/commit/b5e997d3c2e2f9a91e8860b076b86747aab7c56a I've changed it to useReadable#underlyingPath
when that is notNone
but you can still get crashes if there is nounderlyingPath
.SerializeOrigin
usedfileName
instead ofunderlyingPath
(fixed in https://github.com/utwente-fmt/vercors/commit/b5e997d3c2e2f9a91e8860b076b86747aab7c56a)fileName
but it also creates these fileNames itself (so we know there are no folders that can get cut off and this is probably fine)