simplified ast, added _lp and _rng functions and parser constraints