@herb-tools/node 0.8.9 → 0.9.0
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/CHANGELOG.md +19 -0
- package/binding.gyp +26 -8
- package/dist/herb-node.cjs +41 -12
- package/dist/herb-node.cjs.map +1 -1
- package/dist/herb-node.esm.js +8 -1
- package/dist/herb-node.esm.js.map +1 -1
- package/dist/types/node-backend.d.ts +3 -1
- package/extension/error_helpers.cpp +419 -71
- package/extension/error_helpers.h +14 -3
- package/extension/extension_helpers.cpp +38 -35
- package/extension/extension_helpers.h +2 -2
- package/extension/herb.cpp +183 -64
- package/extension/libherb/analyze/action_view/attribute_extraction_helpers.c +290 -0
- package/extension/libherb/analyze/action_view/attribute_extraction_helpers.h +36 -0
- package/extension/libherb/analyze/action_view/content_tag.c +70 -0
- package/extension/libherb/analyze/action_view/link_to.c +143 -0
- package/extension/libherb/analyze/action_view/registry.c +60 -0
- package/extension/libherb/analyze/action_view/tag.c +64 -0
- package/extension/libherb/analyze/action_view/tag_helper_handler.h +41 -0
- package/extension/libherb/analyze/action_view/tag_helper_node_builders.c +305 -0
- package/extension/libherb/analyze/action_view/tag_helper_node_builders.h +70 -0
- package/extension/libherb/analyze/action_view/tag_helpers.c +748 -0
- package/extension/libherb/analyze/action_view/tag_helpers.h +38 -0
- package/extension/libherb/analyze/action_view/turbo_frame_tag.c +88 -0
- package/extension/libherb/analyze/analyze.c +882 -0
- package/extension/libherb/{include → analyze}/analyze.h +14 -4
- package/extension/libherb/{analyzed_ruby.c → analyze/analyzed_ruby.c} +13 -11
- package/extension/libherb/{analyzed_ruby.h → analyze/analyzed_ruby.h} +3 -3
- package/extension/libherb/analyze/builders.c +343 -0
- package/extension/libherb/analyze/builders.h +27 -0
- package/extension/libherb/analyze/conditional_elements.c +594 -0
- package/extension/libherb/analyze/conditional_elements.h +9 -0
- package/extension/libherb/analyze/conditional_open_tags.c +640 -0
- package/extension/libherb/analyze/conditional_open_tags.h +9 -0
- package/extension/libherb/analyze/control_type.c +250 -0
- package/extension/libherb/analyze/control_type.h +14 -0
- package/extension/libherb/{analyze_helpers.c → analyze/helpers.c} +79 -31
- package/extension/libherb/{analyze_helpers.h → analyze/helpers.h} +22 -17
- package/extension/libherb/analyze/invalid_structures.c +193 -0
- package/extension/libherb/analyze/invalid_structures.h +11 -0
- package/extension/libherb/{analyze_missing_end.c → analyze/missing_end.c} +33 -22
- package/extension/libherb/analyze/parse_errors.c +84 -0
- package/extension/libherb/analyze/prism_annotate.c +397 -0
- package/extension/libherb/analyze/prism_annotate.h +16 -0
- package/extension/libherb/{analyze_transform.c → analyze/transform.c} +17 -3
- package/extension/libherb/ast_node.c +17 -7
- package/extension/libherb/ast_node.h +11 -5
- package/extension/libherb/ast_nodes.c +663 -388
- package/extension/libherb/ast_nodes.h +118 -39
- package/extension/libherb/ast_pretty_print.c +191 -7
- package/extension/libherb/ast_pretty_print.h +6 -1
- package/extension/libherb/element_source.h +3 -8
- package/extension/libherb/errors.c +1100 -507
- package/extension/libherb/errors.h +155 -54
- package/extension/libherb/extract.c +148 -49
- package/extension/libherb/extract.h +21 -5
- package/extension/libherb/herb.c +52 -34
- package/extension/libherb/herb.h +18 -6
- package/extension/libherb/herb_prism_node.h +13 -0
- package/extension/libherb/html_util.c +241 -12
- package/extension/libherb/html_util.h +7 -2
- package/extension/libherb/include/analyze/action_view/attribute_extraction_helpers.h +36 -0
- package/extension/libherb/include/analyze/action_view/tag_helper_handler.h +41 -0
- package/extension/libherb/include/analyze/action_view/tag_helper_node_builders.h +70 -0
- package/extension/libherb/include/analyze/action_view/tag_helpers.h +38 -0
- package/extension/libherb/{analyze.h → include/analyze/analyze.h} +14 -4
- package/extension/libherb/include/{analyzed_ruby.h → analyze/analyzed_ruby.h} +3 -3
- package/extension/libherb/include/analyze/builders.h +27 -0
- package/extension/libherb/include/analyze/conditional_elements.h +9 -0
- package/extension/libherb/include/analyze/conditional_open_tags.h +9 -0
- package/extension/libherb/include/analyze/control_type.h +14 -0
- package/extension/libherb/include/{analyze_helpers.h → analyze/helpers.h} +22 -17
- package/extension/libherb/include/analyze/invalid_structures.h +11 -0
- package/extension/libherb/include/analyze/prism_annotate.h +16 -0
- package/extension/libherb/include/ast_node.h +11 -5
- package/extension/libherb/include/ast_nodes.h +118 -39
- package/extension/libherb/include/ast_pretty_print.h +6 -1
- package/extension/libherb/include/element_source.h +3 -8
- package/extension/libherb/include/errors.h +155 -54
- package/extension/libherb/include/extract.h +21 -5
- package/extension/libherb/include/herb.h +18 -6
- package/extension/libherb/include/herb_prism_node.h +13 -0
- package/extension/libherb/include/html_util.h +7 -2
- package/extension/libherb/include/io.h +3 -1
- package/extension/libherb/include/lex_helpers.h +29 -0
- package/extension/libherb/include/lexer.h +1 -1
- package/extension/libherb/include/lexer_peek_helpers.h +87 -13
- package/extension/libherb/include/lexer_struct.h +2 -0
- package/extension/libherb/include/location.h +2 -1
- package/extension/libherb/include/parser.h +27 -2
- package/extension/libherb/include/parser_helpers.h +19 -3
- package/extension/libherb/include/pretty_print.h +10 -5
- package/extension/libherb/include/prism_context.h +45 -0
- package/extension/libherb/include/prism_helpers.h +10 -7
- package/extension/libherb/include/prism_serialized.h +12 -0
- package/extension/libherb/include/token.h +16 -4
- package/extension/libherb/include/token_struct.h +10 -3
- package/extension/libherb/include/utf8.h +2 -1
- package/extension/libherb/include/util/hb_allocator.h +78 -0
- package/extension/libherb/include/util/hb_arena.h +6 -1
- package/extension/libherb/include/util/hb_arena_debug.h +12 -1
- package/extension/libherb/include/util/hb_array.h +7 -3
- package/extension/libherb/include/util/hb_buffer.h +6 -4
- package/extension/libherb/include/util/hb_foreach.h +79 -0
- package/extension/libherb/include/util/hb_narray.h +8 -4
- package/extension/libherb/include/util/hb_string.h +56 -9
- package/extension/libherb/include/util/string.h +11 -0
- package/extension/libherb/include/util.h +6 -3
- package/extension/libherb/include/version.h +1 -1
- package/extension/libherb/io.c +3 -2
- package/extension/libherb/io.h +3 -1
- package/extension/libherb/lex_helpers.h +29 -0
- package/extension/libherb/lexer.c +42 -30
- package/extension/libherb/lexer.h +1 -1
- package/extension/libherb/lexer_peek_helpers.c +12 -74
- package/extension/libherb/lexer_peek_helpers.h +87 -13
- package/extension/libherb/lexer_struct.h +2 -0
- package/extension/libherb/location.c +2 -2
- package/extension/libherb/location.h +2 -1
- package/extension/libherb/main.c +79 -66
- package/extension/libherb/parser.c +784 -247
- package/extension/libherb/parser.h +27 -2
- package/extension/libherb/parser_helpers.c +110 -23
- package/extension/libherb/parser_helpers.h +19 -3
- package/extension/libherb/parser_match_tags.c +110 -49
- package/extension/libherb/pretty_print.c +29 -24
- package/extension/libherb/pretty_print.h +10 -5
- package/extension/libherb/prism_context.h +45 -0
- package/extension/libherb/prism_helpers.c +30 -27
- package/extension/libherb/prism_helpers.h +10 -7
- package/extension/libherb/prism_serialized.h +12 -0
- package/extension/libherb/ruby_parser.c +2 -0
- package/extension/libherb/token.c +151 -66
- package/extension/libherb/token.h +16 -4
- package/extension/libherb/token_matchers.c +0 -1
- package/extension/libherb/token_struct.h +10 -3
- package/extension/libherb/utf8.c +7 -6
- package/extension/libherb/utf8.h +2 -1
- package/extension/libherb/util/hb_allocator.c +341 -0
- package/extension/libherb/util/hb_allocator.h +78 -0
- package/extension/libherb/util/hb_arena.c +81 -56
- package/extension/libherb/util/hb_arena.h +6 -1
- package/extension/libherb/util/hb_arena_debug.c +32 -17
- package/extension/libherb/util/hb_arena_debug.h +12 -1
- package/extension/libherb/util/hb_array.c +30 -15
- package/extension/libherb/util/hb_array.h +7 -3
- package/extension/libherb/util/hb_buffer.c +17 -21
- package/extension/libherb/util/hb_buffer.h +6 -4
- package/extension/libherb/util/hb_foreach.h +79 -0
- package/extension/libherb/util/hb_narray.c +22 -7
- package/extension/libherb/util/hb_narray.h +8 -4
- package/extension/libherb/util/hb_string.c +49 -35
- package/extension/libherb/util/hb_string.h +56 -9
- package/extension/libherb/util/string.h +11 -0
- package/extension/libherb/util.c +21 -11
- package/extension/libherb/util.h +6 -3
- package/extension/libherb/version.h +1 -1
- package/extension/libherb/visitor.c +48 -1
- package/extension/nodes.cpp +451 -6
- package/extension/nodes.h +8 -1
- package/extension/prism/include/prism/ast.h +4 -4
- package/extension/prism/include/prism/version.h +2 -2
- package/extension/prism/src/prism.c +1 -1
- package/package.json +12 -8
- package/src/node-backend.ts +11 -1
- package/dist/types/index-cjs.d.cts +0 -1
- package/extension/libherb/analyze.c +0 -1594
- package/extension/libherb/element_source.c +0 -12
- package/extension/libherb/include/util/hb_system.h +0 -9
- package/extension/libherb/util/hb_system.c +0 -30
- package/extension/libherb/util/hb_system.h +0 -9
- package/src/index-cjs.cts +0 -22
- /package/dist/types/{index-esm.d.mts → index.d.ts} +0 -0
- /package/src/{index-esm.mts → index.ts} +0 -0
|
@@ -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.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.9.0/templates/src/include/errors.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_ERRORS_H
|
|
5
5
|
#define HERB_ERRORS_H
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
#include "location.h"
|
|
9
9
|
#include "position.h"
|
|
10
10
|
#include "token.h"
|
|
11
|
+
#include "util/hb_allocator.h"
|
|
11
12
|
#include "util/hb_array.h"
|
|
12
13
|
#include "util/hb_buffer.h"
|
|
14
|
+
#include "util/hb_string.h"
|
|
13
15
|
|
|
14
16
|
typedef enum {
|
|
15
17
|
UNEXPECTED_ERROR,
|
|
@@ -17,27 +19,38 @@ typedef enum {
|
|
|
17
19
|
MISSING_OPENING_TAG_ERROR,
|
|
18
20
|
MISSING_CLOSING_TAG_ERROR,
|
|
19
21
|
TAG_NAMES_MISMATCH_ERROR,
|
|
20
|
-
QUOTES_MISMATCH_ERROR,
|
|
21
22
|
VOID_ELEMENT_CLOSING_TAG_ERROR,
|
|
22
23
|
UNCLOSED_ELEMENT_ERROR,
|
|
23
24
|
RUBY_PARSE_ERROR,
|
|
24
25
|
ERB_CONTROL_FLOW_SCOPE_ERROR,
|
|
25
|
-
|
|
26
|
+
MISSING_ERB_END_TAG_ERROR,
|
|
26
27
|
ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR,
|
|
28
|
+
ERB_CASE_WITH_CONDITIONS_ERROR,
|
|
29
|
+
CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR,
|
|
30
|
+
CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR,
|
|
31
|
+
INVALID_COMMENT_CLOSING_TAG_ERROR,
|
|
32
|
+
OMITTED_CLOSING_TAG_ERROR,
|
|
33
|
+
UNCLOSED_OPEN_TAG_ERROR,
|
|
34
|
+
UNCLOSED_CLOSE_TAG_ERROR,
|
|
35
|
+
UNCLOSED_QUOTE_ERROR,
|
|
36
|
+
MISSING_ATTRIBUTE_VALUE_ERROR,
|
|
37
|
+
UNCLOSED_ERB_TAG_ERROR,
|
|
38
|
+
STRAY_ERB_CLOSING_TAG_ERROR,
|
|
39
|
+
NESTED_ERB_TAG_ERROR,
|
|
27
40
|
} error_type_T;
|
|
28
41
|
|
|
29
42
|
typedef struct ERROR_STRUCT {
|
|
30
43
|
error_type_T type;
|
|
31
44
|
location_T location;
|
|
32
|
-
|
|
45
|
+
hb_string_T message;
|
|
33
46
|
} ERROR_T;
|
|
34
47
|
|
|
35
48
|
|
|
36
49
|
typedef struct {
|
|
37
50
|
ERROR_T base;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
51
|
+
hb_string_T description;
|
|
52
|
+
hb_string_T expected;
|
|
53
|
+
hb_string_T found;
|
|
41
54
|
} UNEXPECTED_ERROR_T;
|
|
42
55
|
|
|
43
56
|
typedef struct {
|
|
@@ -62,17 +75,11 @@ typedef struct {
|
|
|
62
75
|
token_T* closing_tag;
|
|
63
76
|
} TAG_NAMES_MISMATCH_ERROR_T;
|
|
64
77
|
|
|
65
|
-
typedef struct {
|
|
66
|
-
ERROR_T base;
|
|
67
|
-
token_T* opening_quote;
|
|
68
|
-
token_T* closing_quote;
|
|
69
|
-
} QUOTES_MISMATCH_ERROR_T;
|
|
70
|
-
|
|
71
78
|
typedef struct {
|
|
72
79
|
ERROR_T base;
|
|
73
80
|
token_T* tag_name;
|
|
74
|
-
|
|
75
|
-
|
|
81
|
+
hb_string_T expected;
|
|
82
|
+
hb_string_T found;
|
|
76
83
|
} VOID_ELEMENT_CLOSING_TAG_ERROR_T;
|
|
77
84
|
|
|
78
85
|
typedef struct {
|
|
@@ -82,68 +89,162 @@ typedef struct {
|
|
|
82
89
|
|
|
83
90
|
typedef struct {
|
|
84
91
|
ERROR_T base;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
hb_string_T error_message;
|
|
93
|
+
hb_string_T diagnostic_id;
|
|
94
|
+
hb_string_T level;
|
|
88
95
|
} RUBY_PARSE_ERROR_T;
|
|
89
96
|
|
|
90
97
|
typedef struct {
|
|
91
98
|
ERROR_T base;
|
|
92
|
-
|
|
99
|
+
hb_string_T keyword;
|
|
93
100
|
} ERB_CONTROL_FLOW_SCOPE_ERROR_T;
|
|
94
101
|
|
|
95
102
|
typedef struct {
|
|
96
103
|
ERROR_T base;
|
|
97
|
-
|
|
98
|
-
}
|
|
104
|
+
hb_string_T keyword;
|
|
105
|
+
} MISSING_ERB_END_TAG_ERROR_T;
|
|
99
106
|
|
|
100
107
|
typedef struct {
|
|
101
108
|
ERROR_T base;
|
|
102
109
|
/* no additional fields */
|
|
103
110
|
} ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR_T;
|
|
104
111
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
112
|
+
typedef struct {
|
|
113
|
+
ERROR_T base;
|
|
114
|
+
/* no additional fields */
|
|
115
|
+
} ERB_CASE_WITH_CONDITIONS_ERROR_T;
|
|
116
|
+
|
|
117
|
+
typedef struct {
|
|
118
|
+
ERROR_T base;
|
|
119
|
+
size_t line;
|
|
120
|
+
size_t column;
|
|
121
|
+
} CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR_T;
|
|
122
|
+
|
|
123
|
+
typedef struct {
|
|
124
|
+
ERROR_T base;
|
|
125
|
+
hb_string_T tag_name;
|
|
126
|
+
hb_string_T open_condition;
|
|
127
|
+
size_t open_line;
|
|
128
|
+
size_t open_column;
|
|
129
|
+
hb_string_T close_condition;
|
|
130
|
+
size_t close_line;
|
|
131
|
+
size_t close_column;
|
|
132
|
+
} CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR_T;
|
|
133
|
+
|
|
134
|
+
typedef struct {
|
|
135
|
+
ERROR_T base;
|
|
136
|
+
token_T* closing_tag;
|
|
137
|
+
} INVALID_COMMENT_CLOSING_TAG_ERROR_T;
|
|
138
|
+
|
|
139
|
+
typedef struct {
|
|
140
|
+
ERROR_T base;
|
|
141
|
+
token_T* opening_tag;
|
|
142
|
+
position_T insertion_point;
|
|
143
|
+
} OMITTED_CLOSING_TAG_ERROR_T;
|
|
144
|
+
|
|
145
|
+
typedef struct {
|
|
146
|
+
ERROR_T base;
|
|
147
|
+
token_T* tag_name;
|
|
148
|
+
} UNCLOSED_OPEN_TAG_ERROR_T;
|
|
149
|
+
|
|
150
|
+
typedef struct {
|
|
151
|
+
ERROR_T base;
|
|
152
|
+
token_T* tag_name;
|
|
153
|
+
} UNCLOSED_CLOSE_TAG_ERROR_T;
|
|
154
|
+
|
|
155
|
+
typedef struct {
|
|
156
|
+
ERROR_T base;
|
|
157
|
+
token_T* opening_quote;
|
|
158
|
+
} UNCLOSED_QUOTE_ERROR_T;
|
|
159
|
+
|
|
160
|
+
typedef struct {
|
|
161
|
+
ERROR_T base;
|
|
162
|
+
hb_string_T attribute_name;
|
|
163
|
+
} MISSING_ATTRIBUTE_VALUE_ERROR_T;
|
|
164
|
+
|
|
165
|
+
typedef struct {
|
|
166
|
+
ERROR_T base;
|
|
167
|
+
token_T* opening_tag;
|
|
168
|
+
} UNCLOSED_ERB_TAG_ERROR_T;
|
|
169
|
+
|
|
170
|
+
typedef struct {
|
|
171
|
+
ERROR_T base;
|
|
172
|
+
/* no additional fields */
|
|
173
|
+
} STRAY_ERB_CLOSING_TAG_ERROR_T;
|
|
174
|
+
|
|
175
|
+
typedef struct {
|
|
176
|
+
ERROR_T base;
|
|
177
|
+
token_T* opening_tag;
|
|
178
|
+
size_t nested_tag_line;
|
|
179
|
+
size_t nested_tag_column;
|
|
180
|
+
} NESTED_ERB_TAG_ERROR_T;
|
|
181
|
+
|
|
182
|
+
UNEXPECTED_ERROR_T* unexpected_error_init(hb_string_T description, hb_string_T expected, hb_string_T found, position_T start, position_T end, hb_allocator_T* allocator);
|
|
183
|
+
void append_unexpected_error(hb_string_T description, hb_string_T expected, hb_string_T found, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
184
|
+
UNEXPECTED_TOKEN_ERROR_T* unexpected_token_error_init(token_type_T expected_type, token_T* found, position_T start, position_T end, hb_allocator_T* allocator);
|
|
185
|
+
void append_unexpected_token_error(token_type_T expected_type, token_T* found, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
186
|
+
MISSING_OPENING_TAG_ERROR_T* missing_opening_tag_error_init(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator);
|
|
187
|
+
void append_missing_opening_tag_error(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
188
|
+
MISSING_CLOSING_TAG_ERROR_T* missing_closing_tag_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator);
|
|
189
|
+
void append_missing_closing_tag_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
190
|
+
TAG_NAMES_MISMATCH_ERROR_T* tag_names_mismatch_error_init(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator);
|
|
191
|
+
void append_tag_names_mismatch_error(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
192
|
+
VOID_ELEMENT_CLOSING_TAG_ERROR_T* void_element_closing_tag_error_init(token_T* tag_name, hb_string_T expected, hb_string_T found, position_T start, position_T end, hb_allocator_T* allocator);
|
|
193
|
+
void append_void_element_closing_tag_error(token_T* tag_name, hb_string_T expected, hb_string_T found, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
194
|
+
UNCLOSED_ELEMENT_ERROR_T* unclosed_element_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator);
|
|
195
|
+
void append_unclosed_element_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
196
|
+
RUBY_PARSE_ERROR_T* ruby_parse_error_init(hb_string_T error_message, hb_string_T diagnostic_id, hb_string_T level, position_T start, position_T end, hb_allocator_T* allocator);
|
|
197
|
+
void append_ruby_parse_error(hb_string_T error_message, hb_string_T diagnostic_id, hb_string_T level, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
198
|
+
ERB_CONTROL_FLOW_SCOPE_ERROR_T* erb_control_flow_scope_error_init(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator);
|
|
199
|
+
void append_erb_control_flow_scope_error(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
200
|
+
MISSING_ERB_END_TAG_ERROR_T* missing_erb_end_tag_error_init(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator);
|
|
201
|
+
void append_missing_erb_end_tag_error(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
202
|
+
ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR_T* erb_multiple_blocks_in_tag_error_init(position_T start, position_T end, hb_allocator_T* allocator);
|
|
203
|
+
void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
204
|
+
ERB_CASE_WITH_CONDITIONS_ERROR_T* erb_case_with_conditions_error_init(position_T start, position_T end, hb_allocator_T* allocator);
|
|
205
|
+
void append_erb_case_with_conditions_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
206
|
+
CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR_T* conditional_element_multiple_tags_error_init(size_t line, size_t column, position_T start, position_T end, hb_allocator_T* allocator);
|
|
207
|
+
void append_conditional_element_multiple_tags_error(size_t line, size_t column, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
208
|
+
CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR_T* conditional_element_condition_mismatch_error_init(hb_string_T tag_name, hb_string_T open_condition, size_t open_line, size_t open_column, hb_string_T close_condition, size_t close_line, size_t close_column, position_T start, position_T end, hb_allocator_T* allocator);
|
|
209
|
+
void append_conditional_element_condition_mismatch_error(hb_string_T tag_name, hb_string_T open_condition, size_t open_line, size_t open_column, hb_string_T close_condition, size_t close_line, size_t close_column, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
210
|
+
INVALID_COMMENT_CLOSING_TAG_ERROR_T* invalid_comment_closing_tag_error_init(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator);
|
|
211
|
+
void append_invalid_comment_closing_tag_error(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
212
|
+
OMITTED_CLOSING_TAG_ERROR_T* omitted_closing_tag_error_init(token_T* opening_tag, position_T insertion_point, position_T start, position_T end, hb_allocator_T* allocator);
|
|
213
|
+
void append_omitted_closing_tag_error(token_T* opening_tag, position_T insertion_point, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
214
|
+
UNCLOSED_OPEN_TAG_ERROR_T* unclosed_open_tag_error_init(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator);
|
|
215
|
+
void append_unclosed_open_tag_error(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
216
|
+
UNCLOSED_CLOSE_TAG_ERROR_T* unclosed_close_tag_error_init(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator);
|
|
217
|
+
void append_unclosed_close_tag_error(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
218
|
+
UNCLOSED_QUOTE_ERROR_T* unclosed_quote_error_init(token_T* opening_quote, position_T start, position_T end, hb_allocator_T* allocator);
|
|
219
|
+
void append_unclosed_quote_error(token_T* opening_quote, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
220
|
+
MISSING_ATTRIBUTE_VALUE_ERROR_T* missing_attribute_value_error_init(hb_string_T attribute_name, position_T start, position_T end, hb_allocator_T* allocator);
|
|
221
|
+
void append_missing_attribute_value_error(hb_string_T attribute_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
222
|
+
UNCLOSED_ERB_TAG_ERROR_T* unclosed_erb_tag_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator);
|
|
223
|
+
void append_unclosed_erb_tag_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
224
|
+
STRAY_ERB_CLOSING_TAG_ERROR_T* stray_erb_closing_tag_error_init(position_T start, position_T end, hb_allocator_T* allocator);
|
|
225
|
+
void append_stray_erb_closing_tag_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
226
|
+
NESTED_ERB_TAG_ERROR_T* nested_erb_tag_error_init(token_T* opening_tag, size_t nested_tag_line, size_t nested_tag_column, position_T start, position_T end, hb_allocator_T* allocator);
|
|
227
|
+
void append_nested_erb_tag_error(token_T* opening_tag, size_t nested_tag_line, size_t nested_tag_column, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
|
|
129
228
|
|
|
130
229
|
void error_init(ERROR_T* error, error_type_T type, position_T start, position_T end);
|
|
131
230
|
|
|
132
231
|
size_t error_sizeof(void);
|
|
133
232
|
error_type_T error_type(ERROR_T* error);
|
|
134
233
|
|
|
135
|
-
|
|
234
|
+
hb_string_T error_message(ERROR_T* error);
|
|
136
235
|
|
|
137
|
-
|
|
138
|
-
|
|
236
|
+
hb_string_T error_type_to_string(ERROR_T* error);
|
|
237
|
+
hb_string_T error_human_type(ERROR_T* error);
|
|
139
238
|
|
|
140
|
-
void error_free(ERROR_T* error);
|
|
239
|
+
void error_free(ERROR_T* error, hb_allocator_T* allocator);
|
|
141
240
|
|
|
142
|
-
|
|
241
|
+
#ifndef HERB_EXCLUDE_PRETTYPRINT
|
|
242
|
+
void error_pretty_print(ERROR_T* error, size_t indent, size_t relative_indent, hb_buffer_T* buffer);
|
|
143
243
|
|
|
144
|
-
void error_pretty_print_array(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
);
|
|
244
|
+
void error_pretty_print_array(
|
|
245
|
+
const char* name, hb_array_T* array, size_t indent, size_t relative_indent, bool last_property,
|
|
246
|
+
hb_buffer_T* buffer
|
|
247
|
+
);
|
|
248
|
+
#endif
|
|
148
249
|
|
|
149
250
|
#endif
|
|
@@ -1,40 +1,96 @@
|
|
|
1
1
|
#include "include/herb.h"
|
|
2
|
-
#include "include/
|
|
3
|
-
#include "include/lexer.h"
|
|
2
|
+
#include "include/util/hb_allocator.h"
|
|
4
3
|
#include "include/util/hb_array.h"
|
|
5
4
|
#include "include/util/hb_buffer.h"
|
|
5
|
+
#include "include/util/hb_string.h"
|
|
6
|
+
#include "include/util/string.h"
|
|
6
7
|
|
|
8
|
+
#include <assert.h>
|
|
7
9
|
#include <stdlib.h>
|
|
8
10
|
#include <string.h>
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
const herb_extract_ruby_options_T HERB_EXTRACT_RUBY_DEFAULT_OPTIONS = { .semicolons = true,
|
|
13
|
+
.comments = false,
|
|
14
|
+
.preserve_positions = true };
|
|
15
|
+
|
|
16
|
+
void herb_extract_ruby_to_buffer_with_options(
|
|
17
|
+
const char* source,
|
|
18
|
+
hb_buffer_T* output,
|
|
19
|
+
const herb_extract_ruby_options_T* options,
|
|
20
|
+
hb_allocator_T* allocator
|
|
21
|
+
) {
|
|
22
|
+
herb_extract_ruby_options_T extract_options = options ? *options : HERB_EXTRACT_RUBY_DEFAULT_OPTIONS;
|
|
23
|
+
|
|
24
|
+
hb_array_T* tokens = herb_lex(source, allocator);
|
|
12
25
|
bool skip_erb_content = false;
|
|
13
26
|
bool is_comment_tag = false;
|
|
27
|
+
bool is_erb_comment_tag = false;
|
|
28
|
+
bool need_newline = false;
|
|
14
29
|
|
|
15
30
|
for (size_t i = 0; i < hb_array_size(tokens); i++) {
|
|
16
31
|
const token_T* token = hb_array_get(tokens, i);
|
|
17
32
|
|
|
18
33
|
switch (token->type) {
|
|
19
34
|
case TOKEN_NEWLINE: {
|
|
20
|
-
|
|
35
|
+
hb_buffer_append_string(output, token->value);
|
|
36
|
+
need_newline = false;
|
|
21
37
|
break;
|
|
22
38
|
}
|
|
23
39
|
|
|
24
40
|
case TOKEN_ERB_START: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
41
|
+
is_erb_comment_tag = hb_string_equals(token->value, hb_string("<%#"));
|
|
42
|
+
|
|
43
|
+
if (is_erb_comment_tag) {
|
|
44
|
+
if (extract_options.comments) {
|
|
45
|
+
skip_erb_content = false;
|
|
46
|
+
is_comment_tag = false;
|
|
47
|
+
|
|
48
|
+
if (extract_options.preserve_positions) {
|
|
49
|
+
bool is_multiline = false;
|
|
50
|
+
|
|
51
|
+
if (i + 1 < hb_array_size(tokens)) {
|
|
52
|
+
const token_T* next = hb_array_get(tokens, i + 1);
|
|
53
|
+
|
|
54
|
+
if (next->type == TOKEN_ERB_CONTENT && !hb_string_is_null(next->value)
|
|
55
|
+
&& memchr(next->value.data, '\n', next->value.length) != NULL) {
|
|
56
|
+
is_multiline = true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (is_multiline) {
|
|
61
|
+
hb_buffer_append_char(output, '#');
|
|
62
|
+
hb_buffer_append_whitespace(output, 2);
|
|
63
|
+
} else {
|
|
64
|
+
hb_buffer_append_whitespace(output, 2);
|
|
65
|
+
hb_buffer_append_char(output, '#');
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
if (need_newline) { hb_buffer_append_char(output, '\n'); }
|
|
69
|
+
hb_buffer_append_char(output, '#');
|
|
70
|
+
need_newline = true;
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
skip_erb_content = true;
|
|
74
|
+
is_comment_tag = true;
|
|
75
|
+
if (extract_options.preserve_positions) { hb_buffer_append_whitespace(output, range_length(token->range)); }
|
|
76
|
+
}
|
|
77
|
+
} else if (hb_string_equals(token->value, hb_string("<%%")) || hb_string_equals(token->value, hb_string("<%%="))
|
|
78
|
+
|| hb_string_equals(token->value, hb_string("<%graphql"))) {
|
|
30
79
|
skip_erb_content = true;
|
|
31
80
|
is_comment_tag = false;
|
|
81
|
+
if (extract_options.preserve_positions) { hb_buffer_append_whitespace(output, range_length(token->range)); }
|
|
32
82
|
} else {
|
|
33
83
|
skip_erb_content = false;
|
|
34
84
|
is_comment_tag = false;
|
|
85
|
+
|
|
86
|
+
if (extract_options.preserve_positions) {
|
|
87
|
+
hb_buffer_append_whitespace(output, range_length(token->range));
|
|
88
|
+
} else if (need_newline) {
|
|
89
|
+
hb_buffer_append_char(output, '\n');
|
|
90
|
+
need_newline = false;
|
|
91
|
+
}
|
|
35
92
|
}
|
|
36
93
|
|
|
37
|
-
hb_buffer_append_whitespace(output, range_length(token->range));
|
|
38
94
|
break;
|
|
39
95
|
}
|
|
40
96
|
|
|
@@ -42,26 +98,65 @@ void herb_extract_ruby_to_buffer(const char* source, hb_buffer_T* output) {
|
|
|
42
98
|
if (skip_erb_content == false) {
|
|
43
99
|
bool is_inline_comment = false;
|
|
44
100
|
|
|
45
|
-
if (!is_comment_tag && token->value
|
|
46
|
-
|
|
101
|
+
if (!extract_options.comments && !is_comment_tag && !hb_string_is_empty(token->value)) {
|
|
102
|
+
hb_string_T trimmed = hb_string_trim_start(token->value);
|
|
47
103
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (*content == '#' && token->location.start.line == token->location.end.line) {
|
|
104
|
+
if (!hb_string_is_empty(trimmed) && trimmed.data[0] == '#'
|
|
105
|
+
&& token->location.start.line == token->location.end.line) {
|
|
53
106
|
is_comment_tag = true;
|
|
54
107
|
is_inline_comment = true;
|
|
55
108
|
}
|
|
56
109
|
}
|
|
57
110
|
|
|
58
111
|
if (is_inline_comment) {
|
|
59
|
-
hb_buffer_append_whitespace(output, range_length(token->range));
|
|
112
|
+
if (extract_options.preserve_positions) { hb_buffer_append_whitespace(output, range_length(token->range)); }
|
|
113
|
+
} else if (is_erb_comment_tag && !hb_string_is_null(token->value)) {
|
|
114
|
+
const char* content = token->value.data;
|
|
115
|
+
size_t content_remaining = token->value.length;
|
|
116
|
+
|
|
117
|
+
while (content_remaining > 0) {
|
|
118
|
+
if (*content == '\n') {
|
|
119
|
+
hb_buffer_append_char(output, '\n');
|
|
120
|
+
content++;
|
|
121
|
+
content_remaining--;
|
|
122
|
+
|
|
123
|
+
if (content_remaining > 0 && extract_options.preserve_positions && *content == ' ') {
|
|
124
|
+
content++;
|
|
125
|
+
content_remaining--;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
hb_buffer_append_char(output, '#');
|
|
129
|
+
} else {
|
|
130
|
+
hb_buffer_append_char(output, *content);
|
|
131
|
+
content++;
|
|
132
|
+
content_remaining--;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (!extract_options.preserve_positions) { need_newline = true; }
|
|
60
137
|
} else {
|
|
61
|
-
|
|
138
|
+
hb_buffer_append_string(output, token->value);
|
|
139
|
+
|
|
140
|
+
if (!extract_options.preserve_positions) { need_newline = true; }
|
|
62
141
|
}
|
|
63
142
|
} else {
|
|
64
|
-
|
|
143
|
+
if (is_erb_comment_tag && extract_options.preserve_positions && !hb_string_is_null(token->value)) {
|
|
144
|
+
const char* content = token->value.data;
|
|
145
|
+
size_t content_remaining = token->value.length;
|
|
146
|
+
|
|
147
|
+
while (content_remaining > 0) {
|
|
148
|
+
if (*content == '\n') {
|
|
149
|
+
hb_buffer_append_char(output, '\n');
|
|
150
|
+
} else {
|
|
151
|
+
hb_buffer_append_char(output, ' ');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
content++;
|
|
155
|
+
content_remaining--;
|
|
156
|
+
}
|
|
157
|
+
} else if (extract_options.preserve_positions) {
|
|
158
|
+
hb_buffer_append_whitespace(output, range_length(token->range));
|
|
159
|
+
}
|
|
65
160
|
}
|
|
66
161
|
|
|
67
162
|
break;
|
|
@@ -69,31 +164,43 @@ void herb_extract_ruby_to_buffer(const char* source, hb_buffer_T* output) {
|
|
|
69
164
|
|
|
70
165
|
case TOKEN_ERB_END: {
|
|
71
166
|
bool was_comment = is_comment_tag;
|
|
167
|
+
bool was_erb_comment = is_erb_comment_tag;
|
|
72
168
|
skip_erb_content = false;
|
|
73
169
|
is_comment_tag = false;
|
|
170
|
+
is_erb_comment_tag = false;
|
|
74
171
|
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
|
|
172
|
+
if (extract_options.preserve_positions) {
|
|
173
|
+
if (was_comment) {
|
|
174
|
+
hb_buffer_append_whitespace(output, range_length(token->range));
|
|
175
|
+
} else if (was_erb_comment && extract_options.comments) {
|
|
176
|
+
hb_buffer_append_whitespace(output, range_length(token->range));
|
|
177
|
+
} else if (extract_options.semicolons) {
|
|
178
|
+
hb_buffer_append_char(output, ' ');
|
|
179
|
+
hb_buffer_append_char(output, ';');
|
|
180
|
+
hb_buffer_append_whitespace(output, range_length(token->range) - 2);
|
|
181
|
+
} else {
|
|
182
|
+
hb_buffer_append_whitespace(output, range_length(token->range));
|
|
183
|
+
}
|
|
78
184
|
}
|
|
79
185
|
|
|
80
|
-
hb_buffer_append_char(output, ' ');
|
|
81
|
-
hb_buffer_append_char(output, ';');
|
|
82
|
-
hb_buffer_append_whitespace(output, range_length(token->range) - 2);
|
|
83
186
|
break;
|
|
84
187
|
}
|
|
85
188
|
|
|
86
189
|
default: {
|
|
87
|
-
hb_buffer_append_whitespace(output, range_length(token->range));
|
|
190
|
+
if (extract_options.preserve_positions) { hb_buffer_append_whitespace(output, range_length(token->range)); }
|
|
88
191
|
}
|
|
89
192
|
}
|
|
90
193
|
}
|
|
91
194
|
|
|
92
|
-
herb_free_tokens(&tokens);
|
|
195
|
+
herb_free_tokens(&tokens, allocator);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
void herb_extract_ruby_to_buffer(const char* source, hb_buffer_T* output, hb_allocator_T* allocator) {
|
|
199
|
+
herb_extract_ruby_to_buffer_with_options(source, output, NULL, allocator);
|
|
93
200
|
}
|
|
94
201
|
|
|
95
|
-
void herb_extract_html_to_buffer(const char* source, hb_buffer_T* output) {
|
|
96
|
-
hb_array_T* tokens = herb_lex(source);
|
|
202
|
+
void herb_extract_html_to_buffer(const char* source, hb_buffer_T* output, hb_allocator_T* allocator) {
|
|
203
|
+
hb_array_T* tokens = herb_lex(source, allocator);
|
|
97
204
|
|
|
98
205
|
for (size_t i = 0; i < hb_array_size(tokens); i++) {
|
|
99
206
|
const token_T* token = hb_array_get(tokens, i);
|
|
@@ -102,43 +209,35 @@ void herb_extract_html_to_buffer(const char* source, hb_buffer_T* output) {
|
|
|
102
209
|
case TOKEN_ERB_START:
|
|
103
210
|
case TOKEN_ERB_CONTENT:
|
|
104
211
|
case TOKEN_ERB_END: hb_buffer_append_whitespace(output, range_length(token->range)); break;
|
|
105
|
-
default:
|
|
212
|
+
default: hb_buffer_append_string(output, token->value);
|
|
106
213
|
}
|
|
107
214
|
}
|
|
108
215
|
|
|
109
|
-
herb_free_tokens(&tokens);
|
|
216
|
+
herb_free_tokens(&tokens, allocator);
|
|
110
217
|
}
|
|
111
218
|
|
|
112
|
-
char* herb_extract_ruby_with_semicolons(const char* source) {
|
|
219
|
+
char* herb_extract_ruby_with_semicolons(const char* source, hb_allocator_T* allocator) {
|
|
113
220
|
if (!source) { return NULL; }
|
|
114
221
|
|
|
115
222
|
hb_buffer_T output;
|
|
116
|
-
hb_buffer_init(&output, strlen(source));
|
|
223
|
+
hb_buffer_init(&output, strlen(source), allocator);
|
|
117
224
|
|
|
118
|
-
herb_extract_ruby_to_buffer(source, &output);
|
|
225
|
+
herb_extract_ruby_to_buffer(source, &output, allocator);
|
|
119
226
|
|
|
120
227
|
return output.value;
|
|
121
228
|
}
|
|
122
229
|
|
|
123
|
-
char* herb_extract(const char* source, const herb_extract_language_T language) {
|
|
230
|
+
char* herb_extract(const char* source, const herb_extract_language_T language, hb_allocator_T* allocator) {
|
|
124
231
|
if (!source) { return NULL; }
|
|
125
232
|
|
|
126
233
|
hb_buffer_T output;
|
|
127
|
-
hb_buffer_init(&output, strlen(source));
|
|
234
|
+
hb_buffer_init(&output, strlen(source), allocator);
|
|
128
235
|
|
|
129
236
|
switch (language) {
|
|
130
|
-
case HERB_EXTRACT_LANGUAGE_RUBY: herb_extract_ruby_to_buffer(source, &output); break;
|
|
131
|
-
case HERB_EXTRACT_LANGUAGE_HTML: herb_extract_html_to_buffer(source, &output); break;
|
|
237
|
+
case HERB_EXTRACT_LANGUAGE_RUBY: herb_extract_ruby_to_buffer(source, &output, allocator); break;
|
|
238
|
+
case HERB_EXTRACT_LANGUAGE_HTML: herb_extract_html_to_buffer(source, &output, allocator); break;
|
|
239
|
+
default: assert(0 && "invalid extract language");
|
|
132
240
|
}
|
|
133
241
|
|
|
134
242
|
return output.value;
|
|
135
243
|
}
|
|
136
|
-
|
|
137
|
-
char* herb_extract_from_file(const char* path, const herb_extract_language_T language) {
|
|
138
|
-
char* source = herb_read_file(path);
|
|
139
|
-
char* output = herb_extract(source, language);
|
|
140
|
-
|
|
141
|
-
free(source);
|
|
142
|
-
|
|
143
|
-
return output;
|
|
144
|
-
}
|
|
@@ -1,19 +1,35 @@
|
|
|
1
1
|
#ifndef HERB_EXTRACT_H
|
|
2
2
|
#define HERB_EXTRACT_H
|
|
3
3
|
|
|
4
|
+
#include "util/hb_allocator.h"
|
|
4
5
|
#include "util/hb_buffer.h"
|
|
5
6
|
|
|
7
|
+
#include <stdbool.h>
|
|
8
|
+
|
|
6
9
|
typedef enum {
|
|
7
10
|
HERB_EXTRACT_LANGUAGE_RUBY,
|
|
8
11
|
HERB_EXTRACT_LANGUAGE_HTML,
|
|
9
12
|
} herb_extract_language_T;
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
typedef struct {
|
|
15
|
+
bool semicolons;
|
|
16
|
+
bool comments;
|
|
17
|
+
bool preserve_positions;
|
|
18
|
+
} herb_extract_ruby_options_T;
|
|
19
|
+
|
|
20
|
+
extern const herb_extract_ruby_options_T HERB_EXTRACT_RUBY_DEFAULT_OPTIONS;
|
|
21
|
+
|
|
22
|
+
void herb_extract_ruby_to_buffer_with_options(
|
|
23
|
+
const char* source,
|
|
24
|
+
hb_buffer_T* output,
|
|
25
|
+
const herb_extract_ruby_options_T* options,
|
|
26
|
+
hb_allocator_T* allocator
|
|
27
|
+
);
|
|
28
|
+
void herb_extract_ruby_to_buffer(const char* source, hb_buffer_T* output, hb_allocator_T* allocator);
|
|
29
|
+
void herb_extract_html_to_buffer(const char* source, hb_buffer_T* output, hb_allocator_T* allocator);
|
|
13
30
|
|
|
14
|
-
char* herb_extract_ruby_with_semicolons(const char* source);
|
|
31
|
+
char* herb_extract_ruby_with_semicolons(const char* source, hb_allocator_T* allocator);
|
|
15
32
|
|
|
16
|
-
char* herb_extract(const char* source, herb_extract_language_T language);
|
|
17
|
-
char* herb_extract_from_file(const char* path, herb_extract_language_T language);
|
|
33
|
+
char* herb_extract(const char* source, herb_extract_language_T language, hb_allocator_T* allocator);
|
|
18
34
|
|
|
19
35
|
#endif
|