#NEWLINE# def consume( self , expected_token ) : #NEWLINE# #INDENT# "Consumes the next token which must match expectation.\n\n    Args:\n      expected_token: the expected value of the next token.\n\n    Raises:\n      ValueError: raised when the next token doesn't match expected_token.\n    " #NEWLINE# token = self . next ( ) #NEWLINE# if ( token != expected_token ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Expect "%s" but got "%s" at offset %d' % ( expected_token , token , self . index ) ) )