def expect(self, f, *args):
match = self.accept(f, *args)<EOL>if match:<EOL><INDENT>return match<EOL><DEDENT>try:<EOL><INDENT>func_name = f.func_name<EOL><DEDENT>except AttributeError:<EOL><INDENT>func_name = "<STR_LIT>"<EOL><DEDENT>start, end = self.current_position()<EOL>raise errors.EfilterParseError(<EOL>query=self.tokenizer.source, start=start, end=end,<EOL>message="<STR_LIT>" % (func_name))<EOL>
Like 'accept' but throws a parse error if 'f' doesn't match.