Closed nitish-deckspire closed 3 years ago
You cannot nest another parser as a function within the parser because yacc is being used in a global way.
yacc
Code to reproduce:
import hotxlfp def parse(formula): parser = hotxlfp.Parser(debug=True) setattr(parser, '_name', 'p_init') result = parser.parse(formula) return result['result'] parser2 = hotxlfp.Parser(debug=True) setattr(parser2, '_name', 'p_ext') parser2.set_function('EVAL', parse) parser2.parse('EVAL("1+1")') # result = 2 parser2.parse('EVAL("1+1")') # result = None
Thanks! I'll add some tests for this and release a new version.
You cannot nest another parser as a function within the parser because
yacc
is being used in a global way.Code to reproduce: