Herb C Reference
Loading...
Searching...
No Matches
errors.h
Go to the documentation of this file.
1// NOTE: This file is generated by the templates/template.rb script and should not
2// be modified manually. See /home/runner/work/herb/herb/templates/src/include/errors.h.erb
3
4#ifndef HERB_ERRORS_H
5#define HERB_ERRORS_H
6
7#include "errors.h"
8#include "location/location.h"
9#include "location/position.h"
10#include "lexer/token.h"
11#include "lib/hb_allocator.h"
12#include "lib/hb_array.h"
13#include "lib/hb_buffer.h"
14#include "lib/hb_string.h"
15
16struct PARSER_OPTIONS_STRUCT;
17
59
60typedef struct ERROR_STRUCT {
62 location_T location;
63 hb_string_T message;
65
66
67typedef struct {
69 hb_string_T description;
70 hb_string_T expected;
71 hb_string_T found;
73
74typedef struct {
76 token_type_T expected_type;
77 token_T* found;
79
84
89
90typedef struct {
92 token_T* opening_tag;
93 token_T* closing_tag;
95
96typedef struct {
98 token_T* tag_name;
99 hb_string_T expected;
100 hb_string_T found;
102
107
108typedef struct {
110 hb_string_T error_message;
111 hb_string_T diagnostic_id;
112 hb_string_T level;
114
115typedef struct {
117 hb_string_T keyword;
119
120typedef struct {
122 hb_string_T keyword;
124
125typedef struct {
127 /* no additional fields */
129
130typedef struct {
132 /* no additional fields */
134
140
151
156
162
163typedef struct {
165 token_T* tag_name;
167
168typedef struct {
170 token_T* tag_name;
172
177
182
187
193
194typedef struct {
196 /* no additional fields */
198
205
206typedef struct {
208 hb_string_T partial;
210
211typedef struct {
213 hb_string_T partial;
214 hb_string_T keywords;
216
217typedef struct {
219 /* no additional fields */
221
227
232
233typedef struct {
235 /* no additional fields */
237
242
247
252
257
262
263typedef struct {
265 /* no additional fields */
267
268typedef struct {
270 token_T* tag_name;
271 hb_string_T helper_name;
272 hb_string_T content_type;
274
275typedef struct {
277 token_T* segment;
279
280typedef struct {
284
285UNEXPECTED_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);
286void 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, const struct PARSER_OPTIONS_STRUCT* options);
287UNEXPECTED_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);
288void 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, const struct PARSER_OPTIONS_STRUCT* options);
289MISSING_OPENING_TAG_ERROR_T* missing_opening_tag_error_init(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator);
290void append_missing_opening_tag_error(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
291MISSING_CLOSING_TAG_ERROR_T* missing_closing_tag_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator);
292void append_missing_closing_tag_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
293TAG_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);
294void 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, const struct PARSER_OPTIONS_STRUCT* options);
295VOID_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);
296void 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, const struct PARSER_OPTIONS_STRUCT* options);
297UNCLOSED_ELEMENT_ERROR_T* unclosed_element_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator);
298void append_unclosed_element_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
299RUBY_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);
300void 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, const struct PARSER_OPTIONS_STRUCT* options);
301ERB_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);
302void append_erb_control_flow_scope_error(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
303MISSING_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);
304void append_missing_erb_end_tag_error(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
305ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR_T* erb_multiple_blocks_in_tag_error_init(position_T start, position_T end, hb_allocator_T* allocator);
306void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
307ERB_CASE_WITH_CONDITIONS_ERROR_T* erb_case_with_conditions_error_init(position_T start, position_T end, hb_allocator_T* allocator);
308void append_erb_case_with_conditions_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
309CONDITIONAL_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);
310void 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, const struct PARSER_OPTIONS_STRUCT* options);
311CONDITIONAL_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);
312void 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, const struct PARSER_OPTIONS_STRUCT* options);
313INVALID_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);
314void append_invalid_comment_closing_tag_error(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
315OMITTED_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);
316void 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, const struct PARSER_OPTIONS_STRUCT* options);
317UNCLOSED_OPEN_TAG_ERROR_T* unclosed_open_tag_error_init(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator);
318void append_unclosed_open_tag_error(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
319UNCLOSED_CLOSE_TAG_ERROR_T* unclosed_close_tag_error_init(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator);
320void append_unclosed_close_tag_error(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
321UNCLOSED_QUOTE_ERROR_T* unclosed_quote_error_init(token_T* opening_quote, position_T start, position_T end, hb_allocator_T* allocator);
322void append_unclosed_quote_error(token_T* opening_quote, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
323MISSING_ATTRIBUTE_VALUE_ERROR_T* missing_attribute_value_error_init(hb_string_T attribute_name, position_T start, position_T end, hb_allocator_T* allocator);
324void append_missing_attribute_value_error(hb_string_T attribute_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
325UNCLOSED_ERB_TAG_ERROR_T* unclosed_erb_tag_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator);
326void append_unclosed_erb_tag_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
327MALFORMED_ERB_CLOSING_TAG_ERROR_T* malformed_erb_closing_tag_error_init(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator);
328void append_malformed_erb_closing_tag_error(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
329STRAY_ERB_CLOSING_TAG_ERROR_T* stray_erb_closing_tag_error_init(position_T start, position_T end, hb_allocator_T* allocator);
330void append_stray_erb_closing_tag_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
331NESTED_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);
332void 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, const struct PARSER_OPTIONS_STRUCT* options);
333RENDER_AMBIGUOUS_LOCALS_ERROR_T* render_ambiguous_locals_error_init(hb_string_T partial, position_T start, position_T end, hb_allocator_T* allocator);
334void append_render_ambiguous_locals_error(hb_string_T partial, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
335RENDER_MISSING_LOCALS_ERROR_T* render_missing_locals_error_init(hb_string_T partial, hb_string_T keywords, position_T start, position_T end, hb_allocator_T* allocator);
336void append_render_missing_locals_error(hb_string_T partial, hb_string_T keywords, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
337RENDER_NO_ARGUMENTS_ERROR_T* render_no_arguments_error_init(position_T start, position_T end, hb_allocator_T* allocator);
338void append_render_no_arguments_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
339RENDER_CONFLICTING_PARTIAL_ERROR_T* render_conflicting_partial_error_init(hb_string_T positional_partial, hb_string_T keyword_partial, position_T start, position_T end, hb_allocator_T* allocator);
340void append_render_conflicting_partial_error(hb_string_T positional_partial, hb_string_T keyword_partial, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
341RENDER_INVALID_AS_OPTION_ERROR_T* render_invalid_as_option_error_init(hb_string_T as_value, position_T start, position_T end, hb_allocator_T* allocator);
342void append_render_invalid_as_option_error(hb_string_T as_value, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
343RENDER_OBJECT_AND_COLLECTION_ERROR_T* render_object_and_collection_error_init(position_T start, position_T end, hb_allocator_T* allocator);
344void append_render_object_and_collection_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
345RENDER_LAYOUT_WITHOUT_BLOCK_ERROR_T* render_layout_without_block_error_init(hb_string_T layout, position_T start, position_T end, hb_allocator_T* allocator);
346void append_render_layout_without_block_error(hb_string_T layout, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
347STRICT_LOCALS_POSITIONAL_ARGUMENT_ERROR_T* strict_locals_positional_argument_error_init(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator);
348void append_strict_locals_positional_argument_error(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
349STRICT_LOCALS_BLOCK_ARGUMENT_ERROR_T* strict_locals_block_argument_error_init(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator);
350void append_strict_locals_block_argument_error(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
351STRICT_LOCALS_SPLAT_ARGUMENT_ERROR_T* strict_locals_splat_argument_error_init(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator);
352void append_strict_locals_splat_argument_error(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
353STRICT_LOCALS_MISSING_PARENTHESIS_ERROR_T* strict_locals_missing_parenthesis_error_init(hb_string_T rest, position_T start, position_T end, hb_allocator_T* allocator);
354void append_strict_locals_missing_parenthesis_error(hb_string_T rest, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
355STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR_T* strict_locals_duplicate_declaration_error_init(position_T start, position_T end, hb_allocator_T* allocator);
356void append_strict_locals_duplicate_declaration_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
357VOID_ELEMENT_CONTENT_ERROR_T* void_element_content_error_init(token_T* tag_name, hb_string_T helper_name, hb_string_T content_type, position_T start, position_T end, hb_allocator_T* allocator);
358void append_void_element_content_error(token_T* tag_name, hb_string_T helper_name, hb_string_T content_type, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
359DOT_NOTATION_CASING_ERROR_T* dot_notation_casing_error_init(token_T* segment, position_T start, position_T end, hb_allocator_T* allocator);
360void append_dot_notation_casing_error(token_T* segment, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
361TIMEOUT_ERROR_T* timeout_error_init(size_t timeout_ms, position_T start, position_T end, hb_allocator_T* allocator);
362void append_timeout_error(size_t timeout_ms, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options);
363
364void error_init(ERROR_T* error, error_type_T type, position_T start, position_T end);
365
366size_t error_sizeof(void);
368
369hb_string_T error_message(ERROR_T* error);
370
371hb_string_T error_type_to_string(ERROR_T* error);
372hb_string_T error_human_type(ERROR_T* error);
373
374void error_free(ERROR_T* error, hb_allocator_T* allocator);
375
376#ifndef HERB_EXCLUDE_PRETTYPRINT
377 void error_pretty_print(ERROR_T* error, size_t indent, size_t relative_indent, hb_buffer_T* buffer);
378
380 const char* name, hb_array_T* array, size_t indent, size_t relative_indent, bool last_property,
381 hb_buffer_T* buffer
382 );
383#endif
384
385#endif
RENDER_NO_ARGUMENTS_ERROR_T * render_no_arguments_error_init(position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:1047
void append_strict_locals_positional_argument_error(hb_string_T name, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:1230
error_type_T error_type(ERROR_T *error)
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)
Definition errors.c:414
void append_strict_locals_duplicate_declaration_error(position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:1355
void append_missing_closing_tag_error(token_T *opening_tag, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:195
STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR_T * strict_locals_duplicate_declaration_error_init(position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:1343
void append_strict_locals_splat_argument_error(hb_string_T name, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:1300
UNCLOSED_ERB_TAG_ERROR_T * unclosed_erb_tag_error_init(token_T *opening_tag, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:807
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)
Definition errors.c:203
STRICT_LOCALS_POSITIONAL_ARGUMENT_ERROR_T * strict_locals_positional_argument_error_init(hb_string_T name, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:1198
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, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:116
void append_render_conflicting_partial_error(hb_string_T positional_partial, hb_string_T keyword_partial, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:1100
void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:461
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)
Definition errors.c:379
void append_unclosed_close_tag_error(token_T *tag_name, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:725
void append_render_ambiguous_locals_error(hb_string_T partial, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:993
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, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:799
void append_malformed_erb_closing_tag_error(token_T *opening_tag, token_T *closing_tag, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:881
UNCLOSED_QUOTE_ERROR_T * unclosed_quote_error_init(token_T *opening_quote, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:733
void append_strict_locals_block_argument_error(hb_string_T name, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:1265
ERB_CASE_WITH_CONDITIONS_ERROR_T * erb_case_with_conditions_error_init(position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:469
UNCLOSED_CLOSE_TAG_ERROR_T * unclosed_close_tag_error_init(token_T *tag_name, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:696
void append_stray_erb_closing_tag_error(position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:912
RENDER_LAYOUT_WITHOUT_BLOCK_ERROR_T * render_layout_without_block_error_init(hb_string_T layout, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:1163
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)
Definition errors.c:920
void append_void_element_content_error(token_T *tag_name, hb_string_T helper_name, hb_string_T content_type, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:1402
void append_dot_notation_casing_error(token_T *segment, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:1437
void append_render_no_arguments_error(position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:1059
MISSING_CLOSING_TAG_ERROR_T * missing_closing_tag_error_init(token_T *opening_tag, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:161
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, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:953
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, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:371
RENDER_AMBIGUOUS_LOCALS_ERROR_T * render_ambiguous_locals_error_init(hb_string_T partial, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:961
ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR_T * erb_multiple_blocks_in_tag_error_init(position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:449
void append_unclosed_quote_error(token_T *opening_quote, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:762
hb_string_T error_message(ERROR_T *error)
STRICT_LOCALS_MISSING_PARENTHESIS_ERROR_T * strict_locals_missing_parenthesis_error_init(hb_string_T rest, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:1308
RENDER_MISSING_LOCALS_ERROR_T * render_missing_locals_error_init(hb_string_T partial, hb_string_T keywords, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:1001
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, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:73
STRAY_ERB_CLOSING_TAG_ERROR_T * stray_erb_closing_tag_error_init(position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:889
void append_erb_case_with_conditions_error(position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:481
struct ERROR_STRUCT ERROR_T
void error_pretty_print(ERROR_T *error, size_t indent, size_t relative_indent, hb_buffer_T *buffer)
Definition errors.c:2488
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)
Definition errors.c:34
error_type_T
Definition errors.h:18
@ CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR
Definition errors.h:31
@ RENDER_MISSING_LOCALS_ERROR
Definition errors.h:44
@ RENDER_OBJECT_AND_COLLECTION_ERROR
Definition errors.h:48
@ RENDER_AMBIGUOUS_LOCALS_ERROR
Definition errors.h:43
@ UNEXPECTED_ERROR
Definition errors.h:19
@ STRICT_LOCALS_POSITIONAL_ARGUMENT_ERROR
Definition errors.h:50
@ UNCLOSED_OPEN_TAG_ERROR
Definition errors.h:35
@ RENDER_NO_ARGUMENTS_ERROR
Definition errors.h:45
@ STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR
Definition errors.h:54
@ DOT_NOTATION_CASING_ERROR
Definition errors.h:56
@ RENDER_CONFLICTING_PARTIAL_ERROR
Definition errors.h:46
@ ERB_CASE_WITH_CONDITIONS_ERROR
Definition errors.h:30
@ STRICT_LOCALS_SPLAT_ARGUMENT_ERROR
Definition errors.h:52
@ UNEXPECTED_TOKEN_ERROR
Definition errors.h:20
@ STRICT_LOCALS_BLOCK_ARGUMENT_ERROR
Definition errors.h:51
@ VOID_ELEMENT_CLOSING_TAG_ERROR
Definition errors.h:24
@ MISSING_CLOSING_TAG_ERROR
Definition errors.h:22
@ TIMEOUT_ERROR
Definition errors.h:57
@ VOID_ELEMENT_CONTENT_ERROR
Definition errors.h:55
@ MISSING_ATTRIBUTE_VALUE_ERROR
Definition errors.h:38
@ OMITTED_CLOSING_TAG_ERROR
Definition errors.h:34
@ NESTED_ERB_TAG_ERROR
Definition errors.h:42
@ RUBY_PARSE_ERROR
Definition errors.h:26
@ INVALID_COMMENT_CLOSING_TAG_ERROR
Definition errors.h:33
@ STRAY_ERB_CLOSING_TAG_ERROR
Definition errors.h:41
@ TAG_NAMES_MISMATCH_ERROR
Definition errors.h:23
@ CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR
Definition errors.h:32
@ UNCLOSED_ELEMENT_ERROR
Definition errors.h:25
@ MISSING_ERB_END_TAG_ERROR
Definition errors.h:28
@ ERB_CONTROL_FLOW_SCOPE_ERROR
Definition errors.h:27
@ STRICT_LOCALS_MISSING_PARENTHESIS_ERROR
Definition errors.h:53
@ RENDER_INVALID_AS_OPTION_ERROR
Definition errors.h:47
@ UNCLOSED_QUOTE_ERROR
Definition errors.h:37
@ MALFORMED_ERB_CLOSING_TAG_ERROR
Definition errors.h:40
@ UNCLOSED_ERB_TAG_ERROR
Definition errors.h:39
@ UNCLOSED_CLOSE_TAG_ERROR
Definition errors.h:36
@ MISSING_OPENING_TAG_ERROR
Definition errors.h:21
@ ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR
Definition errors.h:29
@ RENDER_LAYOUT_WITHOUT_BLOCK_ERROR
Definition errors.h:49
void error_free(ERROR_T *error, hb_allocator_T *allocator)
Definition errors.c:1833
UNCLOSED_OPEN_TAG_ERROR_T * unclosed_open_tag_error_init(token_T *tag_name, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:659
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)
Definition errors.c:248
STRICT_LOCALS_SPLAT_ARGUMENT_ERROR_T * strict_locals_splat_argument_error_init(hb_string_T name, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:1273
void append_timeout_error(size_t timeout_ms, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:1468
size_t error_sizeof(void)
Definition errors.c:22
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, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:292
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)
Definition errors.c:522
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)
Definition errors.c:770
hb_string_T error_human_type(ERROR_T *error)
Definition errors.c:1522
MISSING_OPENING_TAG_ERROR_T * missing_opening_tag_error_init(token_T *closing_tag, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:124
void error_init(ERROR_T *error, error_type_T type, position_T start, position_T end)
Definition errors.c:26
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)
Definition errors.c:81
MALFORMED_ERB_CLOSING_TAG_ERROR_T * malformed_erb_closing_tag_error_init(token_T *opening_tag, token_T *closing_tag, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:844
void error_pretty_print_array(const char *name, hb_array_T *array, size_t indent, size_t relative_indent, bool last_property, hb_buffer_T *buffer)
Definition errors.c:1881
void append_unclosed_element_error(token_T *opening_tag, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:329
RENDER_CONFLICTING_PARTIAL_ERROR_T * render_conflicting_partial_error_init(hb_string_T positional_partial, hb_string_T keyword_partial, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:1067
hb_string_T error_type_to_string(ERROR_T *error)
Definition errors.c:1476
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, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:406
void append_strict_locals_missing_parenthesis_error(hb_string_T rest, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:1335
void append_unclosed_erb_tag_error(token_T *opening_tag, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:836
STRICT_LOCALS_BLOCK_ARGUMENT_ERROR_T * strict_locals_block_argument_error_init(hb_string_T name, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:1238
void append_render_missing_locals_error(hb_string_T partial, hb_string_T keywords, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:1039
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, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:651
void append_render_object_and_collection_error(position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:1155
void append_missing_opening_tag_error(token_T *closing_tag, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:153
DOT_NOTATION_CASING_ERROR_T * dot_notation_casing_error_init(token_T *segment, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:1410
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)
Definition errors.c:577
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, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:606
TIMEOUT_ERROR_T * timeout_error_init(size_t timeout_ms, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:1445
RENDER_INVALID_AS_OPTION_ERROR_T * render_invalid_as_option_error_init(hb_string_T as_value, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:1108
RENDER_OBJECT_AND_COLLECTION_ERROR_T * render_object_and_collection_error_init(position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:1143
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)
Definition errors.c:489
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)
Definition errors.c:337
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, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:514
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, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:441
void append_unclosed_open_tag_error(token_T *tag_name, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:688
void append_render_layout_without_block_error(hb_string_T layout, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:1190
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)
Definition errors.c:614
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, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:569
VOID_ELEMENT_CONTENT_ERROR_T * void_element_content_error_init(token_T *tag_name, hb_string_T helper_name, hb_string_T content_type, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:1363
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, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:240
UNCLOSED_ELEMENT_ERROR_T * unclosed_element_error_init(token_T *opening_tag, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:300
void append_render_invalid_as_option_error(hb_string_T as_value, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T **errors, const struct PARSER_OPTIONS_STRUCT *options)
Definition errors.c:1135
ERROR_T base
Definition errors.h:142
size_t open_column
Definition errors.h:146
hb_string_T close_condition
Definition errors.h:147
size_t open_line
Definition errors.h:145
size_t close_line
Definition errors.h:148
size_t close_column
Definition errors.h:149
hb_string_T open_condition
Definition errors.h:144
hb_string_T tag_name
Definition errors.h:143
size_t column
Definition errors.h:138
ERROR_T base
Definition errors.h:136
size_t line
Definition errors.h:137
Definition errors.h:275
token_T * segment
Definition errors.h:277
ERROR_T base
Definition errors.h:276
Definition errors.h:130
ERROR_T base
Definition errors.h:131
Definition errors.h:115
hb_string_T keyword
Definition errors.h:117
ERROR_T base
Definition errors.h:116
Definition errors.h:125
ERROR_T base
Definition errors.h:126
Definition errors.h:60
error_type_T type
Definition errors.h:61
location_T location
Definition errors.h:62
hb_string_T message
Definition errors.h:63
token_T * closing_tag
Definition errors.h:154
ERROR_T base
Definition errors.h:153
Definition errors.h:188
ERROR_T base
Definition errors.h:189
token_T * opening_tag
Definition errors.h:190
token_T * closing_tag
Definition errors.h:191
Definition errors.h:178
hb_string_T attribute_name
Definition errors.h:180
ERROR_T base
Definition errors.h:179
Definition errors.h:85
ERROR_T base
Definition errors.h:86
token_T * opening_tag
Definition errors.h:87
Definition errors.h:120
hb_string_T keyword
Definition errors.h:122
ERROR_T base
Definition errors.h:121
Definition errors.h:80
token_T * closing_tag
Definition errors.h:82
ERROR_T base
Definition errors.h:81
Definition errors.h:199
size_t nested_tag_line
Definition errors.h:202
size_t nested_tag_column
Definition errors.h:203
ERROR_T base
Definition errors.h:200
token_T * opening_tag
Definition errors.h:201
Definition errors.h:157
ERROR_T base
Definition errors.h:158
position_T insertion_point
Definition errors.h:160
token_T * opening_tag
Definition errors.h:159
Definition errors.h:206
ERROR_T base
Definition errors.h:207
hb_string_T partial
Definition errors.h:208
Definition errors.h:222
hb_string_T keyword_partial
Definition errors.h:225
ERROR_T base
Definition errors.h:223
hb_string_T positional_partial
Definition errors.h:224
Definition errors.h:228
ERROR_T base
Definition errors.h:229
hb_string_T as_value
Definition errors.h:230
hb_string_T layout
Definition errors.h:240
ERROR_T base
Definition errors.h:239
Definition errors.h:211
hb_string_T partial
Definition errors.h:213
hb_string_T keywords
Definition errors.h:214
ERROR_T base
Definition errors.h:212
Definition errors.h:217
ERROR_T base
Definition errors.h:218
ERROR_T base
Definition errors.h:234
Definition errors.h:108
ERROR_T base
Definition errors.h:109
hb_string_T level
Definition errors.h:112
hb_string_T error_message
Definition errors.h:110
hb_string_T diagnostic_id
Definition errors.h:111
Definition errors.h:194
ERROR_T base
Definition errors.h:195
hb_string_T name
Definition errors.h:250
ERROR_T base
Definition errors.h:249
ERROR_T base
Definition errors.h:264
ERROR_T base
Definition errors.h:259
hb_string_T rest
Definition errors.h:260
hb_string_T name
Definition errors.h:245
ERROR_T base
Definition errors.h:244
hb_string_T name
Definition errors.h:255
ERROR_T base
Definition errors.h:254
Definition errors.h:90
token_T * opening_tag
Definition errors.h:92
token_T * closing_tag
Definition errors.h:93
ERROR_T base
Definition errors.h:91
Definition errors.h:280
ERROR_T base
Definition errors.h:281
size_t timeout_ms
Definition errors.h:282
Definition errors.h:168
token_T * tag_name
Definition errors.h:170
ERROR_T base
Definition errors.h:169
Definition errors.h:103
ERROR_T base
Definition errors.h:104
token_T * opening_tag
Definition errors.h:105
Definition errors.h:183
token_T * opening_tag
Definition errors.h:185
ERROR_T base
Definition errors.h:184
Definition errors.h:163
ERROR_T base
Definition errors.h:164
token_T * tag_name
Definition errors.h:165
Definition errors.h:173
token_T * opening_quote
Definition errors.h:175
ERROR_T base
Definition errors.h:174
Definition errors.h:67
hb_string_T expected
Definition errors.h:70
ERROR_T base
Definition errors.h:68
hb_string_T found
Definition errors.h:71
hb_string_T description
Definition errors.h:69
Definition errors.h:74
token_T * found
Definition errors.h:77
ERROR_T base
Definition errors.h:75
token_type_T expected_type
Definition errors.h:76
Definition errors.h:96
ERROR_T base
Definition errors.h:97
token_T * tag_name
Definition errors.h:98
hb_string_T expected
Definition errors.h:99
hb_string_T found
Definition errors.h:100
Definition errors.h:268
hb_string_T content_type
Definition errors.h:272
token_T * tag_name
Definition errors.h:270
ERROR_T base
Definition errors.h:269
hb_string_T helper_name
Definition errors.h:271