diff options
| author | chris.clst <christophe.claustre.31@gmail.com> | 2021-11-14 03:23:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-14 03:23:22 +0100 |
| commit | 038be68649ca60d4a2ffb3c05bdd3cc8ec4841f4 (patch) | |
| tree | 29dfaacbcab32b7915743a5959f57b05d7816c31 /modules/gdscript/gdscript_tokenizer.cpp | |
| parent | cc39ba5509263346f33894be3a2c84580c1168a9 (diff) | |
| parent | ed300d7be536b1ec325ba77521eceee73dd0e5fb (diff) | |
Merge branch 'godotengine:master' into bugfix_shader_compile_spirv_from_source
Diffstat (limited to 'modules/gdscript/gdscript_tokenizer.cpp')
| -rw-r--r-- | modules/gdscript/gdscript_tokenizer.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp index cd247d1d26..3725fb58f5 100644 --- a/modules/gdscript/gdscript_tokenizer.cpp +++ b/modules/gdscript/gdscript_tokenizer.cpp @@ -795,6 +795,15 @@ GDScriptTokenizer::Token GDScriptTokenizer::string() { char32_t ch = _peek(); + if (ch == 0x200E || ch == 0x200F || (ch >= 0x202A && ch <= 0x202E) || (ch >= 0x2066 && ch <= 0x2069)) { + Token error = make_error("Invisible text direction control character present in the string, escape it (\"\\u" + String::num_int64(ch, 16) + "\") to avoid confusion."); + error.start_column = column; + error.leftmost_column = error.start_column; + error.end_column = column + 1; + error.rightmost_column = error.end_column; + push_error(error); + } + if (ch == '\\') { // Escape pattern. _advance(); |