tree-sitter-objectscript 1.9.11 → 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.
@@ -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)
@@ -292,7 +292,11 @@
292
292
  (variable_datatype
293
293
  "." @function.builtin)
294
294
 
295
- (method_dot) @function.builtin
295
+ (do_parameter
296
+ "." @function.builtin)
297
+
298
+ (job_argument
299
+ "." @function.builtin)
296
300
 
297
301
  ; === END CORE ===
298
302
  ; === BEGIN LOCAL ===
@@ -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
@@ -2642,10 +2638,6 @@
2642
2638
  "type": "macro",
2643
2639
  "named": true
2644
2640
  },
2645
- {
2646
- "type": "method_dot",
2647
- "named": true
2648
- },
2649
2641
  {
2650
2642
  "type": "oref_chain_segment",
2651
2643
  "named": true
@@ -5900,10 +5892,6 @@
5900
5892
  "type": "macro_value_line_with_continue",
5901
5893
  "named": true
5902
5894
  },
5903
- {
5904
- "type": "method_dot",
5905
- "named": true
5906
- },
5907
5895
  {
5908
5896
  "type": "mnemonic",
5909
5897
  "named": true