bugfix string escape

This commit is contained in:
neoe 2018-03-22 13:08:13 +08:00
parent f2ef6cae6a
commit 2b801e6ab3
2 changed files with 12 additions and 1 deletions

BIN
dist/luaformatter.jar vendored

Binary file not shown.

View File

@ -66,7 +66,18 @@ public class LuaTokens {
type = LuaTokenType.STRING;
sb.append(c);
p++;
readUntil("" + (char) c);
while (true) {
if (p >= txt.length())
break;
char c2 = txt.charAt(p++);
sb.append(c2);
if (c2 == c) {
break;
} else if (c2 == '\\') {
sb.append(txt.charAt(p++));
}
}
// readUntil("" + (char) c);
return submit(type, sb.toString());
} else {
int level = peekLongBrackets();