diff --git a/include/tree_sitter/parser.h b/include/tree_sitter/parser.h index 40d7c5fc..ef530434 100644 --- a/include/tree_sitter/parser.h +++ b/include/tree_sitter/parser.h @@ -92,7 +92,7 @@ ts_parser constructor_name() { \ /* * Stack */ -typedef int state_id; +typedef short state_id; typedef struct { size_t size; struct { @@ -187,10 +187,10 @@ typedef enum { typedef struct { ts_parse_action_type type; union { - state_id to_state; + int to_state; struct { ts_symbol symbol; - int child_count; + unsigned short child_count; }; } data; } ts_parse_action; diff --git a/include/tree_sitter/runtime.h b/include/tree_sitter/runtime.h index 4d9a8ddc..f2dbb09f 100644 --- a/include/tree_sitter/runtime.h +++ b/include/tree_sitter/runtime.h @@ -7,7 +7,7 @@ extern "C" { #include -typedef unsigned int ts_symbol; +typedef unsigned short ts_symbol; #define ts_builtin_sym_error 0 #define ts_builtin_sym_end 1