assemblyscript icon indicating copy to clipboard operation
assemblyscript copied to clipboard

Non spec-compliant text format identifiers

Open dcodeIO opened this issue 5 years ago • 4 comments

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

dcodeIO avatar Jan 21 '20 15:01 dcodeIO

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

MaxGraey avatar Jan 21 '20 16:01 MaxGraey

so just need use escape sequences

'(' => '\28'
')' => '\29'
';' => '\3B'
' ' => '\20'
',' => '\2C'
'[' => '\5B'
']' => '\5D'

MaxGraey avatar Jan 21 '20 16:01 MaxGraey

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.

dcodeIO avatar Jun 11 '20 02:06 dcodeIO

@dcodeIO I guess this already resolved?

MaxGraey avatar Aug 22 '22 09:08 MaxGraey