saghm / unescape-rs

"Unescapes" strings with escape sequences written with literal characters and converts it into a properly escaped one.
MIT License
11 stars 4 forks source link

Return position/range and error of invalid escape sequence #3

Open seanyoung opened 5 years ago

seanyoung commented 5 years ago

unescape(r#"\r\y\n"#) returns None but does not tell us where the problem is (either position or range).

This could be used in the solang compiler so that it can return the exact position for an error.

https://github.com/hyperledger-labs/solang/blob/master/src/cfg.rs#L771