Hi everybody. This is my first post here, so forgive me if I'm posting in a wrong category.
I'm writing a GDScript language definition for André Simon's Highlight tool. I'm almost done with the task, but I have some questions about GDScript syntax.
String Escape Sequences
In Godot's docs it's mentioned that:
Strings can contain the standard C escape sequences.
I've looked at the source of gd_tokenizer.cp(line: 594) and needed some clarifications.
"\/" Escape Char
In the escapable chars list I've encountered \/:
case '/': res='/'; break; //wtf
I'm not sure wether I should include this in the highlighter escape sequences. Should I?
NOTE: Even though Godot's editor highlights all string types with the same color, the Highlight tool distinguishes between different string types, and has a special category for escape strings; so I have to decide if "\/" should be included in the list or not.
Octal, Hex and Unicode code points Escapes
Looking at gd_tokenizer.cp, I've also found:
case 'u': {
//hexnumbarh - oct is deprecated
If I've understood correctly, Universal character names are implemented with the escape sequence \uxxxx (ie: \u followed by 4 hex digits). Correct? Also, is the number of digits fixed or it's a range from 1 to 4?
The "//hexnumbarh - oct is deprecated" comment in the source got me confused about Octal and Hexadecimal escape sequences:
As for the Octal escape sequence \nnn (ie: \ followed by either 1, 2 or 3 octal numbers), I don't understand if it's implemented or not in GDScript. Is it? If yes, how many octal digits does it take?
Regarding the Hexadecimal sequence \xhh… (ie: \x followed by 1 or more hex numbers), I couldn't work out from the source if it's implemented or not. Is it?
If anyone can help me with these I'll be thankful — and should complete the language definition quite soon, since most of the work is done, and I'm just stuck on some details and busy testing edge cases.
If I come across further questions I shall post them as additional comments on this thread; and I'll also post a link to the finished syntax file once ready (until it gets bundled with the next release of Highlight package).
Thanks!
Tristano