@herb-tools/node 0.8.0 → 0.8.1
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/dist/herb-node.esm.js +1 -1
- package/extension/error_helpers.cpp +1 -1
- package/extension/error_helpers.h +1 -1
- package/extension/libherb/analyze.c +137 -41
- package/extension/libherb/analyze_helpers.c +12 -4
- package/extension/libherb/analyze_missing_end.c +1 -1
- package/extension/libherb/analyze_transform.c +1 -1
- package/extension/libherb/ast_nodes.c +1 -1
- package/extension/libherb/ast_nodes.h +1 -1
- package/extension/libherb/ast_pretty_print.c +1 -1
- package/extension/libherb/ast_pretty_print.h +1 -1
- package/extension/libherb/errors.c +1 -1
- package/extension/libherb/errors.h +1 -1
- package/extension/libherb/include/ast_nodes.h +1 -1
- package/extension/libherb/include/ast_pretty_print.h +1 -1
- package/extension/libherb/include/errors.h +1 -1
- package/extension/libherb/include/util/hb_buffer.h +0 -1
- package/extension/libherb/include/version.h +1 -1
- package/extension/libherb/parser.c +3 -5
- package/extension/libherb/parser_match_tags.c +1 -1
- package/extension/libherb/util/hb_buffer.c +0 -9
- package/extension/libherb/util/hb_buffer.h +0 -1
- package/extension/libherb/version.h +1 -1
- package/extension/libherb/visitor.c +1 -1
- package/extension/nodes.cpp +1 -1
- package/extension/nodes.h +1 -1
- package/package.json +2 -2
package/dist/herb-node.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/javascript/packages/node/extension/error_helpers.cpp.erb
|
|
3
3
|
|
|
4
4
|
#include <node_api.h>
|
|
5
5
|
#include "error_helpers.h"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/javascript/packages/node/extension/error_helpers.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_EXTENSION_ERRORS_H
|
|
5
5
|
#define HERB_EXTENSION_ERRORS_H
|
|
@@ -90,6 +90,138 @@ static size_t process_subsequent_block(
|
|
|
90
90
|
control_type_t parent_type
|
|
91
91
|
);
|
|
92
92
|
|
|
93
|
+
typedef struct {
|
|
94
|
+
control_type_t type;
|
|
95
|
+
uint32_t offset;
|
|
96
|
+
bool found;
|
|
97
|
+
} earliest_control_keyword_t;
|
|
98
|
+
|
|
99
|
+
typedef struct {
|
|
100
|
+
earliest_control_keyword_t* result;
|
|
101
|
+
const uint8_t* source_start;
|
|
102
|
+
} location_walker_context_t;
|
|
103
|
+
|
|
104
|
+
static bool find_earliest_control_keyword_walker(const pm_node_t* node, void* data) {
|
|
105
|
+
if (!node) { return true; }
|
|
106
|
+
|
|
107
|
+
location_walker_context_t* context = (location_walker_context_t*) data;
|
|
108
|
+
earliest_control_keyword_t* result = context->result;
|
|
109
|
+
|
|
110
|
+
control_type_t current_type = CONTROL_TYPE_UNKNOWN;
|
|
111
|
+
uint32_t keyword_offset = UINT32_MAX;
|
|
112
|
+
|
|
113
|
+
switch (node->type) {
|
|
114
|
+
case PM_IF_NODE: {
|
|
115
|
+
pm_if_node_t* if_node = (pm_if_node_t*) node;
|
|
116
|
+
current_type = CONTROL_TYPE_IF;
|
|
117
|
+
keyword_offset = (uint32_t) (if_node->if_keyword_loc.start - context->source_start);
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
case PM_UNLESS_NODE: {
|
|
122
|
+
pm_unless_node_t* unless_node = (pm_unless_node_t*) node;
|
|
123
|
+
current_type = CONTROL_TYPE_UNLESS;
|
|
124
|
+
keyword_offset = (uint32_t) (unless_node->keyword_loc.start - context->source_start);
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
case PM_CASE_NODE: {
|
|
129
|
+
pm_case_node_t* case_node = (pm_case_node_t*) node;
|
|
130
|
+
current_type = CONTROL_TYPE_CASE;
|
|
131
|
+
keyword_offset = (uint32_t) (case_node->case_keyword_loc.start - context->source_start);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
case PM_CASE_MATCH_NODE: {
|
|
136
|
+
pm_case_match_node_t* case_match_node = (pm_case_match_node_t*) node;
|
|
137
|
+
current_type = CONTROL_TYPE_CASE_MATCH;
|
|
138
|
+
keyword_offset = (uint32_t) (case_match_node->case_keyword_loc.start - context->source_start);
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
case PM_WHILE_NODE: {
|
|
143
|
+
pm_while_node_t* while_node = (pm_while_node_t*) node;
|
|
144
|
+
current_type = CONTROL_TYPE_WHILE;
|
|
145
|
+
keyword_offset = (uint32_t) (while_node->keyword_loc.start - context->source_start);
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
case PM_UNTIL_NODE: {
|
|
150
|
+
pm_until_node_t* until_node = (pm_until_node_t*) node;
|
|
151
|
+
current_type = CONTROL_TYPE_UNTIL;
|
|
152
|
+
keyword_offset = (uint32_t) (until_node->keyword_loc.start - context->source_start);
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
case PM_FOR_NODE: {
|
|
157
|
+
pm_for_node_t* for_node = (pm_for_node_t*) node;
|
|
158
|
+
current_type = CONTROL_TYPE_FOR;
|
|
159
|
+
keyword_offset = (uint32_t) (for_node->for_keyword_loc.start - context->source_start);
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
case PM_BEGIN_NODE: {
|
|
164
|
+
pm_begin_node_t* begin_node = (pm_begin_node_t*) node;
|
|
165
|
+
current_type = CONTROL_TYPE_BEGIN;
|
|
166
|
+
|
|
167
|
+
if (begin_node->begin_keyword_loc.start != NULL) {
|
|
168
|
+
keyword_offset = (uint32_t) (begin_node->begin_keyword_loc.start - context->source_start);
|
|
169
|
+
} else {
|
|
170
|
+
keyword_offset = (uint32_t) (node->location.start - context->source_start);
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
case PM_YIELD_NODE: {
|
|
176
|
+
current_type = CONTROL_TYPE_YIELD;
|
|
177
|
+
keyword_offset = (uint32_t) (node->location.start - context->source_start);
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
case PM_CALL_NODE: {
|
|
182
|
+
pm_call_node_t* call = (pm_call_node_t*) node;
|
|
183
|
+
|
|
184
|
+
if (call->block != NULL) {
|
|
185
|
+
current_type = CONTROL_TYPE_BLOCK;
|
|
186
|
+
keyword_offset = (uint32_t) (node->location.start - context->source_start);
|
|
187
|
+
}
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
case PM_NEXT_NODE:
|
|
192
|
+
case PM_BREAK_NODE:
|
|
193
|
+
case PM_RETURN_NODE: {
|
|
194
|
+
current_type = CONTROL_TYPE_UNKNOWN;
|
|
195
|
+
keyword_offset = (uint32_t) (node->location.start - context->source_start);
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
default: break;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (keyword_offset != UINT32_MAX) {
|
|
203
|
+
if (!result->found || keyword_offset < result->offset) {
|
|
204
|
+
result->type = current_type;
|
|
205
|
+
result->offset = keyword_offset;
|
|
206
|
+
result->found = true;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
static control_type_t find_earliest_control_keyword(pm_node_t* root, const uint8_t* source_start) {
|
|
214
|
+
if (!root) { return CONTROL_TYPE_UNKNOWN; }
|
|
215
|
+
|
|
216
|
+
earliest_control_keyword_t result = { .type = CONTROL_TYPE_UNKNOWN, .offset = UINT32_MAX, .found = false };
|
|
217
|
+
|
|
218
|
+
location_walker_context_t context = { .result = &result, .source_start = source_start };
|
|
219
|
+
|
|
220
|
+
pm_visit_node(root, find_earliest_control_keyword_walker, &context);
|
|
221
|
+
|
|
222
|
+
return result.found ? result.type : CONTROL_TYPE_UNKNOWN;
|
|
223
|
+
}
|
|
224
|
+
|
|
93
225
|
static control_type_t detect_control_type(AST_ERB_CONTENT_NODE_T* erb_node) {
|
|
94
226
|
if (!erb_node || erb_node->base.type != AST_ERB_CONTENT_NODE) { return CONTROL_TYPE_UNKNOWN; }
|
|
95
227
|
|
|
@@ -99,26 +231,18 @@ static control_type_t detect_control_type(AST_ERB_CONTENT_NODE_T* erb_node) {
|
|
|
99
231
|
|
|
100
232
|
if (ruby->valid) { return CONTROL_TYPE_UNKNOWN; }
|
|
101
233
|
|
|
102
|
-
|
|
103
|
-
|
|
234
|
+
pm_node_t* root = ruby->root;
|
|
235
|
+
|
|
104
236
|
if (has_elsif_node(ruby)) { return CONTROL_TYPE_ELSIF; }
|
|
105
237
|
if (has_else_node(ruby)) { return CONTROL_TYPE_ELSE; }
|
|
106
238
|
if (has_end(ruby)) { return CONTROL_TYPE_END; }
|
|
107
|
-
if (has_case_node(ruby)) { return CONTROL_TYPE_CASE; }
|
|
108
|
-
if (has_case_match_node(ruby)) { return CONTROL_TYPE_CASE_MATCH; }
|
|
109
239
|
if (has_when_node(ruby)) { return CONTROL_TYPE_WHEN; }
|
|
110
240
|
if (has_in_node(ruby)) { return CONTROL_TYPE_IN; }
|
|
111
|
-
if (has_begin_node(ruby)) { return CONTROL_TYPE_BEGIN; }
|
|
112
241
|
if (has_rescue_node(ruby)) { return CONTROL_TYPE_RESCUE; }
|
|
113
242
|
if (has_ensure_node(ruby)) { return CONTROL_TYPE_ENSURE; }
|
|
114
|
-
if (has_unless_node(ruby)) { return CONTROL_TYPE_UNLESS; }
|
|
115
|
-
if (has_while_node(ruby)) { return CONTROL_TYPE_WHILE; }
|
|
116
|
-
if (has_until_node(ruby)) { return CONTROL_TYPE_UNTIL; }
|
|
117
|
-
if (has_for_node(ruby)) { return CONTROL_TYPE_FOR; }
|
|
118
243
|
if (has_block_closing(ruby)) { return CONTROL_TYPE_BLOCK_CLOSE; }
|
|
119
|
-
if (has_yield_node(ruby)) { return CONTROL_TYPE_YIELD; }
|
|
120
244
|
|
|
121
|
-
return
|
|
245
|
+
return find_earliest_control_keyword(root, ruby->parser.start);
|
|
122
246
|
}
|
|
123
247
|
|
|
124
248
|
static bool is_subsequent_type(control_type_t parent_type, control_type_t child_type) {
|
|
@@ -515,21 +639,7 @@ static size_t process_control_structure(
|
|
|
515
639
|
|
|
516
640
|
index++;
|
|
517
641
|
|
|
518
|
-
|
|
519
|
-
AST_NODE_T* child = hb_array_get(array, index);
|
|
520
|
-
|
|
521
|
-
if (!child) { break; }
|
|
522
|
-
|
|
523
|
-
if (child->type == AST_ERB_CONTENT_NODE) {
|
|
524
|
-
AST_ERB_CONTENT_NODE_T* child_erb = (AST_ERB_CONTENT_NODE_T*) child;
|
|
525
|
-
control_type_t child_type = detect_control_type(child_erb);
|
|
526
|
-
|
|
527
|
-
if (child_type == CONTROL_TYPE_END) { break; }
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
hb_array_append(else_children, child);
|
|
531
|
-
index++;
|
|
532
|
-
}
|
|
642
|
+
index = process_block_children(node, array, index, else_children, context, initial_type);
|
|
533
643
|
|
|
534
644
|
hb_array_T* else_errors = next_erb->base.errors;
|
|
535
645
|
next_erb->base.errors = NULL;
|
|
@@ -677,21 +787,7 @@ static size_t process_control_structure(
|
|
|
677
787
|
|
|
678
788
|
index++;
|
|
679
789
|
|
|
680
|
-
|
|
681
|
-
AST_NODE_T* child = hb_array_get(array, index);
|
|
682
|
-
|
|
683
|
-
if (!child) { break; }
|
|
684
|
-
|
|
685
|
-
if (child->type == AST_ERB_CONTENT_NODE) {
|
|
686
|
-
AST_ERB_CONTENT_NODE_T* child_erb = (AST_ERB_CONTENT_NODE_T*) child;
|
|
687
|
-
control_type_t child_type = detect_control_type(child_erb);
|
|
688
|
-
|
|
689
|
-
if (child_type == CONTROL_TYPE_ENSURE || child_type == CONTROL_TYPE_END) { break; }
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
hb_array_append(else_children, child);
|
|
693
|
-
index++;
|
|
694
|
-
}
|
|
790
|
+
index = process_block_children(node, array, index, else_children, context, initial_type);
|
|
695
791
|
|
|
696
792
|
hb_array_T* else_errors = next_erb->base.errors;
|
|
697
793
|
next_erb->base.errors = NULL;
|
|
@@ -110,12 +110,20 @@ bool search_block_nodes(const pm_node_t* node, void* data) {
|
|
|
110
110
|
analyzed_ruby_T* analyzed = (analyzed_ruby_T*) data;
|
|
111
111
|
|
|
112
112
|
if (node->type == PM_BLOCK_NODE) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
pm_block_node_t* block_node = (pm_block_node_t*) node;
|
|
114
|
+
|
|
115
|
+
size_t opening_length = block_node->opening_loc.end - block_node->opening_loc.start;
|
|
116
|
+
|
|
117
|
+
if ((opening_length == 2 && block_node->opening_loc.start[0] == 'd' && block_node->opening_loc.start[1] == 'o')
|
|
118
|
+
|| (opening_length == 1 && block_node->opening_loc.start[0] == '{')) {
|
|
119
|
+
analyzed->has_block_node = true;
|
|
120
|
+
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
117
123
|
}
|
|
118
124
|
|
|
125
|
+
pm_visit_child_nodes(node, search_block_nodes, analyzed);
|
|
126
|
+
|
|
119
127
|
return false;
|
|
120
128
|
}
|
|
121
129
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/src/analyze_missing_end.c.erb
|
|
3
3
|
|
|
4
4
|
#include "include/analyze_helpers.h"
|
|
5
5
|
#include "include/errors.h"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/src/analyze_transform.c.erb
|
|
3
3
|
|
|
4
4
|
#include "include/analyze.h"
|
|
5
5
|
#include "include/visitor.h"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/src/ast_nodes.c.erb
|
|
3
3
|
|
|
4
4
|
#include <stdio.h>
|
|
5
5
|
#include <stdbool.h>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/src/include/ast_nodes.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_AST_NODES_H
|
|
5
5
|
#define HERB_AST_NODES_H
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/src/ast_pretty_print.c.erb
|
|
3
3
|
|
|
4
4
|
#include "include/ast_node.h"
|
|
5
5
|
#include "include/ast_nodes.h"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/src/include/ast_pretty_print.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_AST_PRETTY_PRINT_H
|
|
5
5
|
#define HERB_AST_PRETTY_PRINT_H
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/src/errors.c.erb
|
|
3
3
|
|
|
4
4
|
#include "include/errors.h"
|
|
5
5
|
#include "include/location.h"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/src/include/errors.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_ERRORS_H
|
|
5
5
|
#define HERB_ERRORS_H
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/src/include/ast_nodes.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_AST_NODES_H
|
|
5
5
|
#define HERB_AST_NODES_H
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/src/include/ast_pretty_print.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_AST_PRETTY_PRINT_H
|
|
5
5
|
#define HERB_AST_PRETTY_PRINT_H
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/src/include/errors.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_ERRORS_H
|
|
5
5
|
#define HERB_ERRORS_H
|
|
@@ -1301,17 +1301,15 @@ void match_tags_in_node_array(hb_array_T* nodes, hb_array_T* errors) {
|
|
|
1301
1301
|
|
|
1302
1302
|
hb_array_T* processed = parser_build_elements_from_tags(nodes, errors);
|
|
1303
1303
|
|
|
1304
|
-
|
|
1305
|
-
hb_array_remove(nodes, 0);
|
|
1306
|
-
}
|
|
1304
|
+
nodes->size = 0;
|
|
1307
1305
|
|
|
1308
|
-
for (size_t i = 0; i <
|
|
1306
|
+
for (size_t i = 0; i < processed->size; i++) {
|
|
1309
1307
|
hb_array_append(nodes, hb_array_get(processed, i));
|
|
1310
1308
|
}
|
|
1311
1309
|
|
|
1312
1310
|
hb_array_free(&processed);
|
|
1313
1311
|
|
|
1314
|
-
for (size_t i = 0; i <
|
|
1312
|
+
for (size_t i = 0; i < nodes->size; i++) {
|
|
1315
1313
|
AST_NODE_T* node = (AST_NODE_T*) hb_array_get(nodes, i);
|
|
1316
1314
|
if (node == NULL) { continue; }
|
|
1317
1315
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/src/parser_match_tags.c.erb
|
|
3
3
|
|
|
4
4
|
#include "include/parser.h"
|
|
5
5
|
#include "include/ast_nodes.h"
|
|
@@ -192,12 +192,3 @@ void hb_buffer_clear(hb_buffer_T* buffer) {
|
|
|
192
192
|
buffer->length = 0;
|
|
193
193
|
buffer->value[0] = '\0';
|
|
194
194
|
}
|
|
195
|
-
|
|
196
|
-
void hb_buffer_free(hb_buffer_T** buffer) {
|
|
197
|
-
if (!buffer || !*buffer) { return; }
|
|
198
|
-
|
|
199
|
-
if ((*buffer)->value != NULL) { free((*buffer)->value); }
|
|
200
|
-
|
|
201
|
-
free(*buffer);
|
|
202
|
-
*buffer = NULL;
|
|
203
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/src/visitor.c.erb
|
|
3
3
|
|
|
4
4
|
#include <stdio.h>
|
|
5
5
|
|
package/extension/nodes.cpp
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/javascript/packages/node/extension/nodes.cpp.erb
|
|
3
3
|
|
|
4
4
|
#include <node_api.h>
|
|
5
5
|
#include "error_helpers.h"
|
package/extension/nodes.h
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.1/templates/javascript/packages/node/extension/nodes.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_EXTENSION_NODES_H
|
|
5
5
|
#define HERB_EXTENSION_NODES_H
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herb-tools/node",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Native Node.js addon for HTML-aware ERB parsing using Herb.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"host": "https://github.com/marcoroth/herb/releases/download/"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@herb-tools/core": "0.8.
|
|
51
|
+
"@herb-tools/core": "0.8.1",
|
|
52
52
|
"@mapbox/node-pre-gyp": "^2.0.0",
|
|
53
53
|
"node-addon-api": "^8.5.0",
|
|
54
54
|
"node-pre-gyp-github": "^2.0.0"
|