tree-sitter-objectscript 1.9.10 → 1.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/grammar.js +1 -1
- package/core/queries/highlights.scm +5 -1
- package/core/src/node-types.json +4 -32
- package/core/src/parser.c +15215 -15310
- package/core/src/tree_sitter/array.h +23 -17
- package/expr/grammar.js +1 -1
- package/expr/src/node-types.json +4 -20
- package/expr/src/parser.c +12124 -12238
- package/expr/src/tree_sitter/array.h +23 -17
- package/objectscript/src/node-types.json +4 -32
- package/objectscript/src/parser.c +10966 -11050
- package/objectscript/src/tree_sitter/array.h +23 -17
- package/objectscript_routine/queries/highlights.scm +5 -1
- package/objectscript_routine/src/node-types.json +4 -32
- package/objectscript_routine/src/parser.c +7745 -7831
- package/objectscript_routine/src/tree_sitter/array.h +23 -17
- package/package.json +2 -2
- package/prebuilds/darwin-arm64/tree-sitter-objectscript.node +0 -0
- package/prebuilds/darwin-x64/tree-sitter-objectscript.node +0 -0
- package/prebuilds/linux-arm64/tree-sitter-objectscript.node +0 -0
- package/prebuilds/linux-x64/tree-sitter-objectscript.node +0 -0
- package/prebuilds/win32-arm64/tree-sitter-objectscript.node +0 -0
- package/prebuilds/win32-x64/tree-sitter-objectscript.node +0 -0
- package/tree-sitter.json +1 -1
- package/udl/queries/highlights.scm +5 -1
- package/udl/src/node-types.json +4 -32
- package/udl/src/parser.c +10494 -10577
- package/udl/src/tree_sitter/array.h +23 -17
|
@@ -50,12 +50,18 @@ extern "C" {
|
|
|
50
50
|
/// memory allocated for the array's contents.
|
|
51
51
|
#define array_clear(self) ((self)->size = 0)
|
|
52
52
|
|
|
53
|
+
#ifdef __cplusplus
|
|
54
|
+
#define _array__cast(self, expr) (decltype((self)->contents))(expr)
|
|
55
|
+
#else
|
|
56
|
+
#define _array__cast(self, expr) (expr)
|
|
57
|
+
#endif
|
|
58
|
+
|
|
53
59
|
/// Reserve `new_capacity` elements of space in the array. If `new_capacity` is
|
|
54
60
|
/// less than the array's current capacity, this function has no effect.
|
|
55
|
-
#define array_reserve(self, new_capacity)
|
|
56
|
-
((self)->contents = _array__reserve(
|
|
57
|
-
(void *)(self)->contents, &(self)->capacity,
|
|
58
|
-
array_elem_size(self), new_capacity)
|
|
61
|
+
#define array_reserve(self, new_capacity) \
|
|
62
|
+
((self)->contents = _array__cast(self, _array__reserve( \
|
|
63
|
+
(void *)(self)->contents, &(self)->capacity, \
|
|
64
|
+
array_elem_size(self), new_capacity)) \
|
|
59
65
|
)
|
|
60
66
|
|
|
61
67
|
/// Free any memory allocated for this array. Note that this does not free any
|
|
@@ -71,10 +77,10 @@ extern "C" {
|
|
|
71
77
|
/// Push a new `element` onto the end of the array.
|
|
72
78
|
#define array_push(self, element) \
|
|
73
79
|
do { \
|
|
74
|
-
(self)->contents = _array__grow(
|
|
80
|
+
(self)->contents = _array__cast(self, _array__grow( \
|
|
75
81
|
(void *)(self)->contents, (self)->size, &(self)->capacity, \
|
|
76
82
|
1, array_elem_size(self) \
|
|
77
|
-
);
|
|
83
|
+
)); \
|
|
78
84
|
(self)->contents[(self)->size++] = (element); \
|
|
79
85
|
} while(0)
|
|
80
86
|
|
|
@@ -83,10 +89,10 @@ extern "C" {
|
|
|
83
89
|
#define array_grow_by(self, count) \
|
|
84
90
|
do { \
|
|
85
91
|
if ((count) == 0) break; \
|
|
86
|
-
(self)->contents = _array__grow(
|
|
92
|
+
(self)->contents = _array__cast(self, _array__grow( \
|
|
87
93
|
(self)->contents, (self)->size, &(self)->capacity, \
|
|
88
94
|
count, array_elem_size(self) \
|
|
89
|
-
);
|
|
95
|
+
)); \
|
|
90
96
|
memset((self)->contents + (self)->size, 0, (count) * array_elem_size(self)); \
|
|
91
97
|
(self)->size += (count); \
|
|
92
98
|
} while (0)
|
|
@@ -98,26 +104,26 @@ extern "C" {
|
|
|
98
104
|
/// Append `count` elements to the end of the array, reading their values from the
|
|
99
105
|
/// `contents` pointer.
|
|
100
106
|
#define array_extend(self, count, other_contents) \
|
|
101
|
-
(self)->contents = _array__splice(
|
|
107
|
+
((self)->contents = _array__cast(self, _array__splice( \
|
|
102
108
|
(void*)(self)->contents, &(self)->size, &(self)->capacity, \
|
|
103
109
|
array_elem_size(self), (self)->size, 0, count, other_contents \
|
|
104
|
-
)
|
|
110
|
+
)))
|
|
105
111
|
|
|
106
112
|
/// Remove `old_count` elements from the array starting at the given `index`. At
|
|
107
113
|
/// the same index, insert `new_count` new elements, reading their values from the
|
|
108
114
|
/// `new_contents` pointer.
|
|
109
115
|
#define array_splice(self, _index, old_count, new_count, new_contents) \
|
|
110
|
-
(self)->contents = _array__splice(
|
|
116
|
+
((self)->contents = _array__cast(self, _array__splice( \
|
|
111
117
|
(void *)(self)->contents, &(self)->size, &(self)->capacity, \
|
|
112
118
|
array_elem_size(self), _index, old_count, new_count, new_contents \
|
|
113
|
-
)
|
|
119
|
+
)))
|
|
114
120
|
|
|
115
121
|
/// Insert one `element` into the array at the given `index`.
|
|
116
122
|
#define array_insert(self, _index, element) \
|
|
117
|
-
(self)->contents = _array__splice(
|
|
123
|
+
((self)->contents = _array__cast(self, _array__splice( \
|
|
118
124
|
(void *)(self)->contents, &(self)->size, &(self)->capacity, \
|
|
119
125
|
array_elem_size(self), _index, 0, 1, &(element) \
|
|
120
|
-
)
|
|
126
|
+
)))
|
|
121
127
|
|
|
122
128
|
/// Remove one element from the array at the given `index`.
|
|
123
129
|
#define array_erase(self, _index) \
|
|
@@ -128,17 +134,17 @@ extern "C" {
|
|
|
128
134
|
|
|
129
135
|
/// Assign the contents of one array to another, reallocating if necessary.
|
|
130
136
|
#define array_assign(self, other) \
|
|
131
|
-
(self)->contents = _array__assign(
|
|
137
|
+
((self)->contents = _array__cast(self, _array__assign( \
|
|
132
138
|
(void *)(self)->contents, &(self)->size, &(self)->capacity, \
|
|
133
139
|
(const void *)(other)->contents, (other)->size, array_elem_size(self) \
|
|
134
|
-
)
|
|
140
|
+
)))
|
|
135
141
|
|
|
136
142
|
/// Swap one array with another
|
|
137
143
|
#define array_swap(self, other) \
|
|
138
144
|
do { \
|
|
139
145
|
void *_array_swap_tmp = (void *)(self)->contents; \
|
|
140
146
|
(self)->contents = (other)->contents; \
|
|
141
|
-
(other)->contents = _array_swap_tmp;
|
|
147
|
+
(other)->contents = _array__cast(other, _array_swap_tmp); \
|
|
142
148
|
_array__swap(&(self)->size, &(self)->capacity, \
|
|
143
149
|
&(other)->size, &(other)->capacity); \
|
|
144
150
|
} while (0)
|
|
@@ -1677,10 +1677,6 @@
|
|
|
1677
1677
|
"type": "macro",
|
|
1678
1678
|
"named": true
|
|
1679
1679
|
},
|
|
1680
|
-
{
|
|
1681
|
-
"type": "method_dot",
|
|
1682
|
-
"named": true
|
|
1683
|
-
},
|
|
1684
1680
|
{
|
|
1685
1681
|
"type": "oref_chain_segment",
|
|
1686
1682
|
"named": true
|
|
@@ -2460,6 +2456,10 @@
|
|
|
2460
2456
|
{
|
|
2461
2457
|
"type": "method_args",
|
|
2462
2458
|
"named": true
|
|
2459
|
+
},
|
|
2460
|
+
{
|
|
2461
|
+
"type": "routine_ref",
|
|
2462
|
+
"named": true
|
|
2463
2463
|
}
|
|
2464
2464
|
]
|
|
2465
2465
|
}
|
|
@@ -2638,10 +2638,6 @@
|
|
|
2638
2638
|
"type": "macro",
|
|
2639
2639
|
"named": true
|
|
2640
2640
|
},
|
|
2641
|
-
{
|
|
2642
|
-
"type": "method_dot",
|
|
2643
|
-
"named": true
|
|
2644
|
-
},
|
|
2645
2641
|
{
|
|
2646
2642
|
"type": "oref_chain_segment",
|
|
2647
2643
|
"named": true
|
|
@@ -2951,10 +2947,6 @@
|
|
|
2951
2947
|
"type": "label_offset",
|
|
2952
2948
|
"named": true
|
|
2953
2949
|
},
|
|
2954
|
-
{
|
|
2955
|
-
"type": "lvn",
|
|
2956
|
-
"named": true
|
|
2957
|
-
},
|
|
2958
2950
|
{
|
|
2959
2951
|
"type": "numeric_literal",
|
|
2960
2952
|
"named": true
|
|
@@ -2967,25 +2959,9 @@
|
|
|
2967
2959
|
"type": "objectscript_identifier_special",
|
|
2968
2960
|
"named": true
|
|
2969
2961
|
},
|
|
2970
|
-
{
|
|
2971
|
-
"type": "routine_name",
|
|
2972
|
-
"named": true
|
|
2973
|
-
},
|
|
2974
2962
|
{
|
|
2975
2963
|
"type": "routine_ref",
|
|
2976
2964
|
"named": true
|
|
2977
|
-
},
|
|
2978
|
-
{
|
|
2979
|
-
"type": "string_literal",
|
|
2980
|
-
"named": true
|
|
2981
|
-
},
|
|
2982
|
-
{
|
|
2983
|
-
"type": "system_defined_function",
|
|
2984
|
-
"named": true
|
|
2985
|
-
},
|
|
2986
|
-
{
|
|
2987
|
-
"type": "system_defined_variable",
|
|
2988
|
-
"named": true
|
|
2989
2965
|
}
|
|
2990
2966
|
]
|
|
2991
2967
|
}
|
|
@@ -5916,10 +5892,6 @@
|
|
|
5916
5892
|
"type": "macro_value_line_with_continue",
|
|
5917
5893
|
"named": true
|
|
5918
5894
|
},
|
|
5919
|
-
{
|
|
5920
|
-
"type": "method_dot",
|
|
5921
|
-
"named": true
|
|
5922
|
-
},
|
|
5923
5895
|
{
|
|
5924
5896
|
"type": "mnemonic",
|
|
5925
5897
|
"named": true
|