Const strings with ctrl characters

I have a requirement for numerous constant strings that contain a mixture of printable and non-printable characters. To represent the non-printable characters, I simply followed the cue of the IDE and used \x00 to \x1F. However, there seems to be a disconnect between the IDE and the Squirrel compile-time parser. The ide uses colour coding to indicate 8-bit support for hexadecimal escape codes (ie only two hex digits after the \x are highlighted), but the parser uses 16-bit support. For example:

`const msg= “\x01Boo
// this should output an <01> char followed by “Boo

// instead it outputs <1B> followed by “oo
”, presumably because it interprets the ‘B’ as part of the escape code

const msg = “\x0001Boo
// this outputs <01> followed by “Boo


I imagine that the parser simply converts all valid hexadecimal characters it finds after the \x up to a maximum of 4. However, I can’t find any documentation to confirm it. It would be nice if the IDE reflected that.

All valid hex characters up to a maximum of 4, yes. It is (somewhat minimalistically) documented here:


Thanks Peter. Since the IDE doesn’t reflect this, wouldn’t it be better if escape sequences were not colour-coded at all?