debug parser

correct the rescusive loop, avoid endless loop.