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.
@@ -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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tree-sitter-objectscript",
3
- "version": "1.9.10",
3
+ "version": "1.9.12",
4
4
  "description": "Tree Sitter Grammar for InterSystems ObjectScript",
5
5
  "scripts": {
6
6
  "install": "node-gyp-build",
@@ -36,7 +36,7 @@
36
36
  "node-gyp": "^12.1.0",
37
37
  "prebuildify": "^6.0.1",
38
38
  "tree-sitter": "^0.25.0",
39
- "tree-sitter-cli": "0.26.7"
39
+ "tree-sitter-cli": "^0.26.11"
40
40
  },
41
41
  "main": "bindings/node",
42
42
  "types": "bindings/node",
package/tree-sitter.json CHANGED
@@ -56,7 +56,7 @@
56
56
  }
57
57
  ],
58
58
  "metadata": {
59
- "version": "1.9.10",
59
+ "version": "1.9.12",
60
60
  "license": "MIT",
61
61
  "description": "ObjectScript grammars for tree-sitter",
62
62
  "namespace": "io.github.treesitter.objectscript",
@@ -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 ===
@@ -1974,10 +1974,6 @@
1974
1974
  "type": "macro",
1975
1975
  "named": true
1976
1976
  },
1977
- {
1978
- "type": "method_dot",
1979
- "named": true
1980
- },
1981
1977
  {
1982
1978
  "type": "oref_chain_segment",
1983
1979
  "named": true
@@ -2791,6 +2787,10 @@
2791
2787
  {
2792
2788
  "type": "method_args",
2793
2789
  "named": true
2790
+ },
2791
+ {
2792
+ "type": "routine_ref",
2793
+ "named": true
2794
2794
  }
2795
2795
  ]
2796
2796
  }
@@ -3279,10 +3279,6 @@
3279
3279
  "type": "macro",
3280
3280
  "named": true
3281
3281
  },
3282
- {
3283
- "type": "method_dot",
3284
- "named": true
3285
- },
3286
3282
  {
3287
3283
  "type": "oref_chain_segment",
3288
3284
  "named": true
@@ -3597,10 +3593,6 @@
3597
3593
  "type": "label_offset",
3598
3594
  "named": true
3599
3595
  },
3600
- {
3601
- "type": "lvn",
3602
- "named": true
3603
- },
3604
3596
  {
3605
3597
  "type": "numeric_literal",
3606
3598
  "named": true
@@ -3613,25 +3605,9 @@
3613
3605
  "type": "objectscript_identifier_special",
3614
3606
  "named": true
3615
3607
  },
3616
- {
3617
- "type": "routine_name",
3618
- "named": true
3619
- },
3620
3608
  {
3621
3609
  "type": "routine_ref",
3622
3610
  "named": true
3623
- },
3624
- {
3625
- "type": "string_literal",
3626
- "named": true
3627
- },
3628
- {
3629
- "type": "system_defined_function",
3630
- "named": true
3631
- },
3632
- {
3633
- "type": "system_defined_variable",
3634
- "named": true
3635
3611
  }
3636
3612
  ]
3637
3613
  }
@@ -7494,10 +7470,6 @@
7494
7470
  "type": "macro_value_line_with_continue",
7495
7471
  "named": true
7496
7472
  },
7497
- {
7498
- "type": "method_dot",
7499
- "named": true
7500
- },
7501
7473
  {
7502
7474
  "type": "mnemonic",
7503
7475
  "named": true