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.h"
9#include "position.h"
10#include "token.h"
11#include "util/hb_allocator.h"
12#include "util/hb_array.h"
13#include "util/hb_buffer.h"
14#include "util/hb_string.h"
15
41
47
48
49typedef struct {
51 hb_string_T description;
52 hb_string_T expected;
53 hb_string_T found;
55
61
66
71
77
78typedef struct {
81 hb_string_T expected;
82 hb_string_T found;
84
89
90typedef struct {
92 hb_string_T error_message;
93 hb_string_T diagnostic_id;
94 hb_string_T level;
96
97typedef struct {
99 hb_string_T keyword;
101
102typedef struct {
104 hb_string_T keyword;
106
107typedef struct {
109 /* no additional fields */
111
112typedef struct {
114 /* no additional fields */
116
122
133
138
144
149
154
159
164
169
170typedef struct {
172 /* no additional fields */
174
181
182UNEXPECTED_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);
183void 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);
184UNEXPECTED_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);
185void 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);
186MISSING_OPENING_TAG_ERROR_T* missing_opening_tag_error_init(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator);
187void append_missing_opening_tag_error(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
188MISSING_CLOSING_TAG_ERROR_T* missing_closing_tag_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator);
189void append_missing_closing_tag_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
190TAG_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);
191void 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);
192VOID_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);
193void 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);
194UNCLOSED_ELEMENT_ERROR_T* unclosed_element_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator);
195void append_unclosed_element_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
196RUBY_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);
197void 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);
198ERB_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);
199void append_erb_control_flow_scope_error(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
200MISSINGERB_END_TAG_ERROR_T* missingerb_end_tag_error_init(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator);
201void append_missingerb_end_tag_error(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
203void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
205void append_erb_case_with_conditions_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
206CONDITIONAL_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);
207void 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);
208CONDITIONAL_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);
209void 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);
211void append_invalid_comment_closing_tag_error(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
212OMITTED_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);
213void 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);
214UNCLOSED_OPEN_TAG_ERROR_T* unclosed_open_tag_error_init(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator);
215void append_unclosed_open_tag_error(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
216UNCLOSED_CLOSE_TAG_ERROR_T* unclosed_close_tag_error_init(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator);
217void append_unclosed_close_tag_error(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
218UNCLOSED_QUOTE_ERROR_T* unclosed_quote_error_init(token_T* opening_quote, position_T start, position_T end, hb_allocator_T* allocator);
219void append_unclosed_quote_error(token_T* opening_quote, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
220MISSING_ATTRIBUTE_VALUE_ERROR_T* missing_attribute_value_error_init(hb_string_T attribute_name, position_T start, position_T end, hb_allocator_T* allocator);
221void append_missing_attribute_value_error(hb_string_T attribute_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
222UNCLOSEDERB_TAG_ERROR_T* unclosederb_tag_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator);
223void append_unclosederb_tag_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
225void append_strayerb_closing_tag_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
226NESTEDERB_TAG_ERROR_T* nestederb_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);
227void append_nestederb_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);
228
229void error_init(ERROR_T* error, error_type_T type, position_T start, position_T end);
230
231size_t error_sizeof(void);
233
234hb_string_T error_message(ERROR_T* error);
235
236hb_string_T error_type_to_string(ERROR_T* error);
237hb_string_T error_human_type(ERROR_T* error);
238
239void error_free(ERROR_T* error, hb_allocator_T* allocator);
240
241#ifndef HERB_EXCLUDE_PRETTYPRINT
242 void error_pretty_print(ERROR_T* error, size_t indent, size_t relative_indent, hb_buffer_T* buffer);
243
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
249
250#endif
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)
Definition errors.c:590
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)
Definition errors.c:516
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)
Definition errors.c:342
error_type_T error_type(ERROR_T *error)
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)
Definition errors.c:549
void append_unclosed_open_tag_error(token_T *tag_name, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:623
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)
Definition errors.c:271
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:186
void append_unclosed_element_error(token_T *opening_tag, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:304
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)
Definition errors.c:223
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:346
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:660
STRAYERB_CLOSING_TAG_ERROR_T * strayerb_closing_tag_error_init(position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:759
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:424
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:627
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:148
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:408
hb_string_T error_message(ERROR_T *error)
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:1460
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:33
error_type_T
Definition errors.h:16
@ CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR
Definition errors.h:29
@ MISSINGERB_END_TAG_ERROR
Definition errors.h:26
@ NESTEDERB_TAG_ERROR
Definition errors.h:39
@ UNEXPECTED_ERROR
Definition errors.h:17
@ UNCLOSED_OPEN_TAG_ERROR
Definition errors.h:33
@ ERB_CASE_WITH_CONDITIONS_ERROR
Definition errors.h:28
@ UNEXPECTED_TOKEN_ERROR
Definition errors.h:18
@ VOID_ELEMENT_CLOSING_TAG_ERROR
Definition errors.h:22
@ MISSING_CLOSING_TAG_ERROR
Definition errors.h:20
@ UNCLOSEDERB_TAG_ERROR
Definition errors.h:37
@ MISSING_ATTRIBUTE_VALUE_ERROR
Definition errors.h:36
@ STRAYERB_CLOSING_TAG_ERROR
Definition errors.h:38
@ OMITTED_CLOSING_TAG_ERROR
Definition errors.h:32
@ RUBY_PARSE_ERROR
Definition errors.h:24
@ INVALID_COMMENT_CLOSING_TAG_ERROR
Definition errors.h:31
@ TAG_NAMES_MISMATCH_ERROR
Definition errors.h:21
@ CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR
Definition errors.h:30
@ UNCLOSED_ELEMENT_ERROR
Definition errors.h:23
@ ERB_CONTROL_FLOW_SCOPE_ERROR
Definition errors.h:25
@ UNCLOSED_QUOTE_ERROR
Definition errors.h:35
@ UNCLOSED_CLOSE_TAG_ERROR
Definition errors.h:34
@ MISSING_OPENING_TAG_ERROR
Definition errors.h:19
@ ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR
Definition errors.h:27
void error_free(ERROR_T *error, hb_allocator_T *allocator)
Definition errors.c:1047
void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:420
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:594
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:227
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)
Definition errors.c:373
void append_missingerb_end_tag_error(hb_string_T keyword, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:404
size_t error_sizeof(void)
Definition errors.c:21
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:469
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)
Definition errors.c:72
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:693
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)
Definition errors.c:111
hb_string_T error_human_type(ERROR_T *error)
Definition errors.c:853
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:115
NESTEDERB_TAG_ERROR_T * nestederb_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:786
void error_init(ERROR_T *error, error_type_T type, position_T start, position_T end)
Definition errors.c:25
void append_unclosederb_tag_error(token_T *opening_tag, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:755
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:76
void append_strayerb_closing_tag_error(position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:782
UNCLOSEDERB_TAG_ERROR_T * unclosederb_tag_error_init(token_T *opening_tag, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:726
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:1079
hb_string_T error_type_to_string(ERROR_T *error)
Definition errors.c:823
MISSINGERB_END_TAG_ERROR_T * missingerb_end_tag_error_init(hb_string_T keyword, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:377
void append_missing_opening_tag_error(token_T *closing_tag, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:144
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)
Definition errors.c:722
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)
Definition errors.c:465
void append_missing_closing_tag_error(token_T *opening_tag, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:182
void append_unclosed_close_tag_error(token_T *tag_name, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:656
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:520
void append_unclosed_quote_error(token_T *opening_quote, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:689
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:440
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:308
void append_erb_case_with_conditions_error(position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:436
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:553
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:275
void append_nestederb_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)
Definition errors.c:819
ERROR_T base
Definition errors.h:124
size_t open_column
Definition errors.h:128
hb_string_T close_condition
Definition errors.h:129
size_t open_line
Definition errors.h:127
size_t close_line
Definition errors.h:130
size_t close_column
Definition errors.h:131
hb_string_T open_condition
Definition errors.h:126
hb_string_T tag_name
Definition errors.h:125
size_t column
Definition errors.h:120
ERROR_T base
Definition errors.h:118
size_t line
Definition errors.h:119
Definition errors.h:112
ERROR_T base
Definition errors.h:113
Definition errors.h:97
hb_string_T keyword
Definition errors.h:99
ERROR_T base
Definition errors.h:98
Definition errors.h:107
ERROR_T base
Definition errors.h:108
Definition errors.h:42
error_type_T type
Definition errors.h:43
location_T location
Definition errors.h:44
hb_string_T message
Definition errors.h:45
token_T * closing_tag
Definition errors.h:136
ERROR_T base
Definition errors.h:135
Definition location.h:10
Definition errors.h:102
ERROR_T base
Definition errors.h:103
hb_string_T keyword
Definition errors.h:104
Definition errors.h:160
hb_string_T attribute_name
Definition errors.h:162
ERROR_T base
Definition errors.h:161
Definition errors.h:67
ERROR_T base
Definition errors.h:68
token_T * opening_tag
Definition errors.h:69
Definition errors.h:62
token_T * closing_tag
Definition errors.h:64
ERROR_T base
Definition errors.h:63
Definition errors.h:175
size_t nested_tag_column
Definition errors.h:179
size_t nested_tag_line
Definition errors.h:178
token_T * opening_tag
Definition errors.h:177
ERROR_T base
Definition errors.h:176
Definition errors.h:139
ERROR_T base
Definition errors.h:140
position_T insertion_point
Definition errors.h:142
token_T * opening_tag
Definition errors.h:141
Definition position.h:8
Definition errors.h:90
ERROR_T base
Definition errors.h:91
hb_string_T level
Definition errors.h:94
hb_string_T error_message
Definition errors.h:92
hb_string_T diagnostic_id
Definition errors.h:93
Definition errors.h:170
ERROR_T base
Definition errors.h:171
Definition errors.h:72
token_T * opening_tag
Definition errors.h:74
token_T * closing_tag
Definition errors.h:75
ERROR_T base
Definition errors.h:73
Definition token_struct.h:58
Definition errors.h:165
token_T * opening_tag
Definition errors.h:167
ERROR_T base
Definition errors.h:166
Definition errors.h:150
token_T * tag_name
Definition errors.h:152
ERROR_T base
Definition errors.h:151
Definition errors.h:85
ERROR_T base
Definition errors.h:86
token_T * opening_tag
Definition errors.h:87
Definition errors.h:145
ERROR_T base
Definition errors.h:146
token_T * tag_name
Definition errors.h:147
Definition errors.h:155
token_T * opening_quote
Definition errors.h:157
ERROR_T base
Definition errors.h:156
Definition errors.h:49
hb_string_T expected
Definition errors.h:52
ERROR_T base
Definition errors.h:50
hb_string_T found
Definition errors.h:53
hb_string_T description
Definition errors.h:51
Definition errors.h:56
token_T * found
Definition errors.h:59
ERROR_T base
Definition errors.h:57
token_type_T expected_type
Definition errors.h:58
Definition errors.h:78
ERROR_T base
Definition errors.h:79
token_T * tag_name
Definition errors.h:80
hb_string_T expected
Definition errors.h:81
hb_string_T found
Definition errors.h:82
token_type_T
Definition token_struct.h:10