bytecodealliance / wasm-tools

CLI and Rust libraries for low-level manipulation of WebAssembly modules
Apache License 2.0
1.21k stars 224 forks source link

wave: Require escaping some "problematic" unicode characters #1629

Open lann opened 1 week ago

lann commented 1 week ago

Currently char and string escapes are only required for: \n, \\ and either \' (chars) or \" (strings).

In order to avoid human parsing problems, consider a few other mandatory escapes:

See: https://github.com/bytecodealliance/wac/blob/b294ae04cd85f12a619db08165b3117b8f977b0d/crates/wac-parser/src/lexer.rs#L46-L82

(migrated from https://github.com/lann/wasm-wave/issues/31)