def METHOD_NAME(record_str: str, type_spec: str) -> typing.Tuple[typing.Any]:
    """
    Parse a record entry using a type spec generator
    """
    record_types = {"stack_var": "BaseReg:s:register,StackPos:i:number"}
    type_name = type_spec.split(":")[2]
    type_spec = record_types[type_name]
    # strip brackets
    record_str = record_str.strip("[]")
    field_types = type_spec.split(",")
    parsed_fields = []
    # we can't just split the fields by ", " since there might be nested
    # records.
    for i, t in enumerate(field_types):
        if i == len(field_types) - 1:
            field = record_str
            record_str = ""
        else:
            field, record_str = record_str.split(", ", 1)
        parsed_fields.append(parse_field(field, t))
    return tuple(parsed_fields)