If the next token is of the given kind, return true after advancing
    the parser. Otherwise, do not change the parser state
    and throw an error.

def skip(parser, kind):
    # type: (Parser, int) -> bool
    """If the next token is of the given kind, return true after advancing
    the parser. Otherwise, do not change the parser state
    and throw an error."""
    match = parser.token.kind == kind
    if match:
        advance(parser)

    return match