herb 0.3.1-arm-linux-gnu → 0.4.2-arm-linux-gnu
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.
- checksums.yaml +4 -4
- data/LICENSE.txt +2 -2
- data/README.md +80 -115
- data/ext/herb/error_helpers.c +1 -1
- data/ext/herb/error_helpers.h +1 -1
- data/ext/herb/nodes.c +2 -2
- data/ext/herb/nodes.h +1 -1
- data/lib/herb/3.0/herb.so +0 -0
- data/lib/herb/3.1/herb.so +0 -0
- data/lib/herb/3.2/herb.so +0 -0
- data/lib/herb/3.3/herb.so +0 -0
- data/lib/herb/3.4/herb.so +0 -0
- data/lib/herb/ast/node.rb +6 -1
- data/lib/herb/ast/nodes.rb +1 -1
- data/lib/herb/cli.rb +18 -2
- data/lib/herb/errors.rb +1 -1
- data/lib/herb/parse_result.rb +7 -2
- data/lib/herb/project.rb +79 -33
- data/lib/herb/version.rb +1 -1
- data/lib/herb/visitor.rb +1 -1
- data/sig/herb/ast/node.rbs +3 -0
- data/sig/herb/parse_result.rbs +3 -0
- data/sig/serialized_ast_errors.rbs +1 -1
- data/sig/serialized_ast_nodes.rbs +1 -1
- data/src/analyze.c +61 -16
- data/src/analyze_helpers.c +15 -6
- data/src/ast_nodes.c +1 -1
- data/src/ast_pretty_print.c +1 -1
- data/src/errors.c +1 -1
- data/src/extract.c +6 -2
- data/src/include/analyze_helpers.h +1 -1
- data/src/include/ast_nodes.h +1 -1
- data/src/include/ast_pretty_print.h +1 -1
- data/src/include/errors.h +1 -1
- data/src/include/parser_helpers.h +7 -2
- data/src/include/pretty_print.h +48 -8
- data/src/include/prism_helpers.h +4 -1
- data/src/include/token_struct.h +2 -1
- data/src/include/version.h +1 -1
- data/src/lexer.c +12 -2
- data/src/parser.c +13 -4
- data/src/parser_helpers.c +10 -3
- data/src/pretty_print.c +50 -10
- data/src/prism_helpers.c +4 -1
- data/src/token.c +1 -0
- data/src/visitor.c +1 -1
- metadata +2 -2
data/src/pretty_print.c
CHANGED
@@ -25,7 +25,11 @@ void pretty_print_newline(const size_t indent, const size_t relative_indent, buf
|
|
25
25
|
}
|
26
26
|
|
27
27
|
void pretty_print_label(
|
28
|
-
const char* name,
|
28
|
+
const char* name,
|
29
|
+
const size_t indent,
|
30
|
+
const size_t relative_indent,
|
31
|
+
const bool last_property,
|
32
|
+
buffer_T* buffer
|
29
33
|
) {
|
30
34
|
pretty_print_indent(buffer, indent);
|
31
35
|
pretty_print_indent(buffer, relative_indent);
|
@@ -41,7 +45,11 @@ void pretty_print_label(
|
|
41
45
|
}
|
42
46
|
|
43
47
|
void pretty_print_quoted_property(
|
44
|
-
const char* name,
|
48
|
+
const char* name,
|
49
|
+
const char* value,
|
50
|
+
const size_t indent,
|
51
|
+
const size_t relative_indent,
|
52
|
+
const bool last_property,
|
45
53
|
buffer_T* buffer
|
46
54
|
) {
|
47
55
|
char* quoted = quoted_string(value);
|
@@ -50,14 +58,22 @@ void pretty_print_quoted_property(
|
|
50
58
|
}
|
51
59
|
|
52
60
|
void pretty_print_boolean_property(
|
53
|
-
const char* name,
|
61
|
+
const char* name,
|
62
|
+
bool value,
|
63
|
+
const size_t indent,
|
64
|
+
const size_t relative_indent,
|
65
|
+
const bool last_property,
|
54
66
|
buffer_T* buffer
|
55
67
|
) {
|
56
68
|
pretty_print_property(name, value ? "true" : "false", indent, relative_indent, last_property, buffer);
|
57
69
|
}
|
58
70
|
|
59
71
|
void pretty_print_property(
|
60
|
-
const char* name,
|
72
|
+
const char* name,
|
73
|
+
const char* value,
|
74
|
+
const size_t indent,
|
75
|
+
const size_t relative_indent,
|
76
|
+
const bool last_property,
|
61
77
|
buffer_T* buffer
|
62
78
|
) {
|
63
79
|
pretty_print_label(name, indent, relative_indent, last_property, buffer);
|
@@ -66,7 +82,11 @@ void pretty_print_property(
|
|
66
82
|
}
|
67
83
|
|
68
84
|
void pretty_print_size_t_property(
|
69
|
-
size_t value,
|
85
|
+
size_t value,
|
86
|
+
const char* name,
|
87
|
+
const size_t indent,
|
88
|
+
const size_t relative_indent,
|
89
|
+
const bool last_property,
|
70
90
|
buffer_T* buffer
|
71
91
|
) {
|
72
92
|
pretty_print_label(name, indent, relative_indent, last_property, buffer);
|
@@ -77,7 +97,11 @@ void pretty_print_size_t_property(
|
|
77
97
|
}
|
78
98
|
|
79
99
|
void pretty_print_array(
|
80
|
-
const char* name,
|
100
|
+
const char* name,
|
101
|
+
array_T* array,
|
102
|
+
const size_t indent,
|
103
|
+
const size_t relative_indent,
|
104
|
+
const bool last_property,
|
81
105
|
buffer_T* buffer
|
82
106
|
) {
|
83
107
|
if (array == NULL) {
|
@@ -122,7 +146,11 @@ void pretty_print_array(
|
|
122
146
|
}
|
123
147
|
|
124
148
|
void pretty_print_errors(
|
125
|
-
AST_NODE_T* node,
|
149
|
+
AST_NODE_T* node,
|
150
|
+
const size_t indent,
|
151
|
+
const size_t relative_indent,
|
152
|
+
const bool last_property,
|
153
|
+
buffer_T* buffer
|
126
154
|
) {
|
127
155
|
if (node->errors != NULL && array_size(node->errors) > 0) {
|
128
156
|
error_pretty_print_array("errors", node->errors, indent, relative_indent, last_property, buffer);
|
@@ -146,7 +174,11 @@ void pretty_print_location(location_T* location, buffer_T* buffer) {
|
|
146
174
|
}
|
147
175
|
|
148
176
|
void pretty_print_position_property(
|
149
|
-
position_T* position,
|
177
|
+
position_T* position,
|
178
|
+
const char* name,
|
179
|
+
const size_t indent,
|
180
|
+
const size_t relative_indent,
|
181
|
+
const bool last_property,
|
150
182
|
buffer_T* buffer
|
151
183
|
) {
|
152
184
|
pretty_print_label(name, indent, relative_indent, last_property, buffer);
|
@@ -173,7 +205,11 @@ void pretty_print_position_property(
|
|
173
205
|
}
|
174
206
|
|
175
207
|
void pretty_print_token_property(
|
176
|
-
token_T* token,
|
208
|
+
token_T* token,
|
209
|
+
const char* name,
|
210
|
+
const size_t indent,
|
211
|
+
const size_t relative_indent,
|
212
|
+
const bool last_property,
|
177
213
|
buffer_T* buffer
|
178
214
|
) {
|
179
215
|
pretty_print_label(name, indent, relative_indent, last_property, buffer);
|
@@ -193,7 +229,11 @@ void pretty_print_token_property(
|
|
193
229
|
}
|
194
230
|
|
195
231
|
void pretty_print_string_property(
|
196
|
-
const char* string,
|
232
|
+
const char* string,
|
233
|
+
const char* name,
|
234
|
+
const size_t indent,
|
235
|
+
const size_t relative_indent,
|
236
|
+
const bool last_property,
|
197
237
|
buffer_T* buffer
|
198
238
|
) {
|
199
239
|
const char* value = "∅";
|
data/src/prism_helpers.c
CHANGED
@@ -32,7 +32,10 @@ position_T* position_from_source_with_offset(const char* source, size_t offset)
|
|
32
32
|
}
|
33
33
|
|
34
34
|
RUBY_PARSE_ERROR_T* ruby_parse_error_from_prism_error(
|
35
|
-
const pm_diagnostic_t* error,
|
35
|
+
const pm_diagnostic_t* error,
|
36
|
+
const AST_NODE_T* node,
|
37
|
+
const char* source,
|
38
|
+
pm_parser_t* parser
|
36
39
|
) {
|
37
40
|
size_t start_offset = (size_t) (error->location.start - parser->start);
|
38
41
|
size_t end_offset = (size_t) (error->location.end - parser->start);
|
data/src/token.c
CHANGED
@@ -61,6 +61,7 @@ const char* token_type_to_string(const token_type_T type) {
|
|
61
61
|
case TOKEN_SLASH: return "TOKEN_SLASH";
|
62
62
|
case TOKEN_SEMICOLON: return "TOKEN_SEMICOLON";
|
63
63
|
case TOKEN_COLON: return "TOKEN_COLON";
|
64
|
+
case TOKEN_AT: return "TOKEN_AT";
|
64
65
|
case TOKEN_LT: return "TOKEN_LT";
|
65
66
|
case TOKEN_PERCENT: return "TOKEN_PERCENT";
|
66
67
|
case TOKEN_AMPERSAND: return "TOKEN_AMPERSAND";
|
data/src/visitor.c
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/templates/src/visitor.c.erb
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-6/templates/src/visitor.c.erb
|
3
3
|
|
4
4
|
#include <stdio.h>
|
5
5
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: herb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: arm-linux-gnu
|
6
6
|
authors:
|
7
7
|
- Marco Roth
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-07-28 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: Powerful and seamless HTML-aware ERB parsing and tooling.
|
13
13
|
email:
|