from enum import Enum


# pylint: disable=invalid-name


class NodeTag(Enum):
    """
    Bindings to the Zig `std.zig.Ast.Node.Tag` enum.
    Ref: https://github.com/ziglang/zig/blob/0.14.1/lib/std/zig/Ast.zig#L3038

    These enum values correspond to the numeric values returned by Zig parsing API.
    """
    ROOT = 0
    USING_NAMESPACE = 1
    TEST_DECL = 2
    GLOBAL_VAR_DECL = 3
    LOCAL_VAR_DECL = 4
    SIMPLE_VAR_DECL = 5
    ALIGNED_VAR_DECL = 6
    ERRDEFER = 7
    DEFER = 8
    CATCH = 9
    FIELD_ACCESS = 10
    UNWRAP_OPTIONAL = 11
    EQUAL_EQUAL = 12
    BANG_EQUAL = 13
    LESS_THAN = 14
    GREATER_THAN = 15
    LESS_OR_EQUAL = 16
    GREATER_OR_EQUAL = 17
    ASSIGN_MUL = 18
    ASSIGN_DIV = 19
    ASSIGN_MOD = 20
    ASSIGN_ADD = 21
    ASSIGN_SUB = 22
    ASSIGN_SHL = 23
    ASSIGN_SHL_SAT = 24
    ASSIGN_SHR = 25
    ASSIGN_BIT_AND = 26
    ASSIGN_BIT_XOR = 27
    ASSIGN_BIT_OR = 28
    ASSIGN_MUL_WRAP = 29
    ASSIGN_ADD_WRAP = 30
    ASSIGN_SUB_WRAP = 31
    ASSIGN_MUL_SAT = 32
    ASSIGN_ADD_SAT = 33
    ASSIGN_SUB_SAT = 34
    ASSIGN = 35
    ASSIGN_DESTRUCTURE = 36
    MERGE_ERROR_SETS = 37
    MUL = 38
    DIV = 39
    MOD = 40
    ARRAY_MULT = 41
    MUL_WRAP = 42
    MUL_SAT = 43
    ADD = 44
    SUB = 45
    ARRAY_CAT = 46
    ADD_WRAP = 47
    SUB_WRAP = 48
    ADD_SAT = 49
    SUB_SAT = 50
    SHL = 51
    SHL_SAT = 52
    SHR = 53
    BIT_AND = 54
    BIT_XOR = 55
    BIT_OR = 56
    ORELSE = 57
    BOOL_AND = 58
    BOOL_OR = 59
    BOOL_NOT = 60
    NEGATION = 61
    BIT_NOT = 62
    NEGATION_WRAP = 63
    ADDRESS_OF = 64
    TRY = 65
    AWAIT = 66
    OPTIONAL_TYPE = 67
    ARRAY_TYPE = 68
    ARRAY_TYPE_SENTINEL = 69
    PTR_TYPE_ALIGNED = 70
    PTR_TYPE_SENTINEL = 71
    PTR_TYPE = 72
    PTR_TYPE_BIT_RANGE = 73
    SLICE_OPEN = 74
    SLICE = 75
    SLICE_SENTINEL = 76
    DEREF = 77
    ARRAY_ACCESS = 78
    ARRAY_INIT_ONE = 79
    ARRAY_INIT_ONE_COMMA = 80
    ARRAY_INIT_DOT_TWO = 81
    ARRAY_INIT_DOT_TWO_COMMA = 82
    ARRAY_INIT_DOT = 83
    ARRAY_INIT_DOT_COMMA = 84
    ARRAY_INIT = 85
    ARRAY_INIT_COMMA = 86
    STRUCT_INIT_ONE = 87
    STRUCT_INIT_ONE_COMMA = 88
    STRUCT_INIT_DOT_TWO = 89
    STRUCT_INIT_DOT_TWO_COMMA = 90
    STRUCT_INIT_DOT = 91
    STRUCT_INIT_DOT_COMMA = 92
    STRUCT_INIT = 93
    STRUCT_INIT_COMMA = 94
    CALL_ONE = 95
    CALL_ONE_COMMA = 96
    ASYNC_CALL_ONE = 97
    ASYNC_CALL_ONE_COMMA = 98
    CALL = 99
    CALL_COMMA = 100
    ASYNC_CALL = 101
    ASYNC_CALL_COMMA = 102
    SWITCH = 103
    SWITCH_COMMA = 104
    SWITCH_CASE_ONE = 105
    SWITCH_CASE_INLINE_ONE = 106
    SWITCH_CASE = 107
    SWITCH_CASE_INLINE = 108
    SWITCH_RANGE = 109
    WHILE_SIMPLE = 110
    WHILE_CONT = 111
    WHILE = 112
    FOR_SIMPLE = 113
    FOR = 114
    FOR_RANGE = 115
    IF_SIMPLE = 116
    IF = 117
    SUSPEND = 118
    RESUME = 119
    CONTINUE = 120
    BREAK = 121
    RETURN = 122
    FN_PROTO_SIMPLE = 123
    FN_PROTO_MULTI = 124
    FN_PROTO_ONE = 125
    FN_PROTO = 126
    FN_DECL = 127
    ANYFRAME_TYPE = 128
    ANYFRAME_LITERAL = 129
    CHAR_LITERAL = 130
    NUMBER_LITERAL = 131
    UNREACHABLE_LITERAL = 132
    IDENTIFIER = 133
    ENUM_LITERAL = 134
    STRING_LITERAL = 135
    MULTILINE_STRING_LITERAL = 136
    GROUPED_EXPRESSION = 137
    BUILTIN_CALL_TWO = 138
    BUILTIN_CALL_TWO_COMMA = 139
    BUILTIN_CALL = 140
    BUILTIN_CALL_COMMA = 141
    ERROR_SET_DECL = 142
    CONTAINER_DECL = 143
    CONTAINER_DECL_TRAILING = 144
    CONTAINER_DECL_TWO = 145
    CONTAINER_DECL_TWO_TRAILING = 146
    CONTAINER_DECL_ARG = 147
    CONTAINER_DECL_ARG_TRAILING = 148
    TAGGED_UNION = 149
    TAGGED_UNION_TRAILING = 150
    TAGGED_UNION_TWO = 151
    TAGGED_UNION_TWO_TRAILING = 152
    TAGGED_UNION_ENUM_TAG = 153
    TAGGED_UNION_ENUM_TAG_TRAILING = 154
    CONTAINER_FIED_INIT = 155
    CONTAINER_FIELD_ALIGN = 156
    CONTAINER_FIELD = 157
    COMPTIME = 158
    NOSUSPEND = 159
    BLOCK_TWO = 160
    BLOCK_TWO_SEMICOLON = 161
    BLOCK = 162
    BLOCK_SEMICOLON = 163
    ASM_SIMPLE = 164
    ASM = 165
    ASM_OUTPUT = 166
    ASM_INPUT = 167
    ERROR_VALUE = 168
    ERROR_UNION = 169


class TokenTag(Enum):
    """
    Bindings to the Zig `std.zig.tokenizer.Token.Tag` enum.
    Ref: https://github.com/ziglang/zig/blob/0.14.1/lib/std/zig/tokenizer.zig#L68
    """
    INVALID = 0
    INVALID_PERIODASTERISKS = 1
    IDENTIFIER = 2
    STRING_LITERAL = 3
    MULTILINE_STRING_LITERAL_LINE = 4
    CHAR_LITERAL = 5
    EOF = 6
    BUILTIN = 7
    BANG = 8
    PIPE = 9
    PIPE_PIPE = 10
    PIPE_EQUAL = 11
    EQUAL = 12
    EQUAL_EQUAL = 13
    EQUAL_ANGLE_BRACKET_RIGHT = 14
    BANG_EQUAL = 15
    L_PAREN = 16
    R_PAREN = 17
    SEMICOLON = 18
    PERCENT = 19
    PERCENT_EQUAL = 20
    L_BRACE = 21
    R_BRACE = 22
    L_BRACKET = 23
    R_BRACKET = 24
    PERIOD = 25
    PERIOD_ASTERISK = 26
    ELLIPSIS2 = 27
    ELLIPSIS3 = 28
    CARET = 29
    CARET_EQUAL = 30
    PLUS = 31
    PLUS_PLUS = 32
    PLUS_EQUAL = 33
    PLUS_PERCENT = 34
    PLUS_PERCENT_EQUAL = 35
    PLUS_PIPE = 36
    PLUS_PIPE_EQUAL = 37
    MINUS = 38
    MINUS_EQUAL = 39
    MINUS_PERCENT = 40
    MINUS_PERCENT_EQUAL = 41
    MINUS_PIPE = 42
    MINUS_PIPE_EQUAL = 43
    ASTERISK = 44
    ASTERISK_EQUAL = 45
    ASTERISK_ASTERISK = 46
    ASTERISK_PERCENT = 47
    ASTERISK_PERCENT_EQUAL = 48
    ASTERISK_PIPE = 49
    ASTERISK_PIPE_EQUAL = 50
    ARROW = 51
    COLON = 52
    SLASH = 53
    SLASH_EQUAL = 54
    COMMA = 55
    AMPERSAND = 56
    AMPERSAND_EQUAL = 57
    QUESTION_MARK = 58
    ANGLE_BRACKET_LEFT = 59
    ANGLE_BRACKET_LEFT_EQUAL = 60
    ANGLE_BRACKET_ANGLE_BRACKET_LEFT = 61
    ANGLE_BRACKET_ANGLE_BRACKET_LEFT_EQUAL = 62
    ANGLE_BRACKET_ANGLE_BRACKET_LEFT_PIPE = 63
    ANGLE_BRACKET_ANGLE_BRACKET_LEFT_PIPE_EQUAL = 64
    ANGLE_BRACKET_RIGHT = 65
    ANGLE_BRACKET_RIGHT_EQUAL = 66
    ANGLE_BRACKET_ANGLE_BRACKET_RIGHT = 67
    ANGLE_BRACKET_ANGLE_BRACKET_RIGHT_EQUAL = 68
    TILDE = 69
    NUMBER_LITERAL = 70
    DOC_COMMENT = 71
    CONTAINER_DOC_COMMENT = 72
    KEYWORD_ADDRSPACE = 73
    KEYWORD_ALIGN = 74
    KEYWORD_ALLOWZERO = 75
    KEYWORD_AND = 76
    KEYWORD_ANYFRAME = 77
    KEYWORD_ANYTYPE = 78
    KEYWORD_ASM = 79
    KEYWORD_ASYNC = 80
    KEYWORD_AWAIT = 81
    KEYWORD_BREAK = 82
    KEYWORD_CALLCONV = 83
    KEYWORD_CATCH = 84
    KEYWORD_COMPTIME = 85
    KEYWORD_CONST = 86
    KEYWORD_CONTINUE = 87
    KEYWORD_DEFER = 88
    KEYWORD_ELSE = 89
    KEYWORD_ENUM = 90
    KEYWORD_ERRDEFER = 91
    KEYWORD_ERROR = 92
    KEYWORD_EXPORT = 93
    KEYWORD_EXTERN = 94
    KEYWORD_FN = 95
    KEYWORD_FOR = 96
    KEYWORD_IF = 97
    KEYWORD_INLINE = 98
    KEYWORD_NOALIAS = 99
    KEYWORD_NOINLINE = 100
    KEYWORD_NOSUSPEND = 101
    KEYWORD_OPAQUE = 102
    KEYWORD_OR = 103
    KEYWORD_ORELSE = 104
    KEYWORD_PACKED = 105
    KEYWORD_PUB = 106
    KEYWORD_RESUME = 107
    KEYWORD_RETURN = 108
    KEYWORD_LINKSECTION = 109
    KEYWORD_STRUCT = 110
    KEYWORD_SUSPEND = 111
    KEYWORD_SWITCH = 112
    KEYWORD_TEST = 113
    KEYWORD_THREADLOCAL = 114
    KEYWORD_TRY = 115
    KEYWORD_UNION = 116
    KEYWORD_UNREACHABLE = 117
    KEYWORD_USINGNAMESPACE = 118
    KEYWORD_VAR = 119
    KEYWORD_VOLATILE = 120
    KEYWORD_WHILE = 121


class ErrorTag(Enum):
    """
    Bindings to the Zig `std.zig.Ast.Error.Tag` enum.
    Ref: https://github.com/ziglang/zig/blob/0.14.1/lib/std/zig/Ast.zig#L2950

    These enum values correspond to the error tag identifiers returned by the Zig parser.
    Used to indicate specific kinds of syntax or semantic errors encountered during parsing.
    """
    ASTERISK_AFTER_PTR_DEREF = 0
    CHAINED_COMPARISON_OPERATORS = 1
    DECL_BETWEEN_FIELDS = 2
    EXPECTED_BLOCK = 3
    EXPECTED_BLOCK_OR_ASSIGNMENT = 4
    EXPECTED_BLOCK_OR_EXPR = 5
    EXPECTED_BLOCK_OR_FIELD = 6
    EXPECTED_CONTAINER_MEMBERS = 7
    EXPECTED_EXPR = 8
    EXPECTED_EXPR_OR_ASSIGNMENT = 9
    EXPECTED_EXPR_OR_VAR_DECL = 10
    EXPECTED_FN = 11
    EXPECTED_INLINABLE = 12
    EXPECTED_LABELABLE = 13
    EXPECTED_PARAM_LIST = 14
    EXPECTED_PREFIX_EXPR = 15
    EXPECTED_PRIMARY_TYPE_EXPR = 16
    EXPECTED_PUB_ITEM = 17
    EXPECTED_RETURN_TYPE = 18
    EXPECTED_SEMI_OR_ELSE = 19
    EXPECTED_SEMI_OR_LBRACE = 20
    EXPECTED_STATEMENT = 21
    EXPECTED_SUFFIX_OP = 22
    EXPECTED_TYPE_EXPR = 23
    EXPECTED_VAR_DECL = 24
    EXPECTED_VAR_DECL_OR_FN = 25
    EXPECTED_LOOP_PAYLOAD = 26
    EXPECTED_CONTAINER = 27
    EXTERN_FN_BODY = 28
    EXTRA_ADDRSPACE_QUALIFIER = 29
    EXTRA_ALIGN_QUALIFIER = 30
    EXTRA_ALLOWZERO_QUALIFIER = 31
    EXTRA_CONST_QUALIFIER = 32
    EXTRA_VOLATILE_QUALIFIER = 33
    PTR_MOD_ON_ARRAY_CHILD_TYPE = 34
    INVALID_BIT_RANGE = 35
    SAME_LINE_DOC_COMMENT = 36
    UNATTACHED_DOC_COMMENT = 37
    TEST_DOC_COMMENT = 38
    COMPTIME_DOC_COMMENT = 39
    VARARGS_NONFINAL = 40
    EXPECTED_CONTINUE_EXPR = 41
    EXPECTED_SEMI_AFTER_DECL = 42
    EXPECTED_SEMI_AFTER_STMT = 43
    EXPECTED_COMMA_AFTER_FIELD = 44
    EXPECTED_COMMA_AFTER_ARG = 45
    EXPECTED_COMMA_AFTER_PARAM = 46
    EXPECTED_COMMA_AFTER_INITIALIZER = 47
    EXPECTED_COMMA_AFTER_SWITCH_PRONG = 48
    EXPECTED_COMMA_AFTER_FOR_OPERAND = 49
    EXPECTED_COMMA_AFTER_CAPTURE = 50
    EXPECTED_INITIALIZER = 51
    MISMATCHED_BINARY_OP_WHITESPACE = 52
    INVALID_AMPERSAND_AMPERSAND = 53
    C_STYLE_CONTAINER = 54
    EXPECTED_VAR_CONST = 55
    WRONG_EQUAL_VAR_DECL = 56
    VAR_CONST_DECL = 57
    EXTRA_FOR_CAPTURE = 58
    FOR_INPUT_NOT_CAPTURED = 59
    ZIG_STYLE_CONTAINER = 60
    PREVIOUS_FIELD = 61
    NEXT_FIELD = 62
    EXPECTED_TOKEN = 63
    INVALID_BYTE = 64


class PrimitiveType(Enum):
    """
    Bindings for Zig primitive types.
    Ref: https://ziglang.org/documentation/0.14.1/#Primitive-Types
    """
    i8 = "i8"
    i16 = "i16"
    i32 = "i32"
    i64 = "i64"
    i128 = "i128"

    u8 = "u8"
    u16 = "u16"
    u32 = "u32"
    u64 = "u64"
    u128 = "u128"

    isize = "isize"
    usize = "usize"

    c_char = "c_char"
    c_short = "c_short"
    c_ushort = "c_ushort"

    c_int = "c_int"
    c_uint = "c_uint"
    c_long = "c_long"
    c_ulong = "c_ulong"

    c_longlong = "c_longlong"
    c_ulonglong = "c_ulonglong"
    c_longdouble = "c_longdouble"

    f16 = "f16"
    f32 = "f32"
    f64 = "f64"
    f80 = "f80"
    f128 = "f128"

    bool = "bool"
    anyopaque = "anyopaque"
    void = "void"
    noreturn = "noreturn"
    type = "type"
    anyerror = "anyerror"
    comptime_int = "comptime_int"
    comptime_float = "comptime_float"
