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_array.h"
12#include "util/hb_buffer.h"
13
39
45
46
47typedef struct {
49 const char* description;
50 const char* expected;
51 const char* found;
53
59
64
69
75
76typedef struct {
79 const char* expected;
80 const char* found;
82
87
88typedef struct {
90 const char* error_message;
91 const char* diagnostic_id;
92 const char* level;
94
95typedef struct {
97 const char* keyword;
99
100typedef struct {
102 const char* keyword;
104
105typedef struct {
107 /* no additional fields */
109
110typedef struct {
112 /* no additional fields */
114
120
131
136
142
147
152
157
162
167
168typedef struct {
170 /* no additional fields */
172
179
180UNEXPECTED_ERROR_T* unexpected_error_init(const char* description, const char* expected, const char* found, position_T start, position_T end);
181void append_unexpected_error(const char* description, const char* expected, const char* found, position_T start, position_T end, hb_array_T* errors);
183void append_unexpected_token_error(token_type_T expected_type, token_T* found, position_T start, position_T end, hb_array_T* errors);
185void append_missing_opening_tag_error(token_T* closing_tag, position_T start, position_T end, hb_array_T* errors);
187void append_missing_closing_tag_error(token_T* opening_tag, position_T start, position_T end, hb_array_T* errors);
189void append_tag_names_mismatch_error(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_array_T* errors);
190VOID_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);
191void append_void_element_closing_tag_error(token_T* tag_name, const char* expected, const char* found, position_T start, position_T end, hb_array_T* errors);
193void append_unclosed_element_error(token_T* opening_tag, position_T start, position_T end, hb_array_T* errors);
194RUBY_PARSE_ERROR_T* ruby_parse_error_init(const char* error_message, const char* diagnostic_id, const char* level, position_T start, position_T end);
195void append_ruby_parse_error(const char* error_message, const char* diagnostic_id, const char* level, position_T start, position_T end, hb_array_T* errors);
197void append_erb_control_flow_scope_error(const char* keyword, position_T start, position_T end, hb_array_T* errors);
199void append_missingerb_end_tag_error(const char* keyword, position_T start, position_T end, hb_array_T* errors);
201void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_array_T* errors);
203void append_erb_case_with_conditions_error(position_T start, position_T end, hb_array_T* errors);
205void append_conditional_element_multiple_tags_error(size_t line, size_t column, position_T start, position_T end, hb_array_T* errors);
206CONDITIONAL_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);
207void 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_array_T* errors);
209void append_invalid_comment_closing_tag_error(token_T* closing_tag, position_T start, position_T end, hb_array_T* errors);
211void append_omitted_closing_tag_error(token_T* opening_tag, position_T insertion_point, position_T start, position_T end, hb_array_T* errors);
213void append_unclosed_open_tag_error(token_T* tag_name, position_T start, position_T end, hb_array_T* errors);
215void append_unclosed_close_tag_error(token_T* tag_name, position_T start, position_T end, hb_array_T* errors);
217void append_unclosed_quote_error(token_T* opening_quote, position_T start, position_T end, hb_array_T* errors);
219void append_missing_attribute_value_error(const char* attribute_name, position_T start, position_T end, hb_array_T* errors);
221void append_unclosederb_tag_error(token_T* opening_tag, position_T start, position_T end, hb_array_T* errors);
223void append_strayerb_closing_tag_error(position_T start, position_T end, hb_array_T* errors);
224NESTEDERB_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);
225void 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_array_T* errors);
226
227void error_init(ERROR_T* error, error_type_T type, position_T start, position_T end);
228
229size_t error_sizeof(void);
231
232char* error_message(ERROR_T* error);
233
234const char* error_type_to_string(ERROR_T* error);
235const char* error_human_type(ERROR_T* error);
236
237void error_free(ERROR_T* error);
238
239#ifndef HERB_EXCLUDE_PRETTYPRINT
240 void error_pretty_print(ERROR_T* error, size_t indent, size_t relative_indent, hb_buffer_T* buffer);
241
243 const char* name, hb_array_T* array, size_t indent, size_t relative_indent, bool last_property,
244 hb_buffer_T* buffer
245 );
246#endif
247
248#endif
ERB_CASE_WITH_CONDITIONS_ERROR_T * erb_case_with_conditions_error_init(position_T start, position_T end)
Definition errors.c:492
error_type_T error_type(ERROR_T *error)
void append_erb_case_with_conditions_error(position_T start, position_T end, hb_array_T *errors)
Definition errors.c:504
void append_missing_attribute_value_error(const char *attribute_name, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:846
void error_free(ERROR_T *error)
Definition errors.c:1192
MISSING_OPENING_TAG_ERROR_T * missing_opening_tag_error_init(token_T *closing_tag, position_T start, position_T end)
Definition errors.c:127
void append_missing_opening_tag_error(token_T *closing_tag, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:163
UNCLOSEDERB_TAG_ERROR_T * unclosederb_tag_error_init(token_T *opening_tag, position_T start, position_T end)
Definition errors.c:850
STRAYERB_CLOSING_TAG_ERROR_T * strayerb_closing_tag_error_init(position_T start, position_T end)
Definition errors.c:890
void append_tag_names_mismatch_error(token_T *opening_tag, token_T *closing_tag, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:256
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_array_T *errors)
Definition errors.c:598
UNEXPECTED_ERROR_T * unexpected_error_init(const char *description, const char *expected, const char *found, position_T start, position_T end)
Definition errors.c:31
ERB_CONTROL_FLOW_SCOPE_ERROR_T * erb_control_flow_scope_error_init(const char *keyword, position_T start, position_T end)
Definition errors.c:400
UNCLOSED_CLOSE_TAG_ERROR_T * unclosed_close_tag_error_init(token_T *tag_name, position_T start, position_T end)
Definition errors.c:730
void append_strayerb_closing_tag_error(position_T start, position_T end, hb_array_T *errors)
Definition errors.c:920
MISSING_CLOSING_TAG_ERROR_T * missing_closing_tag_error_init(token_T *opening_tag, position_T start, position_T end)
Definition errors.c:167
void append_unclosed_quote_error(token_T *opening_quote, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:806
void append_missingerb_end_tag_error(const char *keyword, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:472
void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_array_T *errors)
Definition errors.c:488
void append_unclosed_open_tag_error(token_T *tag_name, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:726
void append_void_element_closing_tag_error(token_T *tag_name, const char *expected, const char *found, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:311
ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR_T * erb_multiple_blocks_in_tag_error_init(position_T start, position_T end)
Definition errors.c:476
UNCLOSED_ELEMENT_ERROR_T * unclosed_element_error_init(token_T *opening_tag, position_T start, position_T end)
Definition errors.c:315
TAG_NAMES_MISMATCH_ERROR_T * tag_names_mismatch_error_init(token_T *opening_tag, token_T *closing_tag, position_T start, position_T end)
Definition errors.c:212
void append_missing_closing_tag_error(token_T *opening_tag, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:208
UNCLOSED_QUOTE_ERROR_T * unclosed_quote_error_init(token_T *opening_quote, position_T start, position_T end)
Definition errors.c:770
void append_unclosed_element_error(token_T *opening_tag, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:351
OMITTED_CLOSING_TAG_ERROR_T * omitted_closing_tag_error_init(token_T *opening_tag, position_T insertion_point, position_T start, position_T end)
Definition errors.c:642
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:1605
void append_unexpected_error(const char *description, const char *expected, const char *found, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:77
error_type_T
Definition errors.h:14
@ CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR
Definition errors.h:27
@ MISSINGERB_END_TAG_ERROR
Definition errors.h:24
@ NESTEDERB_TAG_ERROR
Definition errors.h:37
@ UNEXPECTED_ERROR
Definition errors.h:15
@ UNCLOSED_OPEN_TAG_ERROR
Definition errors.h:31
@ ERB_CASE_WITH_CONDITIONS_ERROR
Definition errors.h:26
@ UNEXPECTED_TOKEN_ERROR
Definition errors.h:16
@ VOID_ELEMENT_CLOSING_TAG_ERROR
Definition errors.h:20
@ MISSING_CLOSING_TAG_ERROR
Definition errors.h:18
@ UNCLOSEDERB_TAG_ERROR
Definition errors.h:35
@ MISSING_ATTRIBUTE_VALUE_ERROR
Definition errors.h:34
@ STRAYERB_CLOSING_TAG_ERROR
Definition errors.h:36
@ OMITTED_CLOSING_TAG_ERROR
Definition errors.h:30
@ RUBY_PARSE_ERROR
Definition errors.h:22
@ INVALID_COMMENT_CLOSING_TAG_ERROR
Definition errors.h:29
@ TAG_NAMES_MISMATCH_ERROR
Definition errors.h:19
@ CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR
Definition errors.h:28
@ UNCLOSED_ELEMENT_ERROR
Definition errors.h:21
@ ERB_CONTROL_FLOW_SCOPE_ERROR
Definition errors.h:23
@ UNCLOSED_QUOTE_ERROR
Definition errors.h:33
@ UNCLOSED_CLOSE_TAG_ERROR
Definition errors.h:32
@ MISSING_OPENING_TAG_ERROR
Definition errors.h:17
@ ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR
Definition errors.h:25
MISSINGERB_END_TAG_ERROR_T * missingerb_end_tag_error_init(const char *keyword, position_T start, position_T end)
Definition errors.c:438
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)
Definition errors.c:355
void append_omitted_closing_tag_error(token_T *opening_tag, position_T insertion_point, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:686
MISSING_ATTRIBUTE_VALUE_ERROR_T * missing_attribute_value_error_init(const char *attribute_name, position_T start, position_T end)
Definition errors.c:810
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)
Definition errors.c:544
const char * error_human_type(ERROR_T *error)
Definition errors.c:998
INVALID_COMMENT_CLOSING_TAG_ERROR_T * invalid_comment_closing_tag_error_init(token_T *closing_tag, position_T start, position_T end)
Definition errors.c:602
void append_unclosederb_tag_error(token_T *opening_tag, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:886
size_t error_sizeof(void)
Definition errors.c:19
CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR_T * conditional_element_multiple_tags_error_init(size_t line, size_t column, position_T start, position_T end)
Definition errors.c:508
void append_unclosed_close_tag_error(token_T *tag_name, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:766
void append_invalid_comment_closing_tag_error(token_T *closing_tag, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:638
void error_init(ERROR_T *error, error_type_T type, position_T start, position_T end)
Definition errors.c:23
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)
Definition errors.c:260
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_array_T *errors)
Definition errors.c:964
UNCLOSED_OPEN_TAG_ERROR_T * unclosed_open_tag_error_init(token_T *tag_name, position_T start, position_T end)
Definition errors.c:690
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:1224
const char * error_type_to_string(ERROR_T *error)
Definition errors.c:968
void append_conditional_element_multiple_tags_error(size_t line, size_t column, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:540
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)
Definition errors.c:924
void append_erb_control_flow_scope_error(const char *keyword, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:434
UNEXPECTED_TOKEN_ERROR_T * unexpected_token_error_init(token_type_T expected_type, token_T *found, position_T start, position_T end)
Definition errors.c:81
void append_unexpected_token_error(token_type_T expected_type, token_T *found, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:123
void append_ruby_parse_error(const char *error_message, const char *diagnostic_id, const char *level, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:396
char * error_message(ERROR_T *error)
ERROR_T base
Definition errors.h:122
const char * open_condition
Definition errors.h:124
const char * tag_name
Definition errors.h:123
size_t open_column
Definition errors.h:126
const char * close_condition
Definition errors.h:127
size_t open_line
Definition errors.h:125
size_t close_line
Definition errors.h:128
size_t close_column
Definition errors.h:129
size_t column
Definition errors.h:118
ERROR_T base
Definition errors.h:116
size_t line
Definition errors.h:117
Definition errors.h:110
ERROR_T base
Definition errors.h:111
Definition errors.h:95
const char * keyword
Definition errors.h:97
ERROR_T base
Definition errors.h:96
Definition errors.h:105
ERROR_T base
Definition errors.h:106
Definition errors.h:40
error_type_T type
Definition errors.h:41
char * message
Definition errors.h:43
location_T location
Definition errors.h:42
token_T * closing_tag
Definition errors.h:134
ERROR_T base
Definition errors.h:133
Definition location.h:9
Definition errors.h:100
ERROR_T base
Definition errors.h:101
const char * keyword
Definition errors.h:102
Definition errors.h:158
const char * attribute_name
Definition errors.h:160
ERROR_T base
Definition errors.h:159
Definition errors.h:65
ERROR_T base
Definition errors.h:66
token_T * opening_tag
Definition errors.h:67
Definition errors.h:60
token_T * closing_tag
Definition errors.h:62
ERROR_T base
Definition errors.h:61
Definition errors.h:173
size_t nested_tag_column
Definition errors.h:177
size_t nested_tag_line
Definition errors.h:176
token_T * opening_tag
Definition errors.h:175
ERROR_T base
Definition errors.h:174
Definition errors.h:137
ERROR_T base
Definition errors.h:138
position_T insertion_point
Definition errors.h:140
token_T * opening_tag
Definition errors.h:139
Definition position.h:8
Definition errors.h:88
ERROR_T base
Definition errors.h:89
const char * error_message
Definition errors.h:90
const char * diagnostic_id
Definition errors.h:91
const char * level
Definition errors.h:92
Definition errors.h:168
ERROR_T base
Definition errors.h:169
Definition errors.h:70
token_T * opening_tag
Definition errors.h:72
token_T * closing_tag
Definition errors.h:73
ERROR_T base
Definition errors.h:71
Definition token_struct.h:55
Definition errors.h:163
token_T * opening_tag
Definition errors.h:165
ERROR_T base
Definition errors.h:164
Definition errors.h:148
token_T * tag_name
Definition errors.h:150
ERROR_T base
Definition errors.h:149
Definition errors.h:83
ERROR_T base
Definition errors.h:84
token_T * opening_tag
Definition errors.h:85
Definition errors.h:143
ERROR_T base
Definition errors.h:144
token_T * tag_name
Definition errors.h:145
Definition errors.h:153
token_T * opening_quote
Definition errors.h:155
ERROR_T base
Definition errors.h:154
Definition errors.h:47
const char * description
Definition errors.h:49
const char * found
Definition errors.h:51
ERROR_T base
Definition errors.h:48
const char * expected
Definition errors.h:50
Definition errors.h:54
token_T * found
Definition errors.h:57
ERROR_T base
Definition errors.h:55
token_type_T expected_type
Definition errors.h:56
Definition errors.h:76
const char * found
Definition errors.h:80
ERROR_T base
Definition errors.h:77
token_T * tag_name
Definition errors.h:78
const char * expected
Definition errors.h:79
token_type_T
Definition token_struct.h:7