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
40
46
47
48typedef struct {
50 const char* description;
51 const char* expected;
52 const char* found;
54
60
65
70
76
77typedef struct {
80 const char* expected;
81 const char* found;
83
88
89typedef struct {
91 const char* error_message;
92 const char* diagnostic_id;
93 const char* level;
95
96typedef struct {
98 const char* keyword;
100
101typedef struct {
103 const char* keyword;
105
106typedef struct {
108 /* no additional fields */
110
111typedef struct {
113 /* no additional fields */
115
121
132
137
143
148
153
158
163
168
169typedef struct {
171 /* no additional fields */
173
180
181UNEXPECTED_ERROR_T* unexpected_error_init(const char* description, const char* expected, const char* found, position_T start, position_T end, hb_allocator_T* allocator);
182void append_unexpected_error(const char* description, const char* expected, const char* found, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
183UNEXPECTED_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);
184void 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);
185MISSING_OPENING_TAG_ERROR_T* missing_opening_tag_error_init(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator);
186void append_missing_opening_tag_error(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
187MISSING_CLOSING_TAG_ERROR_T* missing_closing_tag_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator);
188void append_missing_closing_tag_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
189TAG_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);
190void 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);
191VOID_ELEMENT_CLOSING_TAG_ERROR_T* void_element_closing_tag_error_init(token_T* tag_name, const char* expected, const char* found, position_T start, position_T end, hb_allocator_T* allocator);
192void append_void_element_closing_tag_error(token_T* tag_name, const char* expected, const char* found, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
193UNCLOSED_ELEMENT_ERROR_T* unclosed_element_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator);
194void append_unclosed_element_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
195RUBY_PARSE_ERROR_T* ruby_parse_error_init(const char* error_message, const char* diagnostic_id, const char* level, position_T start, position_T end, hb_allocator_T* allocator);
196void append_ruby_parse_error(const char* error_message, const char* diagnostic_id, const char* level, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
197ERB_CONTROL_FLOW_SCOPE_ERROR_T* erb_control_flow_scope_error_init(const char* keyword, position_T start, position_T end, hb_allocator_T* allocator);
198void append_erb_control_flow_scope_error(const char* keyword, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
199MISSINGERB_END_TAG_ERROR_T* missingerb_end_tag_error_init(const char* keyword, position_T start, position_T end, hb_allocator_T* allocator);
200void append_missingerb_end_tag_error(const char* keyword, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
202void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
204void append_erb_case_with_conditions_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
205CONDITIONAL_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);
206void 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);
207CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR_T* conditional_element_condition_mismatch_error_init(const char* tag_name, const char* open_condition, size_t open_line, size_t open_column, const char* close_condition, size_t close_line, size_t close_column, position_T start, position_T end, hb_allocator_T* allocator);
208void append_conditional_element_condition_mismatch_error(const char* tag_name, const char* open_condition, size_t open_line, size_t open_column, const char* close_condition, size_t close_line, size_t close_column, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
210void append_invalid_comment_closing_tag_error(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
211OMITTED_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);
212void 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);
213UNCLOSED_OPEN_TAG_ERROR_T* unclosed_open_tag_error_init(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator);
214void append_unclosed_open_tag_error(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
215UNCLOSED_CLOSE_TAG_ERROR_T* unclosed_close_tag_error_init(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator);
216void append_unclosed_close_tag_error(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
217UNCLOSED_QUOTE_ERROR_T* unclosed_quote_error_init(token_T* opening_quote, position_T start, position_T end, hb_allocator_T* allocator);
218void append_unclosed_quote_error(token_T* opening_quote, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
219MISSING_ATTRIBUTE_VALUE_ERROR_T* missing_attribute_value_error_init(const char* attribute_name, position_T start, position_T end, hb_allocator_T* allocator);
220void append_missing_attribute_value_error(const char* attribute_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
221UNCLOSEDERB_TAG_ERROR_T* unclosederb_tag_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator);
222void append_unclosederb_tag_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
224void append_strayerb_closing_tag_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors);
225NESTEDERB_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);
226void 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);
227
228void error_init(ERROR_T* error, error_type_T type, position_T start, position_T end);
229
230size_t error_sizeof(void);
232
233char* error_message(ERROR_T* error);
234
235const char* error_type_to_string(ERROR_T* error);
236const char* error_human_type(ERROR_T* error);
237
238void error_free(ERROR_T* error, hb_allocator_T* allocator);
239
240#ifndef HERB_EXCLUDE_PRETTYPRINT
241 void error_pretty_print(ERROR_T* error, size_t indent, size_t relative_indent, hb_buffer_T* buffer);
242
244 const char* name, hb_array_T* array, size_t indent, size_t relative_indent, bool last_property,
245 hb_buffer_T* buffer
246 );
247#endif
248
249#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:589
VOID_ELEMENT_CLOSING_TAG_ERROR_T * void_element_closing_tag_error_init(token_T *tag_name, const char *expected, const char *found, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:226
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:548
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:622
void append_conditional_element_condition_mismatch_error(const char *tag_name, const char *open_condition, size_t open_line, size_t open_column, const char *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:515
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:185
UNEXPECTED_ERROR_T * unexpected_error_init(const char *description, const char *expected, const char *found, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:32
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:303
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:222
void append_erb_control_flow_scope_error(const char *keyword, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:372
MISSING_ATTRIBUTE_VALUE_ERROR_T * missing_attribute_value_error_init(const char *attribute_name, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:692
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:659
CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR_T * conditional_element_condition_mismatch_error_init(const char *tag_name, const char *open_condition, size_t open_line, size_t open_column, const char *close_condition, size_t close_line, size_t close_column, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:468
STRAYERB_CLOSING_TAG_ERROR_T * strayerb_closing_tag_error_init(position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:758
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:423
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:626
void append_ruby_parse_error(const char *error_message, const char *diagnostic_id, const char *level, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:341
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:147
void append_missingerb_end_tag_error(const char *keyword, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:403
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:407
ERB_CONTROL_FLOW_SCOPE_ERROR_T * erb_control_flow_scope_error_init(const char *keyword, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:345
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:1459
error_type_T
Definition errors.h:15
@ CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR
Definition errors.h:28
@ MISSINGERB_END_TAG_ERROR
Definition errors.h:25
@ NESTEDERB_TAG_ERROR
Definition errors.h:38
@ UNEXPECTED_ERROR
Definition errors.h:16
@ UNCLOSED_OPEN_TAG_ERROR
Definition errors.h:32
@ ERB_CASE_WITH_CONDITIONS_ERROR
Definition errors.h:27
@ UNEXPECTED_TOKEN_ERROR
Definition errors.h:17
@ VOID_ELEMENT_CLOSING_TAG_ERROR
Definition errors.h:21
@ MISSING_CLOSING_TAG_ERROR
Definition errors.h:19
@ UNCLOSEDERB_TAG_ERROR
Definition errors.h:36
@ MISSING_ATTRIBUTE_VALUE_ERROR
Definition errors.h:35
@ STRAYERB_CLOSING_TAG_ERROR
Definition errors.h:37
@ OMITTED_CLOSING_TAG_ERROR
Definition errors.h:31
@ RUBY_PARSE_ERROR
Definition errors.h:23
@ INVALID_COMMENT_CLOSING_TAG_ERROR
Definition errors.h:30
@ TAG_NAMES_MISMATCH_ERROR
Definition errors.h:20
@ CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR
Definition errors.h:29
@ UNCLOSED_ELEMENT_ERROR
Definition errors.h:22
@ ERB_CONTROL_FLOW_SCOPE_ERROR
Definition errors.h:24
@ UNCLOSED_QUOTE_ERROR
Definition errors.h:34
@ UNCLOSED_CLOSE_TAG_ERROR
Definition errors.h:33
@ MISSING_OPENING_TAG_ERROR
Definition errors.h:18
@ ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR
Definition errors.h:26
void error_free(ERROR_T *error, hb_allocator_T *allocator)
Definition errors.c:1046
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:419
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:593
void append_void_element_closing_tag_error(token_T *tag_name, const char *expected, const char *found, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:270
const char * error_human_type(ERROR_T *error)
Definition errors.c:852
void append_missing_attribute_value_error(const char *attribute_name, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:721
size_t error_sizeof(void)
Definition errors.c:20
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:110
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:114
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:785
void error_init(ERROR_T *error, error_type_T type, position_T start, position_T end)
Definition errors.c:24
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:754
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:75
void append_strayerb_closing_tag_error(position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:781
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:725
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:1078
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:143
const char * error_type_to_string(ERROR_T *error)
Definition errors.c:822
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:464
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:181
RUBY_PARSE_ERROR_T * ruby_parse_error_init(const char *error_message, const char *diagnostic_id, const char *level, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:307
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:655
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:519
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:688
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:439
MISSINGERB_END_TAG_ERROR_T * missingerb_end_tag_error_init(const char *keyword, position_T start, position_T end, hb_allocator_T *allocator)
Definition errors.c:376
char * error_message(ERROR_T *error)
void append_erb_case_with_conditions_error(position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:435
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:552
void append_unexpected_error(const char *description, const char *expected, const char *found, position_T start, position_T end, hb_allocator_T *allocator, hb_array_T *errors)
Definition errors.c:71
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:274
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:818
ERROR_T base
Definition errors.h:123
const char * open_condition
Definition errors.h:125
const char * tag_name
Definition errors.h:124
size_t open_column
Definition errors.h:127
const char * close_condition
Definition errors.h:128
size_t open_line
Definition errors.h:126
size_t close_line
Definition errors.h:129
size_t close_column
Definition errors.h:130
size_t column
Definition errors.h:119
ERROR_T base
Definition errors.h:117
size_t line
Definition errors.h:118
Definition errors.h:111
ERROR_T base
Definition errors.h:112
Definition errors.h:96
const char * keyword
Definition errors.h:98
ERROR_T base
Definition errors.h:97
Definition errors.h:106
ERROR_T base
Definition errors.h:107
Definition errors.h:41
error_type_T type
Definition errors.h:42
char * message
Definition errors.h:44
location_T location
Definition errors.h:43
token_T * closing_tag
Definition errors.h:135
ERROR_T base
Definition errors.h:134
Definition location.h:10
Definition errors.h:101
ERROR_T base
Definition errors.h:102
const char * keyword
Definition errors.h:103
Definition errors.h:159
const char * attribute_name
Definition errors.h:161
ERROR_T base
Definition errors.h:160
Definition errors.h:66
ERROR_T base
Definition errors.h:67
token_T * opening_tag
Definition errors.h:68
Definition errors.h:61
token_T * closing_tag
Definition errors.h:63
ERROR_T base
Definition errors.h:62
Definition errors.h:174
size_t nested_tag_column
Definition errors.h:178
size_t nested_tag_line
Definition errors.h:177
token_T * opening_tag
Definition errors.h:176
ERROR_T base
Definition errors.h:175
Definition errors.h:138
ERROR_T base
Definition errors.h:139
position_T insertion_point
Definition errors.h:141
token_T * opening_tag
Definition errors.h:140
Definition position.h:8
Definition errors.h:89
ERROR_T base
Definition errors.h:90
const char * error_message
Definition errors.h:91
const char * diagnostic_id
Definition errors.h:92
const char * level
Definition errors.h:93
Definition errors.h:169
ERROR_T base
Definition errors.h:170
Definition errors.h:71
token_T * opening_tag
Definition errors.h:73
token_T * closing_tag
Definition errors.h:74
ERROR_T base
Definition errors.h:72
Definition token_struct.h:57
Definition errors.h:164
token_T * opening_tag
Definition errors.h:166
ERROR_T base
Definition errors.h:165
Definition errors.h:149
token_T * tag_name
Definition errors.h:151
ERROR_T base
Definition errors.h:150
Definition errors.h:84
ERROR_T base
Definition errors.h:85
token_T * opening_tag
Definition errors.h:86
Definition errors.h:144
ERROR_T base
Definition errors.h:145
token_T * tag_name
Definition errors.h:146
Definition errors.h:154
token_T * opening_quote
Definition errors.h:156
ERROR_T base
Definition errors.h:155
Definition errors.h:48
const char * description
Definition errors.h:50
const char * found
Definition errors.h:52
ERROR_T base
Definition errors.h:49
const char * expected
Definition errors.h:51
Definition errors.h:55
token_T * found
Definition errors.h:58
ERROR_T base
Definition errors.h:56
token_type_T expected_type
Definition errors.h:57
Definition errors.h:77
const char * found
Definition errors.h:81
ERROR_T base
Definition errors.h:78
token_T * tag_name
Definition errors.h:79
const char * expected
Definition errors.h:80
token_type_T
Definition token_struct.h:9