Merge pull request #54883 from bruvzg/dir_control_warning

This commit is contained in:
Rémi Verschelde 2021-11-11 16:05:39 +01:00 committed by GitHub
commit c0fdbf16c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -795,6 +795,15 @@ GDScriptTokenizer::Token GDScriptTokenizer::string() {
char32_t ch = _peek(); 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 == '\\') { if (ch == '\\') {
// Escape pattern. // Escape pattern.
_advance(); _advance();