def token_name(tokens, expected):
try:<EOL><INDENT>token = next(iter(tokens))<EOL><DEDENT>except StopIteration:<EOL><INDENT>return<EOL><DEDENT>if token and token.name == expected:<EOL><INDENT>return TokenMatch(None, token.value, (token,))<EOL><DEDENT>
Match a token name (type).