I've hit a funny little bug with this excellent library. I'm trying to evaluate an expression such as AnyExpression.parse(var1 + "'\\n'" + var2, ...), but this fails with an unexpectedToken("\\n\'"). If I modify it slightly to `AnyExpression.parse(var1 + "' \\n'" + var2, ...) it works -- notice the additional space.
The simplest way to reproduce this is Expression.parse("'\\n'").
It seems to be an issue with parseEscapedIdentifier and in particular this line:
while let part = scanCharacters({ $0 != delimiter && $0 != "\\" }) {
Unfortunately this implementation is going a bit over my head, so I haven't yet figured out how to fix this. Any advice would be much appreciated.
I've hit a funny little bug with this excellent library. I'm trying to evaluate an expression such as
AnyExpression.parse(var1 + "'\\n'" + var2, ...)
, but this fails with anunexpectedToken("\\n\'")
. If I modify it slightly to`AnyExpression.parse(var1 + "' \\n'" + var2, ...)
it works -- notice the additional space.The simplest way to reproduce this is
Expression.parse("'\\n'")
.It seems to be an issue with
parseEscapedIdentifier
and in particular this line:Unfortunately this implementation is going a bit over my head, so I haven't yet figured out how to fix this. Any advice would be much appreciated.