Merge branch 'master' into 1.15
This commit is contained in:
commit
f8dc860d39
1 file changed
+34
-5
@@ -166,15 +166,44 @@ public class Tokenizer implements Iterator<Tokenizer.Token>
|
|||||||
{
|
{
|
||||||
if (ch == '\\')
|
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++;
|
linepos++;
|
||||||
if (pos == input.length() && expression != null && context != null)
|
if (pos == input.length() && expression != null && context != null)
|
||||||
throw new ExpressionException(context, this.expression, token, "Program truncated");
|
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);
|
ch = input.charAt(pos);
|
||||||
}
|
}
|
||||||
pos++;
|
pos++;
|
||||||
|
|||||||
Reference in new issue
Block a user