Добавляем экранирование в строки сценария \\" и \\n

This commit is contained in:
2025-02-16 14:19:45 +03:00
parent 9d32b0c33d
commit 2e8a7f111c
2 changed files with 11 additions and 2 deletions

View File

@@ -707,7 +707,16 @@ int IoTScenario::gettok() {
IdentifierStr = "";
LastChar = getLastChar();
while (LastChar != '"' && LastChar != EOF) {
IdentifierStr += (char)LastChar;
if (LastChar == '\\') { // обработка экранированных символов в строке
LastChar = getLastChar();
if (LastChar == '"') {
IdentifierStr += '"';
} else if (LastChar == 'n') {
IdentifierStr += '\n';
}
} else {
IdentifierStr += (char)LastChar;
}
LastChar = getLastChar();
}
LastChar = getLastChar();