herb 0.8.10-arm-linux-gnu → 0.9.1-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/Makefile +11 -3
- data/README.md +64 -34
- data/Rakefile +48 -40
- data/config.yml +473 -34
- data/ext/herb/error_helpers.c +535 -140
- data/ext/herb/error_helpers.h +1 -0
- data/ext/herb/extconf.rb +67 -28
- data/ext/herb/extension.c +321 -51
- data/ext/herb/extension.h +1 -0
- data/ext/herb/extension_helpers.c +24 -14
- data/ext/herb/extension_helpers.h +2 -2
- data/ext/herb/nodes.c +647 -270
- data/ext/herb/nodes.h +1 -0
- data/herb.gemspec +3 -2
- 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/4.0/herb.so +0 -0
- data/lib/herb/ast/helpers.rb +3 -3
- data/lib/herb/ast/node.rb +15 -2
- data/lib/herb/ast/nodes.rb +1530 -179
- data/lib/herb/bootstrap.rb +87 -0
- data/lib/herb/cli.rb +341 -31
- data/lib/herb/configuration.rb +248 -0
- data/lib/herb/defaults.yml +32 -0
- data/lib/herb/engine/compiler.rb +78 -11
- data/lib/herb/engine/debug_visitor.rb +13 -3
- data/lib/herb/engine/error_formatter.rb +13 -9
- data/lib/herb/engine/parser_error_overlay.rb +10 -6
- data/lib/herb/engine/validator.rb +8 -3
- data/lib/herb/engine/validators/nesting_validator.rb +2 -2
- data/lib/herb/engine.rb +119 -43
- data/lib/herb/errors.rb +808 -88
- data/lib/herb/lex_result.rb +1 -0
- data/lib/herb/location.rb +7 -3
- data/lib/herb/parse_result.rb +12 -2
- data/lib/herb/parser_options.rb +62 -0
- data/lib/herb/position.rb +1 -0
- data/lib/herb/prism_inspect.rb +120 -0
- data/lib/herb/project.rb +923 -331
- data/lib/herb/range.rb +1 -0
- data/lib/herb/token.rb +7 -1
- data/lib/herb/version.rb +1 -1
- data/lib/herb/visitor.rb +47 -2
- data/lib/herb/warnings.rb +6 -1
- data/lib/herb.rb +35 -3
- data/sig/herb/ast/helpers.rbs +2 -2
- data/sig/herb/ast/node.rbs +12 -2
- data/sig/herb/ast/nodes.rbs +773 -128
- data/sig/herb/bootstrap.rbs +31 -0
- data/sig/herb/configuration.rbs +89 -0
- data/sig/herb/engine/compiler.rbs +9 -1
- data/sig/herb/engine/debug_visitor.rbs +2 -0
- data/sig/herb/engine/validator.rbs +5 -1
- data/sig/herb/engine.rbs +21 -3
- data/sig/herb/errors.rbs +372 -63
- data/sig/herb/location.rbs +4 -0
- data/sig/herb/parse_result.rbs +4 -2
- data/sig/herb/parser_options.rbs +46 -0
- data/sig/herb/position.rbs +1 -0
- data/sig/herb/prism_inspect.rbs +28 -0
- data/sig/herb/range.rbs +1 -0
- data/sig/herb/token.rbs +6 -0
- data/sig/herb/visitor.rbs +31 -4
- data/sig/herb/warnings.rbs +6 -1
- data/sig/herb.rbs +14 -0
- data/sig/herb_c_extension.rbs +5 -2
- data/sig/rubyvm.rbs +5 -0
- data/sig/serialized_ast_errors.rbs +82 -6
- data/sig/serialized_ast_nodes.rbs +91 -6
- data/src/analyze/action_view/attribute_extraction_helpers.c +303 -0
- data/src/analyze/action_view/content_tag.c +78 -0
- data/src/analyze/action_view/link_to.c +167 -0
- data/src/analyze/action_view/registry.c +83 -0
- data/src/analyze/action_view/tag.c +70 -0
- data/src/analyze/action_view/tag_helper_node_builders.c +305 -0
- data/src/analyze/action_view/tag_helpers.c +815 -0
- data/src/analyze/action_view/turbo_frame_tag.c +88 -0
- data/src/analyze/analyze.c +885 -0
- data/src/{analyzed_ruby.c → analyze/analyzed_ruby.c} +13 -11
- data/src/analyze/builders.c +343 -0
- data/src/analyze/conditional_elements.c +594 -0
- data/src/analyze/conditional_open_tags.c +640 -0
- data/src/analyze/control_type.c +250 -0
- data/src/{analyze_helpers.c → analyze/helpers.c} +48 -23
- data/src/analyze/invalid_structures.c +193 -0
- data/src/{analyze_missing_end.c → analyze/missing_end.c} +33 -22
- data/src/analyze/parse_errors.c +84 -0
- data/src/analyze/prism_annotate.c +399 -0
- data/src/analyze/render_nodes.c +761 -0
- data/src/{analyze_transform.c → analyze/transform.c} +24 -3
- data/src/ast_node.c +17 -7
- data/src/ast_nodes.c +759 -387
- data/src/ast_pretty_print.c +264 -6
- data/src/errors.c +1454 -519
- data/src/extract.c +145 -49
- data/src/herb.c +52 -34
- data/src/html_util.c +241 -12
- data/src/include/analyze/action_view/attribute_extraction_helpers.h +36 -0
- data/src/include/analyze/action_view/tag_helper_handler.h +43 -0
- data/src/include/analyze/action_view/tag_helper_node_builders.h +70 -0
- data/src/include/analyze/action_view/tag_helpers.h +38 -0
- data/src/include/{analyze.h → analyze/analyze.h} +14 -4
- data/src/include/{analyzed_ruby.h → analyze/analyzed_ruby.h} +3 -3
- data/src/include/analyze/builders.h +27 -0
- data/src/include/analyze/conditional_elements.h +9 -0
- data/src/include/analyze/conditional_open_tags.h +9 -0
- data/src/include/analyze/control_type.h +14 -0
- data/src/include/{analyze_helpers.h → analyze/helpers.h} +4 -2
- data/src/include/analyze/invalid_structures.h +11 -0
- data/src/include/analyze/prism_annotate.h +16 -0
- data/src/include/analyze/render_nodes.h +11 -0
- data/src/include/ast_node.h +11 -5
- data/src/include/ast_nodes.h +154 -38
- data/src/include/ast_pretty_print.h +5 -0
- data/src/include/element_source.h +3 -8
- data/src/include/errors.h +206 -55
- data/src/include/extract.h +21 -5
- data/src/include/herb.h +18 -6
- data/src/include/herb_prism_node.h +13 -0
- data/src/include/html_util.h +7 -2
- data/src/include/io.h +3 -1
- data/src/include/lex_helpers.h +29 -0
- data/src/include/lexer.h +1 -1
- data/src/include/lexer_peek_helpers.h +87 -13
- data/src/include/lexer_struct.h +2 -0
- data/src/include/location.h +2 -1
- data/src/include/parser.h +28 -2
- data/src/include/parser_helpers.h +19 -3
- data/src/include/pretty_print.h +10 -5
- data/src/include/prism_context.h +45 -0
- data/src/include/prism_helpers.h +10 -7
- data/src/include/prism_serialized.h +12 -0
- data/src/include/token.h +16 -4
- data/src/include/token_struct.h +10 -3
- data/src/include/utf8.h +2 -1
- data/src/include/util/hb_allocator.h +78 -0
- data/src/include/util/hb_arena.h +6 -1
- data/src/include/util/hb_arena_debug.h +12 -1
- data/src/include/util/hb_array.h +7 -3
- data/src/include/util/hb_buffer.h +6 -4
- data/src/include/util/hb_foreach.h +79 -0
- data/src/include/util/hb_narray.h +8 -4
- data/src/include/util/hb_string.h +56 -9
- data/src/include/util.h +6 -3
- data/src/include/version.h +1 -1
- data/src/io.c +3 -2
- data/src/lexer.c +42 -30
- data/src/lexer_peek_helpers.c +12 -74
- data/src/location.c +2 -2
- data/src/main.c +53 -28
- data/src/parser.c +784 -247
- data/src/parser_helpers.c +110 -23
- data/src/parser_match_tags.c +129 -48
- data/src/pretty_print.c +29 -24
- data/src/prism_helpers.c +30 -27
- data/src/ruby_parser.c +2 -0
- data/src/token.c +151 -66
- data/src/token_matchers.c +0 -1
- data/src/utf8.c +7 -6
- data/src/util/hb_allocator.c +341 -0
- data/src/util/hb_arena.c +81 -56
- data/src/util/hb_arena_debug.c +32 -17
- data/src/util/hb_array.c +30 -15
- data/src/util/hb_buffer.c +17 -21
- data/src/util/hb_narray.c +22 -7
- data/src/util/hb_string.c +49 -35
- data/src/util.c +21 -11
- data/src/visitor.c +67 -0
- data/templates/ext/herb/error_helpers.c.erb +24 -11
- data/templates/ext/herb/error_helpers.h.erb +1 -0
- data/templates/ext/herb/nodes.c.erb +50 -16
- data/templates/ext/herb/nodes.h.erb +1 -0
- data/templates/java/error_helpers.c.erb +1 -1
- data/templates/java/nodes.c.erb +30 -8
- data/templates/java/org/herb/ast/Errors.java.erb +24 -1
- data/templates/java/org/herb/ast/Nodes.java.erb +80 -21
- data/templates/javascript/packages/core/src/errors.ts.erb +16 -3
- data/templates/javascript/packages/core/src/node-type-guards.ts.erb +3 -1
- data/templates/javascript/packages/core/src/nodes.ts.erb +109 -32
- data/templates/javascript/packages/node/extension/error_helpers.cpp.erb +13 -4
- data/templates/javascript/packages/node/extension/nodes.cpp.erb +43 -4
- data/templates/lib/herb/ast/nodes.rb.erb +95 -32
- data/templates/lib/herb/errors.rb.erb +15 -3
- data/templates/lib/herb/visitor.rb.erb +2 -2
- data/templates/rust/src/ast/nodes.rs.erb +97 -44
- data/templates/rust/src/errors.rs.erb +2 -1
- data/templates/rust/src/nodes.rs.erb +168 -16
- data/templates/rust/src/union_types.rs.erb +60 -0
- data/templates/rust/src/visitor.rs.erb +81 -0
- data/templates/src/{analyze_missing_end.c.erb → analyze/missing_end.c.erb} +9 -6
- data/templates/src/{analyze_transform.c.erb → analyze/transform.c.erb} +2 -2
- data/templates/src/ast_nodes.c.erb +34 -26
- data/templates/src/ast_pretty_print.c.erb +24 -5
- data/templates/src/errors.c.erb +60 -54
- data/templates/src/include/ast_nodes.h.erb +6 -2
- data/templates/src/include/ast_pretty_print.h.erb +5 -0
- data/templates/src/include/errors.h.erb +15 -11
- data/templates/src/include/util/hb_foreach.h.erb +20 -0
- data/templates/src/parser_match_tags.c.erb +10 -4
- data/templates/src/visitor.c.erb +2 -2
- data/templates/template.rb +204 -29
- data/templates/wasm/error_helpers.cpp.erb +9 -5
- data/templates/wasm/nodes.cpp.erb +41 -4
- metadata +60 -16
- data/src/analyze.c +0 -1608
- data/src/element_source.c +0 -12
- data/src/include/util/hb_system.h +0 -9
- data/src/util/hb_system.c +0 -30
data/sig/herb/errors.rbs
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
# Generated from lib/herb/errors.rb with RBS::Inline
|
|
2
2
|
|
|
3
3
|
module Herb
|
|
4
|
+
# : type serialized_error = {
|
|
5
|
+
# | type: String,
|
|
6
|
+
# | location: serialized_location?,
|
|
7
|
+
# | message: String
|
|
8
|
+
# | }
|
|
4
9
|
module Errors
|
|
5
10
|
class Error
|
|
6
11
|
attr_reader type: String
|
|
7
12
|
|
|
8
|
-
attr_reader location: Location
|
|
13
|
+
attr_reader location: Location?
|
|
9
14
|
|
|
10
15
|
attr_reader message: String
|
|
11
16
|
|
|
12
|
-
# : (String, Location
|
|
13
|
-
def initialize: (String, Location
|
|
17
|
+
# : (String, Location?, String) -> void
|
|
18
|
+
def initialize: (String, Location?, String) -> void
|
|
14
19
|
|
|
15
20
|
# : () -> serialized_error
|
|
16
21
|
def to_hash: () -> serialized_error
|
|
@@ -31,14 +36,14 @@ module Herb
|
|
|
31
36
|
class UnexpectedError < Error
|
|
32
37
|
include Colors
|
|
33
38
|
|
|
34
|
-
attr_reader description: String
|
|
39
|
+
attr_reader description: String?
|
|
35
40
|
|
|
36
|
-
attr_reader expected: String
|
|
41
|
+
attr_reader expected: String?
|
|
37
42
|
|
|
38
|
-
attr_reader found: String
|
|
43
|
+
attr_reader found: String?
|
|
39
44
|
|
|
40
|
-
# : (String, Location
|
|
41
|
-
def initialize: (String, Location
|
|
45
|
+
# : (String, Location?, String, String, String, String) -> void
|
|
46
|
+
def initialize: (String, Location?, String, String, String, String) -> void
|
|
42
47
|
|
|
43
48
|
# : () -> String
|
|
44
49
|
def inspect: () -> String
|
|
@@ -53,12 +58,12 @@ module Herb
|
|
|
53
58
|
class UnexpectedTokenError < Error
|
|
54
59
|
include Colors
|
|
55
60
|
|
|
56
|
-
attr_reader expected_type: String
|
|
61
|
+
attr_reader expected_type: String?
|
|
57
62
|
|
|
58
|
-
attr_reader found: Herb::Token
|
|
63
|
+
attr_reader found: Herb::Token?
|
|
59
64
|
|
|
60
|
-
# : (String, Location
|
|
61
|
-
def initialize: (String, Location
|
|
65
|
+
# : (String, Location?, String, String, Herb::Token) -> void
|
|
66
|
+
def initialize: (String, Location?, String, String, Herb::Token) -> void
|
|
62
67
|
|
|
63
68
|
# : () -> String
|
|
64
69
|
def inspect: () -> String
|
|
@@ -73,10 +78,10 @@ module Herb
|
|
|
73
78
|
class MissingOpeningTagError < Error
|
|
74
79
|
include Colors
|
|
75
80
|
|
|
76
|
-
attr_reader closing_tag: Herb::Token
|
|
81
|
+
attr_reader closing_tag: Herb::Token?
|
|
77
82
|
|
|
78
|
-
# : (String, Location
|
|
79
|
-
def initialize: (String, Location
|
|
83
|
+
# : (String, Location?, String, Herb::Token) -> void
|
|
84
|
+
def initialize: (String, Location?, String, Herb::Token) -> void
|
|
80
85
|
|
|
81
86
|
# : () -> String
|
|
82
87
|
def inspect: () -> String
|
|
@@ -91,10 +96,10 @@ module Herb
|
|
|
91
96
|
class MissingClosingTagError < Error
|
|
92
97
|
include Colors
|
|
93
98
|
|
|
94
|
-
attr_reader opening_tag: Herb::Token
|
|
99
|
+
attr_reader opening_tag: Herb::Token?
|
|
95
100
|
|
|
96
|
-
# : (String, Location
|
|
97
|
-
def initialize: (String, Location
|
|
101
|
+
# : (String, Location?, String, Herb::Token) -> void
|
|
102
|
+
def initialize: (String, Location?, String, Herb::Token) -> void
|
|
98
103
|
|
|
99
104
|
# : () -> String
|
|
100
105
|
def inspect: () -> String
|
|
@@ -109,12 +114,12 @@ module Herb
|
|
|
109
114
|
class TagNamesMismatchError < Error
|
|
110
115
|
include Colors
|
|
111
116
|
|
|
112
|
-
attr_reader opening_tag: Herb::Token
|
|
117
|
+
attr_reader opening_tag: Herb::Token?
|
|
113
118
|
|
|
114
|
-
attr_reader closing_tag: Herb::Token
|
|
119
|
+
attr_reader closing_tag: Herb::Token?
|
|
115
120
|
|
|
116
|
-
# : (String, Location
|
|
117
|
-
def initialize: (String, Location
|
|
121
|
+
# : (String, Location?, String, Herb::Token, Herb::Token) -> void
|
|
122
|
+
def initialize: (String, Location?, String, Herb::Token, Herb::Token) -> void
|
|
118
123
|
|
|
119
124
|
# : () -> String
|
|
120
125
|
def inspect: () -> String
|
|
@@ -126,37 +131,17 @@ module Herb
|
|
|
126
131
|
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
127
132
|
end
|
|
128
133
|
|
|
129
|
-
class QuotesMismatchError < Error
|
|
130
|
-
include Colors
|
|
131
|
-
|
|
132
|
-
attr_reader opening_quote: Herb::Token
|
|
133
|
-
|
|
134
|
-
attr_reader closing_quote: Herb::Token
|
|
135
|
-
|
|
136
|
-
# : (String, Location, String, Herb::Token, Herb::Token) -> void
|
|
137
|
-
def initialize: (String, Location, String, Herb::Token, Herb::Token) -> void
|
|
138
|
-
|
|
139
|
-
# : () -> String
|
|
140
|
-
def inspect: () -> String
|
|
141
|
-
|
|
142
|
-
# : () -> serialized_quotes_mismatch_error
|
|
143
|
-
def to_hash: () -> serialized_quotes_mismatch_error
|
|
144
|
-
|
|
145
|
-
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
146
|
-
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
147
|
-
end
|
|
148
|
-
|
|
149
134
|
class VoidElementClosingTagError < Error
|
|
150
135
|
include Colors
|
|
151
136
|
|
|
152
|
-
attr_reader tag_name: Herb::Token
|
|
137
|
+
attr_reader tag_name: Herb::Token?
|
|
153
138
|
|
|
154
|
-
attr_reader expected: String
|
|
139
|
+
attr_reader expected: String?
|
|
155
140
|
|
|
156
|
-
attr_reader found: String
|
|
141
|
+
attr_reader found: String?
|
|
157
142
|
|
|
158
|
-
# : (String, Location
|
|
159
|
-
def initialize: (String, Location
|
|
143
|
+
# : (String, Location?, String, Herb::Token, String, String) -> void
|
|
144
|
+
def initialize: (String, Location?, String, Herb::Token, String, String) -> void
|
|
160
145
|
|
|
161
146
|
# : () -> String
|
|
162
147
|
def inspect: () -> String
|
|
@@ -171,10 +156,10 @@ module Herb
|
|
|
171
156
|
class UnclosedElementError < Error
|
|
172
157
|
include Colors
|
|
173
158
|
|
|
174
|
-
attr_reader opening_tag: Herb::Token
|
|
159
|
+
attr_reader opening_tag: Herb::Token?
|
|
175
160
|
|
|
176
|
-
# : (String, Location
|
|
177
|
-
def initialize: (String, Location
|
|
161
|
+
# : (String, Location?, String, Herb::Token) -> void
|
|
162
|
+
def initialize: (String, Location?, String, Herb::Token) -> void
|
|
178
163
|
|
|
179
164
|
# : () -> String
|
|
180
165
|
def inspect: () -> String
|
|
@@ -189,14 +174,14 @@ module Herb
|
|
|
189
174
|
class RubyParseError < Error
|
|
190
175
|
include Colors
|
|
191
176
|
|
|
192
|
-
attr_reader error_message: String
|
|
177
|
+
attr_reader error_message: String?
|
|
193
178
|
|
|
194
|
-
attr_reader diagnostic_id: String
|
|
179
|
+
attr_reader diagnostic_id: String?
|
|
195
180
|
|
|
196
|
-
attr_reader level: String
|
|
181
|
+
attr_reader level: String?
|
|
197
182
|
|
|
198
|
-
# : (String, Location
|
|
199
|
-
def initialize: (String, Location
|
|
183
|
+
# : (String, Location?, String, String, String, String) -> void
|
|
184
|
+
def initialize: (String, Location?, String, String, String, String) -> void
|
|
200
185
|
|
|
201
186
|
# : () -> String
|
|
202
187
|
def inspect: () -> String
|
|
@@ -211,10 +196,10 @@ module Herb
|
|
|
211
196
|
class ERBControlFlowScopeError < Error
|
|
212
197
|
include Colors
|
|
213
198
|
|
|
214
|
-
attr_reader keyword: String
|
|
199
|
+
attr_reader keyword: String?
|
|
215
200
|
|
|
216
|
-
# : (String, Location
|
|
217
|
-
def initialize: (String, Location
|
|
201
|
+
# : (String, Location?, String, String) -> void
|
|
202
|
+
def initialize: (String, Location?, String, String) -> void
|
|
218
203
|
|
|
219
204
|
# : () -> String
|
|
220
205
|
def inspect: () -> String
|
|
@@ -229,16 +214,16 @@ module Herb
|
|
|
229
214
|
class MissingERBEndTagError < Error
|
|
230
215
|
include Colors
|
|
231
216
|
|
|
232
|
-
attr_reader keyword: String
|
|
217
|
+
attr_reader keyword: String?
|
|
233
218
|
|
|
234
|
-
# : (String, Location
|
|
235
|
-
def initialize: (String, Location
|
|
219
|
+
# : (String, Location?, String, String) -> void
|
|
220
|
+
def initialize: (String, Location?, String, String) -> void
|
|
236
221
|
|
|
237
222
|
# : () -> String
|
|
238
223
|
def inspect: () -> String
|
|
239
224
|
|
|
240
|
-
# : () ->
|
|
241
|
-
def to_hash: () ->
|
|
225
|
+
# : () -> serialized_missing_erb_end_tag_error
|
|
226
|
+
def to_hash: () -> serialized_missing_erb_end_tag_error
|
|
242
227
|
|
|
243
228
|
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
244
229
|
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
@@ -263,5 +248,329 @@ module Herb
|
|
|
263
248
|
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
264
249
|
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
265
250
|
end
|
|
251
|
+
|
|
252
|
+
class ConditionalElementMultipleTagsError < Error
|
|
253
|
+
include Colors
|
|
254
|
+
|
|
255
|
+
attr_reader line: Integer?
|
|
256
|
+
|
|
257
|
+
attr_reader column: Integer?
|
|
258
|
+
|
|
259
|
+
# : (String, Location?, String, Integer, Integer) -> void
|
|
260
|
+
def initialize: (String, Location?, String, Integer, Integer) -> void
|
|
261
|
+
|
|
262
|
+
# : () -> String
|
|
263
|
+
def inspect: () -> String
|
|
264
|
+
|
|
265
|
+
# : () -> serialized_conditional_element_multiple_tags_error
|
|
266
|
+
def to_hash: () -> serialized_conditional_element_multiple_tags_error
|
|
267
|
+
|
|
268
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
269
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
class ConditionalElementConditionMismatchError < Error
|
|
273
|
+
include Colors
|
|
274
|
+
|
|
275
|
+
attr_reader tag_name: String?
|
|
276
|
+
|
|
277
|
+
attr_reader open_condition: String?
|
|
278
|
+
|
|
279
|
+
attr_reader open_line: Integer?
|
|
280
|
+
|
|
281
|
+
attr_reader open_column: Integer?
|
|
282
|
+
|
|
283
|
+
attr_reader close_condition: String?
|
|
284
|
+
|
|
285
|
+
attr_reader close_line: Integer?
|
|
286
|
+
|
|
287
|
+
attr_reader close_column: Integer?
|
|
288
|
+
|
|
289
|
+
# : (String, Location?, String, String, String, Integer, Integer, String, Integer, Integer) -> void
|
|
290
|
+
def initialize: (String, Location?, String, String, String, Integer, Integer, String, Integer, Integer) -> void
|
|
291
|
+
|
|
292
|
+
# : () -> String
|
|
293
|
+
def inspect: () -> String
|
|
294
|
+
|
|
295
|
+
# : () -> serialized_conditional_element_condition_mismatch_error
|
|
296
|
+
def to_hash: () -> serialized_conditional_element_condition_mismatch_error
|
|
297
|
+
|
|
298
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
299
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
class InvalidCommentClosingTagError < Error
|
|
303
|
+
include Colors
|
|
304
|
+
|
|
305
|
+
attr_reader closing_tag: Herb::Token?
|
|
306
|
+
|
|
307
|
+
# : (String, Location?, String, Herb::Token) -> void
|
|
308
|
+
def initialize: (String, Location?, String, Herb::Token) -> void
|
|
309
|
+
|
|
310
|
+
# : () -> String
|
|
311
|
+
def inspect: () -> String
|
|
312
|
+
|
|
313
|
+
# : () -> serialized_invalid_comment_closing_tag_error
|
|
314
|
+
def to_hash: () -> serialized_invalid_comment_closing_tag_error
|
|
315
|
+
|
|
316
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
317
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
class OmittedClosingTagError < Error
|
|
321
|
+
include Colors
|
|
322
|
+
|
|
323
|
+
attr_reader opening_tag: Herb::Token?
|
|
324
|
+
|
|
325
|
+
attr_reader insertion_point: Herb::Position?
|
|
326
|
+
|
|
327
|
+
# : (String, Location?, String, Herb::Token, Herb::Position) -> void
|
|
328
|
+
def initialize: (String, Location?, String, Herb::Token, Herb::Position) -> void
|
|
329
|
+
|
|
330
|
+
# : () -> String
|
|
331
|
+
def inspect: () -> String
|
|
332
|
+
|
|
333
|
+
# : () -> serialized_omitted_closing_tag_error
|
|
334
|
+
def to_hash: () -> serialized_omitted_closing_tag_error
|
|
335
|
+
|
|
336
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
337
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
class UnclosedOpenTagError < Error
|
|
341
|
+
include Colors
|
|
342
|
+
|
|
343
|
+
attr_reader tag_name: Herb::Token?
|
|
344
|
+
|
|
345
|
+
# : (String, Location?, String, Herb::Token) -> void
|
|
346
|
+
def initialize: (String, Location?, String, Herb::Token) -> void
|
|
347
|
+
|
|
348
|
+
# : () -> String
|
|
349
|
+
def inspect: () -> String
|
|
350
|
+
|
|
351
|
+
# : () -> serialized_unclosed_open_tag_error
|
|
352
|
+
def to_hash: () -> serialized_unclosed_open_tag_error
|
|
353
|
+
|
|
354
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
355
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
class UnclosedCloseTagError < Error
|
|
359
|
+
include Colors
|
|
360
|
+
|
|
361
|
+
attr_reader tag_name: Herb::Token?
|
|
362
|
+
|
|
363
|
+
# : (String, Location?, String, Herb::Token) -> void
|
|
364
|
+
def initialize: (String, Location?, String, Herb::Token) -> void
|
|
365
|
+
|
|
366
|
+
# : () -> String
|
|
367
|
+
def inspect: () -> String
|
|
368
|
+
|
|
369
|
+
# : () -> serialized_unclosed_close_tag_error
|
|
370
|
+
def to_hash: () -> serialized_unclosed_close_tag_error
|
|
371
|
+
|
|
372
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
373
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
class UnclosedQuoteError < Error
|
|
377
|
+
include Colors
|
|
378
|
+
|
|
379
|
+
attr_reader opening_quote: Herb::Token?
|
|
380
|
+
|
|
381
|
+
# : (String, Location?, String, Herb::Token) -> void
|
|
382
|
+
def initialize: (String, Location?, String, Herb::Token) -> void
|
|
383
|
+
|
|
384
|
+
# : () -> String
|
|
385
|
+
def inspect: () -> String
|
|
386
|
+
|
|
387
|
+
# : () -> serialized_unclosed_quote_error
|
|
388
|
+
def to_hash: () -> serialized_unclosed_quote_error
|
|
389
|
+
|
|
390
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
391
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
class MissingAttributeValueError < Error
|
|
395
|
+
include Colors
|
|
396
|
+
|
|
397
|
+
attr_reader attribute_name: String?
|
|
398
|
+
|
|
399
|
+
# : (String, Location?, String, String) -> void
|
|
400
|
+
def initialize: (String, Location?, String, String) -> void
|
|
401
|
+
|
|
402
|
+
# : () -> String
|
|
403
|
+
def inspect: () -> String
|
|
404
|
+
|
|
405
|
+
# : () -> serialized_missing_attribute_value_error
|
|
406
|
+
def to_hash: () -> serialized_missing_attribute_value_error
|
|
407
|
+
|
|
408
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
409
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
class UnclosedERBTagError < Error
|
|
413
|
+
include Colors
|
|
414
|
+
|
|
415
|
+
attr_reader opening_tag: Herb::Token?
|
|
416
|
+
|
|
417
|
+
# : (String, Location?, String, Herb::Token) -> void
|
|
418
|
+
def initialize: (String, Location?, String, Herb::Token) -> void
|
|
419
|
+
|
|
420
|
+
# : () -> String
|
|
421
|
+
def inspect: () -> String
|
|
422
|
+
|
|
423
|
+
# : () -> serialized_unclosed_erb_tag_error
|
|
424
|
+
def to_hash: () -> serialized_unclosed_erb_tag_error
|
|
425
|
+
|
|
426
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
427
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
class StrayERBClosingTagError < Error
|
|
431
|
+
include Colors
|
|
432
|
+
|
|
433
|
+
# : () -> String
|
|
434
|
+
def inspect: () -> String
|
|
435
|
+
|
|
436
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
437
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
438
|
+
end
|
|
439
|
+
|
|
440
|
+
class NestedERBTagError < Error
|
|
441
|
+
include Colors
|
|
442
|
+
|
|
443
|
+
attr_reader opening_tag: Herb::Token?
|
|
444
|
+
|
|
445
|
+
attr_reader nested_tag_line: Integer?
|
|
446
|
+
|
|
447
|
+
attr_reader nested_tag_column: Integer?
|
|
448
|
+
|
|
449
|
+
# : (String, Location?, String, Herb::Token, Integer, Integer) -> void
|
|
450
|
+
def initialize: (String, Location?, String, Herb::Token, Integer, Integer) -> void
|
|
451
|
+
|
|
452
|
+
# : () -> String
|
|
453
|
+
def inspect: () -> String
|
|
454
|
+
|
|
455
|
+
# : () -> serialized_nested_erb_tag_error
|
|
456
|
+
def to_hash: () -> serialized_nested_erb_tag_error
|
|
457
|
+
|
|
458
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
459
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
class RenderAmbiguousLocalsError < Error
|
|
463
|
+
include Colors
|
|
464
|
+
|
|
465
|
+
attr_reader partial: String?
|
|
466
|
+
|
|
467
|
+
# : (String, Location?, String, String) -> void
|
|
468
|
+
def initialize: (String, Location?, String, String) -> void
|
|
469
|
+
|
|
470
|
+
# : () -> String
|
|
471
|
+
def inspect: () -> String
|
|
472
|
+
|
|
473
|
+
# : () -> serialized_render_ambiguous_locals_error
|
|
474
|
+
def to_hash: () -> serialized_render_ambiguous_locals_error
|
|
475
|
+
|
|
476
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
477
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
class RenderMissingLocalsError < Error
|
|
481
|
+
include Colors
|
|
482
|
+
|
|
483
|
+
attr_reader partial: String?
|
|
484
|
+
|
|
485
|
+
attr_reader keywords: String?
|
|
486
|
+
|
|
487
|
+
# : (String, Location?, String, String, String) -> void
|
|
488
|
+
def initialize: (String, Location?, String, String, String) -> void
|
|
489
|
+
|
|
490
|
+
# : () -> String
|
|
491
|
+
def inspect: () -> String
|
|
492
|
+
|
|
493
|
+
# : () -> serialized_render_missing_locals_error
|
|
494
|
+
def to_hash: () -> serialized_render_missing_locals_error
|
|
495
|
+
|
|
496
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
497
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
498
|
+
end
|
|
499
|
+
|
|
500
|
+
class RenderNoArgumentsError < Error
|
|
501
|
+
include Colors
|
|
502
|
+
|
|
503
|
+
# : () -> String
|
|
504
|
+
def inspect: () -> String
|
|
505
|
+
|
|
506
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
507
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
508
|
+
end
|
|
509
|
+
|
|
510
|
+
class RenderConflictingPartialError < Error
|
|
511
|
+
include Colors
|
|
512
|
+
|
|
513
|
+
attr_reader positional_partial: String?
|
|
514
|
+
|
|
515
|
+
attr_reader keyword_partial: String?
|
|
516
|
+
|
|
517
|
+
# : (String, Location?, String, String, String) -> void
|
|
518
|
+
def initialize: (String, Location?, String, String, String) -> void
|
|
519
|
+
|
|
520
|
+
# : () -> String
|
|
521
|
+
def inspect: () -> String
|
|
522
|
+
|
|
523
|
+
# : () -> serialized_render_conflicting_partial_error
|
|
524
|
+
def to_hash: () -> serialized_render_conflicting_partial_error
|
|
525
|
+
|
|
526
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
527
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
528
|
+
end
|
|
529
|
+
|
|
530
|
+
class RenderInvalidAsOptionError < Error
|
|
531
|
+
include Colors
|
|
532
|
+
|
|
533
|
+
attr_reader as_value: String?
|
|
534
|
+
|
|
535
|
+
# : (String, Location?, String, String) -> void
|
|
536
|
+
def initialize: (String, Location?, String, String) -> void
|
|
537
|
+
|
|
538
|
+
# : () -> String
|
|
539
|
+
def inspect: () -> String
|
|
540
|
+
|
|
541
|
+
# : () -> serialized_render_invalid_as_option_error
|
|
542
|
+
def to_hash: () -> serialized_render_invalid_as_option_error
|
|
543
|
+
|
|
544
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
545
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
546
|
+
end
|
|
547
|
+
|
|
548
|
+
class RenderObjectAndCollectionError < Error
|
|
549
|
+
include Colors
|
|
550
|
+
|
|
551
|
+
# : () -> String
|
|
552
|
+
def inspect: () -> String
|
|
553
|
+
|
|
554
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
555
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
556
|
+
end
|
|
557
|
+
|
|
558
|
+
class RenderLayoutWithoutBlockError < Error
|
|
559
|
+
include Colors
|
|
560
|
+
|
|
561
|
+
attr_reader layout: String?
|
|
562
|
+
|
|
563
|
+
# : (String, Location?, String, String) -> void
|
|
564
|
+
def initialize: (String, Location?, String, String) -> void
|
|
565
|
+
|
|
566
|
+
# : () -> String
|
|
567
|
+
def inspect: () -> String
|
|
568
|
+
|
|
569
|
+
# : () -> serialized_render_layout_without_block_error
|
|
570
|
+
def to_hash: () -> serialized_render_layout_without_block_error
|
|
571
|
+
|
|
572
|
+
# : (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
573
|
+
def tree_inspect: (?indent: Integer, ?depth: Integer, ?depth_limit: Integer) -> String
|
|
574
|
+
end
|
|
266
575
|
end
|
|
267
576
|
end
|
data/sig/herb/location.rbs
CHANGED
data/sig/herb/parse_result.rbs
CHANGED
|
@@ -4,8 +4,10 @@ module Herb
|
|
|
4
4
|
class ParseResult < Result
|
|
5
5
|
attr_reader value: Herb::AST::DocumentNode
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
attr_reader options: Herb::ParserOptions
|
|
8
|
+
|
|
9
|
+
# : (Herb::AST::DocumentNode, String, Array[Herb::Warnings::Warning], Array[Herb::Errors::Error], Herb::ParserOptions) -> void
|
|
10
|
+
def initialize: (Herb::AST::DocumentNode, String, Array[Herb::Warnings::Warning], Array[Herb::Errors::Error], Herb::ParserOptions) -> void
|
|
9
11
|
|
|
10
12
|
# : () -> Array[Herb::Errors::Error]
|
|
11
13
|
def errors: () -> Array[Herb::Errors::Error]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Generated from lib/herb/parser_options.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Herb
|
|
4
|
+
class ParserOptions
|
|
5
|
+
attr_reader strict: bool
|
|
6
|
+
|
|
7
|
+
attr_reader track_whitespace: bool
|
|
8
|
+
|
|
9
|
+
attr_reader analyze: bool
|
|
10
|
+
|
|
11
|
+
attr_reader action_view_helpers: bool
|
|
12
|
+
|
|
13
|
+
attr_reader render_nodes: bool
|
|
14
|
+
|
|
15
|
+
attr_reader prism_program: bool
|
|
16
|
+
|
|
17
|
+
attr_reader prism_nodes: bool
|
|
18
|
+
|
|
19
|
+
attr_reader prism_nodes_deep: bool
|
|
20
|
+
|
|
21
|
+
DEFAULT_STRICT: bool
|
|
22
|
+
|
|
23
|
+
DEFAULT_TRACK_WHITESPACE: bool
|
|
24
|
+
|
|
25
|
+
DEFAULT_ANALYZE: bool
|
|
26
|
+
|
|
27
|
+
DEFAULT_ACTION_VIEW_HELPERS: bool
|
|
28
|
+
|
|
29
|
+
DEFAULT_RENDER_NODES: bool
|
|
30
|
+
|
|
31
|
+
DEFAULT_PRISM_PROGRAM: bool
|
|
32
|
+
|
|
33
|
+
DEFAULT_PRISM_NODES: bool
|
|
34
|
+
|
|
35
|
+
DEFAULT_PRISM_NODES_DEEP: bool
|
|
36
|
+
|
|
37
|
+
# : (?strict: bool, ?track_whitespace: bool, ?analyze: bool, ?action_view_helpers: bool, ?prism_nodes: bool, ?prism_nodes_deep: bool, ?prism_program: bool) -> void
|
|
38
|
+
def initialize: (?strict: bool, ?track_whitespace: bool, ?analyze: bool, ?action_view_helpers: bool, ?prism_nodes: bool, ?prism_nodes_deep: bool, ?prism_program: bool) -> void
|
|
39
|
+
|
|
40
|
+
# : () -> Hash[Symbol, bool]
|
|
41
|
+
def to_h: () -> Hash[Symbol, bool]
|
|
42
|
+
|
|
43
|
+
# : () -> String
|
|
44
|
+
def inspect: () -> String
|
|
45
|
+
end
|
|
46
|
+
end
|
data/sig/herb/position.rbs
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Generated from lib/herb/prism_inspect.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Herb
|
|
4
|
+
module PrismInspect
|
|
5
|
+
SKIP_FIELDS: untyped
|
|
6
|
+
|
|
7
|
+
# : (String, String, String) -> String
|
|
8
|
+
def self.inspect_prism_serialized: (String, String, String) -> String
|
|
9
|
+
|
|
10
|
+
# : (Prism::Node, String, String) -> String
|
|
11
|
+
def self.inspect_prism_node: (Prism::Node, String, String) -> String
|
|
12
|
+
|
|
13
|
+
# : (Symbol, untyped, String, String, String, String) -> String
|
|
14
|
+
private def self.inspect_field: (Symbol, untyped, String, String, String, String) -> String
|
|
15
|
+
|
|
16
|
+
# : (Symbol, Prism::Node, String, String, String, String) -> String
|
|
17
|
+
private def self.inspect_node_field: (Symbol, Prism::Node, String, String, String, String) -> String
|
|
18
|
+
|
|
19
|
+
# : (Symbol, Array[untyped], String, String, String, String) -> String
|
|
20
|
+
private def self.inspect_array_field: (Symbol, Array[untyped], String, String, String, String) -> String
|
|
21
|
+
|
|
22
|
+
# : (untyped) -> Array[[Symbol, untyped]]
|
|
23
|
+
private def self.display_fields: (untyped) -> Array[[ Symbol, untyped ]]
|
|
24
|
+
|
|
25
|
+
# : (Prism::Location) -> String
|
|
26
|
+
private def self.format_location: (Prism::Location) -> String
|
|
27
|
+
end
|
|
28
|
+
end
|
data/sig/herb/range.rbs
CHANGED
data/sig/herb/token.rbs
CHANGED