def grid_line(tokens):
    """``grid-[row|column]-[start—end]`` properties validation."""
    if len(tokens) == 1:
        token = tokens[0]
        if keyword := get_keyword(token):
            if keyword == 'auto':
                return keyword
            elif keyword != 'span':
                return (None, None, token.value)
        elif token.type == 'number' and token.is_integer and token.value:
            return (None, token.int_value, None)
        return
    number = ident = span = None
    for token in tokens:
        if keyword := get_keyword(token):
            if keyword == 'auto':
                return
            if keyword == 'span':
                if span is None:
                    span = 'span'
                    continue
            elif keyword and ident is None:
                ident = token.value
                continue
        elif token.type == 'number' and token.is_integer and token.value:
            if number is None:
                number = token.int_value
                continue
        return
    if span:
        if number and number < 0:
            return
        elif ident or number:
            return (span, number, ident)
    elif number:
        return (span, number, ident)
``grid-[row|column]-[start—end]`` properties validation.
weasyprint/css/validation/properties.py