AssemblyScript / assemblyscript

A TypeScript-like language for WebAssembly.
https://www.assemblyscript.org
Apache License 2.0
16.87k stars 658 forks source link

Non spec-compliant text format identifiers #1068

Open dcodeIO opened 4 years ago

dcodeIO commented 4 years ago

We are currently generating internal names containing spaces and commas, which are both explicitly disallowed in text format identifiers, leading to syntax highlighting issues (only, as far as I can tell). The space can be easily fixed by omitting it, but the comma would need a replacement character.

See also: https://github.com/WebAssembly/design/issues/1324

MaxGraey commented 4 years ago

Hmm. I can imagine why space, (, ; and ) disallowing (because it may conflict with block comments $abc(; block-comment ;)) but I wonder why comma? 🤔

MaxGraey commented 4 years ago

so just need use escape sequences

'(' => '\28'
')' => '\29'
';' => '\3B'
' ' => '\20'
',' => '\2C'
'[' => '\5B'
']' => '\5D'
dcodeIO commented 4 years ago

Removing the bug label here as I haven't yet seen this leading to trouble anywhere, hence isn't a high priority. As a plus, export names are perfectly self-explanatory JSDoc-style this way.

MaxGraey commented 2 years ago

@dcodeIO I guess this already resolved?