usethesource / clair

C Language Analysis in Rascal
BSD 2-Clause "Simplified" License
25 stars 12 forks source link

make paths with spaces correctly processed by pretty() #61

Closed ruichen-ing closed 1 year ago

ruichen-ing commented 1 year ago

The pretty(loc subject) function cannot process the directory with spaces:

rascal>loc path = |file:///| + "C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um";
loc: |file:///C:/Program%20Files%20(x86)/Windows%20Kits/10/Include/10.0.19041.0/um|
rascal>pretty(path)
|lib://clair/src/lang/cpp/M3.rsc|(6026,43,<101,26>,<101,69>): MalFormedURI("file:///C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um")
        at pretty(|lib://clair/src/lang/cpp/M3.rsc|(6000,70,<101,0>,<101,70>))
        at $shell$(|prompt:///|(0,21,<1,0>,<1,21>)ok

This pull request is to fix this problem.

jurgenvinju commented 1 year ago

Thanks @ruichen-ing !