Merge branch 'master' into 1.15

This commit is contained in:
gnembon committed 2020-01-06 23:49:56 -04:00
commit f8dc860d39
1 file changed
+34 -5
+34 -5
View File
@@ -166,15 +166,44 @@ public class Tokenizer implements Iterator<Tokenizer.Token>
{
if (ch == '\\')
{
pos++;
char nextChar = peekNextChar();
if (nextChar == 'n')
{
token.append('\n');
}
else if (nextChar == 't')
{
throw new ExpressionException(context, this.expression, token,
"Tab character is not supported");
//token.append('\t');
}
else if (nextChar == 'r')
{
throw new ExpressionException(context, this.expression, token,
"Carriage return character is not supported");
//token.append('\r');
}
else if (nextChar == '\\' || nextChar == '\'')
{
token.append(nextChar);
}
else
{
pos--;
linepos--;
}
pos+=2;
linepos+=2;
if (pos == input.length() && expression != null && context != null)
throw new ExpressionException(context, this.expression, token, "Program truncated");
}
else
{
token.append(input.charAt(pos++));
linepos++;
if (pos == input.length() && expression != null && context != null)
throw new ExpressionException(context, this.expression, token, "Program truncated");
}
token.append(input.charAt(pos++));
linepos++;
if (pos == input.length() && expression != null && context != null)
throw new ExpressionException(context, this.expression, token, "Program truncated");
ch = input.charAt(pos);
}
pos++;