herb 0.5.0-x86-linux-musl → 0.6.0-x86-linux-musl
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/Makefile +6 -3
- data/ext/herb/error_helpers.c +1 -1
- data/ext/herb/error_helpers.h +1 -1
- data/ext/herb/extension.c +20 -4
- data/ext/herb/nodes.c +70 -41
- 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/nodes.rb +149 -91
- data/lib/herb/cli.rb +19 -6
- data/lib/herb/errors.rb +1 -1
- data/lib/herb/version.rb +1 -1
- data/lib/herb/visitor.rb +11 -6
- data/sig/herb/ast/nodes.rbs +65 -38
- data/sig/herb/visitor.rbs +6 -3
- data/sig/serialized_ast_errors.rbs +1 -1
- data/sig/serialized_ast_nodes.rbs +15 -10
- data/src/ast_nodes.c +79 -36
- data/src/ast_pretty_print.c +21 -13
- data/src/errors.c +1 -1
- data/src/herb.c +2 -2
- data/src/include/ast_nodes.h +23 -15
- data/src/include/ast_pretty_print.h +1 -1
- data/src/include/errors.h +1 -1
- data/src/include/herb.h +2 -1
- data/src/include/lexer_peek_helpers.h +21 -0
- data/src/include/parser.h +6 -1
- data/src/include/token_struct.h +6 -1
- data/src/include/version.h +1 -1
- data/src/lexer.c +20 -1
- data/src/lexer_peek_helpers.c +77 -0
- data/src/main.c +2 -2
- data/src/parser.c +435 -122
- data/src/token.c +5 -0
- data/src/visitor.c +39 -6
- metadata +2 -2
data/src/token.c
CHANGED
@@ -47,6 +47,10 @@ const char* token_type_to_string(const token_type_T type) {
|
|
47
47
|
case TOKEN_NEWLINE: return "TOKEN_NEWLINE";
|
48
48
|
case TOKEN_IDENTIFIER: return "TOKEN_IDENTIFIER";
|
49
49
|
case TOKEN_HTML_DOCTYPE: return "TOKEN_HTML_DOCTYPE";
|
50
|
+
case TOKEN_XML_DECLARATION: return "TOKEN_XML_DECLARATION";
|
51
|
+
case TOKEN_XML_DECLARATION_END: return "TOKEN_XML_DECLARATION_END";
|
52
|
+
case TOKEN_CDATA_START: return "TOKEN_CDATA_START";
|
53
|
+
case TOKEN_CDATA_END: return "TOKEN_CDATA_END";
|
50
54
|
case TOKEN_HTML_TAG_START: return "TOKEN_HTML_TAG_START";
|
51
55
|
case TOKEN_HTML_TAG_END: return "TOKEN_HTML_TAG_END";
|
52
56
|
case TOKEN_HTML_TAG_START_CLOSE: return "TOKEN_HTML_TAG_START_CLOSE";
|
@@ -56,6 +60,7 @@ const char* token_type_to_string(const token_type_T type) {
|
|
56
60
|
case TOKEN_EQUALS: return "TOKEN_EQUALS";
|
57
61
|
case TOKEN_QUOTE: return "TOKEN_QUOTE";
|
58
62
|
case TOKEN_BACKTICK: return "TOKEN_BACKTICK";
|
63
|
+
case TOKEN_BACKSLASH: return "TOKEN_BACKSLASH";
|
59
64
|
case TOKEN_DASH: return "TOKEN_DASH";
|
60
65
|
case TOKEN_UNDERSCORE: return "TOKEN_UNDERSCORE";
|
61
66
|
case TOKEN_EXCLAMATION: return "TOKEN_EXCLAMATION";
|
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-0.
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.6.0/templates/src/visitor.c.erb
|
3
3
|
|
4
4
|
#include <stdio.h>
|
5
5
|
|
@@ -42,12 +42,12 @@ void herb_visit_child_nodes(const AST_NODE_T *node, bool (*visitor)(const AST_NO
|
|
42
42
|
|
43
43
|
} break;
|
44
44
|
|
45
|
-
case
|
46
|
-
const
|
45
|
+
case AST_HTML_CLOSE_TAG_NODE: {
|
46
|
+
const AST_HTML_CLOSE_TAG_NODE_T* html_close_tag_node = ((const AST_HTML_CLOSE_TAG_NODE_T *) node);
|
47
47
|
|
48
|
-
if (
|
49
|
-
for (size_t index = 0; index < array_size(
|
50
|
-
herb_visit_node(array_get(
|
48
|
+
if (html_close_tag_node->children != NULL) {
|
49
|
+
for (size_t index = 0; index < array_size(html_close_tag_node->children); index++) {
|
50
|
+
herb_visit_node(array_get(html_close_tag_node->children, index), visitor, data);
|
51
51
|
}
|
52
52
|
}
|
53
53
|
|
@@ -83,6 +83,17 @@ void herb_visit_child_nodes(const AST_NODE_T *node, bool (*visitor)(const AST_NO
|
|
83
83
|
|
84
84
|
} break;
|
85
85
|
|
86
|
+
case AST_HTML_ATTRIBUTE_NAME_NODE: {
|
87
|
+
const AST_HTML_ATTRIBUTE_NAME_NODE_T* html_attribute_name_node = ((const AST_HTML_ATTRIBUTE_NAME_NODE_T *) node);
|
88
|
+
|
89
|
+
if (html_attribute_name_node->children != NULL) {
|
90
|
+
for (size_t index = 0; index < array_size(html_attribute_name_node->children); index++) {
|
91
|
+
herb_visit_node(array_get(html_attribute_name_node->children, index), visitor, data);
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
} break;
|
96
|
+
|
86
97
|
case AST_HTML_ATTRIBUTE_NODE: {
|
87
98
|
const AST_HTML_ATTRIBUTE_NODE_T* html_attribute_node = ((const AST_HTML_ATTRIBUTE_NODE_T *) node);
|
88
99
|
|
@@ -118,6 +129,28 @@ void herb_visit_child_nodes(const AST_NODE_T *node, bool (*visitor)(const AST_NO
|
|
118
129
|
|
119
130
|
} break;
|
120
131
|
|
132
|
+
case AST_XML_DECLARATION_NODE: {
|
133
|
+
const AST_XML_DECLARATION_NODE_T* xml_declaration_node = ((const AST_XML_DECLARATION_NODE_T *) node);
|
134
|
+
|
135
|
+
if (xml_declaration_node->children != NULL) {
|
136
|
+
for (size_t index = 0; index < array_size(xml_declaration_node->children); index++) {
|
137
|
+
herb_visit_node(array_get(xml_declaration_node->children, index), visitor, data);
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
} break;
|
142
|
+
|
143
|
+
case AST_CDATA_NODE: {
|
144
|
+
const AST_CDATA_NODE_T* cdata_node = ((const AST_CDATA_NODE_T *) node);
|
145
|
+
|
146
|
+
if (cdata_node->children != NULL) {
|
147
|
+
for (size_t index = 0; index < array_size(cdata_node->children); index++) {
|
148
|
+
herb_visit_node(array_get(cdata_node->children, index), visitor, data);
|
149
|
+
}
|
150
|
+
}
|
151
|
+
|
152
|
+
} break;
|
153
|
+
|
121
154
|
case AST_ERB_ELSE_NODE: {
|
122
155
|
const AST_ERB_ELSE_NODE_T* erb_else_node = ((const AST_ERB_ELSE_NODE_T *) node);
|
123
156
|
|
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.6.0
|
5
5
|
platform: x86-linux-musl
|
6
6
|
authors:
|
7
7
|
- Marco Roth
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-08-
|
10
|
+
date: 2025-08-25 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: Powerful and seamless HTML-aware ERB parsing and tooling.
|
13
13
|
email:
|