Example #1
0
 def do_call(self, parser: BasicParser) -> bool:
     parser._stream.save_context()
     while not parser.read_eof():
         res = self.pt(parser)
         if res:
             return parser._stream.validate_context()
         parser._stream.incpos()
     parser._stream.restore_context()
     parser.undo_last_ignore()
     return False
Example #2
0
 def do_call(self, parser: BasicParser) -> bool:
     if parser.read_eof():
         return False
     parser._stream.save_context()
     res = self.pt(parser)
     if not res:
         parser._stream.incpos()
         return parser._stream.validate_context()
     parser._stream.restore_context()
     return False