Closed
Description
The problem occurs if you insert special characters
In the first case everything works as expected, the output is “+case2”
CASE = "+case2"
A = Or([CaselessKeyword("+case1"), CaselessKeyword("+case2")])
print(A.parse_string(CASE))
But in the second one, when the as_keyword parameter in one_of is used, an error occurs
CASE = "+case2"
B = one_of(["+case1", "+case2"], caseless=True, as_keyword=True)
print(B.parse_string(CASE))
raise exc.with_traceback(None)
pyparsing.exceptions.ParseException: Expected +case1 | +case2, found '+' (at char 0), (line:1, col:1)
I'm using pyparsing version 3.1.2
Metadata
Metadata
Assignees
Labels
No labels