[Pyparsing] Getting "maximum recursion depth exceeded" when using Forward
Brought to you by:
ptmcg
From: mayamatakeshi <may...@gm...> - 2015-09-02 03:06:25
|
Hello, I am getting "maximum recursion depth exceeded" with the below: ##################################### from pyparsing import * key = oneOf(['env', 'name']) val = Word(alphas) keyEqVal = key + '=' + val enclosed = Forward() nestedParens = nestedExpr('(', ')', content=enclosed) boolExpr = enclosed + oneOf(["and", "or"]) + enclosed enclosed << (boolExpr | nestedParens | keyEqVal) data = 'e=prod' print enclosed.parseString(data) ##################################### I know it is due my definition of boolExpr, but I could not figure out how to correct it. R, Takeshi |