Unverified Commit f5371bc6 by Rémi Verschelde Committed by GitHub

Merge pull request #37033 from ThakeeNathees/python-like-str-escape

python like string escape implemented
parents c04cdc2b f6cee4a1
......@@ -803,19 +803,16 @@ void GDScriptTokenizerText::_advance() {
switch (next) {
case 'a': res = 7; break;
case 'b': res = 8; break;
case 't': res = 9; break;
case 'n': res = 10; break;
case 'v': res = 11; break;
case 'f': res = 12; break;
case 'r': res = 13; break;
case 'a': res = '\a'; break;
case 'b': res = '\b'; break;
case 't': res = '\t'; break;
case 'n': res = '\n'; break;
case 'v': res = '\v'; break;
case 'f': res = '\f'; break;
case 'r': res = '\r'; break;
case '\'': res = '\''; break;
case '\"': res = '\"'; break;
case '\\': res = '\\'; break;
case '/':
res = '/';
break; //wtf
case 'u': {
// hex number
......@@ -847,6 +844,10 @@ void GDScriptTokenizerText::_advance() {
i += 3;
} break;
case '\n': {
line++;
column = 1;
} break;
default: {
_make_error("Invalid escape sequence");
......@@ -854,7 +855,8 @@ void GDScriptTokenizerText::_advance() {
} break;
}
str += res;
if (next != '\n')
str += res;
} else {
if (CharType(GETCHAR(i)) == '\n') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment