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_arena.h"
13#include "util/hb_buffer.h"
14
38
44
45
46typedef struct {
48 const char* description;
49 const char* expected;
50 const char* found;
52
58
63
68
74
75typedef struct {
78 const char* expected;
79 const char* found;
81
86
87typedef struct {
89 const char* error_message;
90 const char* diagnostic_id;
91 const char* level;
93
94typedef struct {
96 const char* keyword;
98
99typedef struct {
101 const char* keyword;
103
104typedef struct {
106 /* no additional fields */
108
109typedef struct {
111 /* no additional fields */
113
119
130
135
141
146
151
156
161
168
169UNEXPECTED_ERROR_T* unexpected_error_init(const char* description, const char* expected, const char* found, position_T start, position_T end, hb_arena_T* arena);
170void append_unexpected_error(const char* description, const char* expected, const char* found, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
171UNEXPECTED_TOKEN_ERROR_T* unexpected_token_error_init(token_type_T expected_type, token_T* found, position_T start, position_T end, hb_arena_T* arena);
172void append_unexpected_token_error(token_type_T expected_type, token_T* found, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
174void append_missing_opening_tag_error(token_T* closing_tag, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
176void append_missing_closing_tag_error(token_T* opening_tag, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
177TAG_NAMES_MISMATCH_ERROR_T* tag_names_mismatch_error_init(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_arena_T* arena);
178void append_tag_names_mismatch_error(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
179VOID_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_arena_T* arena);
180void 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, hb_arena_T* arena);
181UNCLOSED_ELEMENT_ERROR_T* unclosed_element_error_init(token_T* opening_tag, position_T start, position_T end, hb_arena_T* arena);
182void append_unclosed_element_error(token_T* opening_tag, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
183RUBY_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_arena_T* arena);
184void 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, hb_arena_T* arena);
185ERB_CONTROL_FLOW_SCOPE_ERROR_T* erb_control_flow_scope_error_init(const char* keyword, position_T start, position_T end, hb_arena_T* arena);
186void append_erb_control_flow_scope_error(const char* keyword, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
187MISSINGERB_END_TAG_ERROR_T* missingerb_end_tag_error_init(const char* keyword, position_T start, position_T end, hb_arena_T* arena);
188void append_missingerb_end_tag_error(const char* keyword, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
190void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
192void append_erb_case_with_conditions_error(position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
194void append_conditional_element_multiple_tags_error(size_t line, size_t column, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
195CONDITIONAL_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_arena_T* arena);
196void 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, hb_arena_T* arena);
198void append_invalid_comment_closing_tag_error(token_T* closing_tag, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
199OMITTED_CLOSING_TAG_ERROR_T* omitted_closing_tag_error_init(token_T* opening_tag, position_T insertion_point, position_T start, position_T end, hb_arena_T* arena);
200void append_omitted_closing_tag_error(token_T* opening_tag, position_T insertion_point, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
202void append_unclosed_open_tag_error(token_T* tag_name, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
203UNCLOSED_QUOTE_ERROR_T* unclosed_quote_error_init(token_T* opening_quote, position_T start, position_T end, hb_arena_T* arena);
204void append_unclosed_quote_error(token_T* opening_quote, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
205MISSING_ATTRIBUTE_VALUE_ERROR_T* missing_attribute_value_error_init(const char* attribute_name, position_T start, position_T end, hb_arena_T* arena);
206void append_missing_attribute_value_error(const char* attribute_name, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
207UNCLOSEDERB_TAG_ERROR_T* unclosederb_tag_error_init(token_T* opening_tag, position_T start, position_T end, hb_arena_T* arena);
208void append_unclosederb_tag_error(token_T* opening_tag, position_T start, position_T end, hb_array_T* errors, hb_arena_T* arena);
209NESTEDERB_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_arena_T* arena);
210void 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, hb_arena_T* arena);
211
212void error_init(ERROR_T* error, error_type_T type, position_T start, position_T end);
213
214size_t error_sizeof(void);
216
217char* error_message(ERROR_T* error);
218
219const char* error_type_to_string(ERROR_T* error);
220const char* error_human_type(ERROR_T* error);
221
222void error_free(ERROR_T* error);
223
224void error_pretty_print(ERROR_T* error, size_t indent, size_t relative_indent, hb_buffer_T* buffer);
225
227 const char* name, hb_array_T* array, size_t indent, size_t relative_indent, bool last_property,
228 hb_buffer_T* buffer
229);
230
231#endif
ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR_T * erb_multiple_blocks_in_tag_error_init(position_T start, position_T end, hb_arena_T *arena)
Definition errors.c:537
error_type_T error_type(ERROR_T *error)
void append_missing_closing_tag_error(token_T *opening_tag, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:233
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_arena_T *arena)
Definition errors.c:237
void append_unexpected_error(const char *description, const char *expected, const char *found, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:84
void error_free(ERROR_T *error)
Definition errors.c:1221
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_arena_T *arena)
Definition errors.c:963
void append_unclosed_quote_error(token_T *opening_quote, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:867
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_arena_T *arena)
Definition errors.c:615
void append_omitted_closing_tag_error(token_T *opening_tag, position_T insertion_point, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:775
ERB_CASE_WITH_CONDITIONS_ERROR_T * erb_case_with_conditions_error_init(position_T start, position_T end, hb_arena_T *arena)
Definition errors.c:555
void append_missingerb_end_tag_error(const char *keyword, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:533
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_arena_T *arena)
Definition errors.c:291
void append_invalid_comment_closing_tag_error(token_T *closing_tag, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:721
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, hb_arena_T *arena)
Definition errors.c:348
void append_unexpected_token_error(token_type_T expected_type, token_T *found, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:136
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, hb_arena_T *arena)
Definition errors.c:445
void append_unclosed_open_tag_error(token_T *tag_name, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:821
MISSING_ATTRIBUTE_VALUE_ERROR_T * missing_attribute_value_error_init(const char *attribute_name, position_T start, position_T end, hb_arena_T *arena)
Definition errors.c:871
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, hb_arena_T *arena)
Definition errors.c:1009
UNCLOSEDERB_TAG_ERROR_T * unclosederb_tag_error_init(token_T *opening_tag, position_T start, position_T end, hb_arena_T *arena)
Definition errors.c:917
MISSINGERB_END_TAG_ERROR_T * missingerb_end_tag_error_init(const char *keyword, position_T start, position_T end, hb_arena_T *arena)
Definition errors.c:493
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:1603
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_arena_T *arena)
Definition errors.c:573
void append_tag_names_mismatch_error(token_T *opening_tag, token_T *closing_tag, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:287
UNCLOSED_QUOTE_ERROR_T * unclosed_quote_error_init(token_T *opening_quote, position_T start, position_T end, hb_arena_T *arena)
Definition errors.c:825
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:36
@ 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:35
@ MISSING_ATTRIBUTE_VALUE_ERROR
Definition errors.h:34
@ 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:33
@ MISSING_OPENING_TAG_ERROR
Definition errors.h:18
@ ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR
Definition errors.h:26
void append_missing_attribute_value_error(const char *attribute_name, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:913
const char * error_human_type(ERROR_T *error)
Definition errors.c:1041
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_arena_T *arena)
Definition errors.c:398
size_t error_sizeof(void)
Definition errors.c:20
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, hb_arena_T *arena)
Definition errors.c:675
void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:551
ERB_CONTROL_FLOW_SCOPE_ERROR_T * erb_control_flow_scope_error_init(const char *keyword, position_T start, position_T end, hb_arena_T *arena)
Definition errors.c:449
void error_init(ERROR_T *error, error_type_T type, position_T start, position_T end)
Definition errors.c:24
INVALID_COMMENT_CLOSING_TAG_ERROR_T * invalid_comment_closing_tag_error_init(token_T *closing_tag, position_T start, position_T end, hb_arena_T *arena)
Definition errors.c:679
void append_missing_opening_tag_error(token_T *closing_tag, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:182
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:1249
UNCLOSED_OPEN_TAG_ERROR_T * unclosed_open_tag_error_init(token_T *tag_name, position_T start, position_T end, hb_arena_T *arena)
Definition errors.c:779
const char * error_type_to_string(ERROR_T *error)
Definition errors.c:1013
MISSING_OPENING_TAG_ERROR_T * missing_opening_tag_error_init(token_T *closing_tag, position_T start, position_T end, hb_arena_T *arena)
Definition errors.c:140
void append_unclosed_element_error(token_T *opening_tag, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:394
void append_erb_case_with_conditions_error(position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:569
void append_conditional_element_multiple_tags_error(size_t line, size_t column, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:611
UNEXPECTED_TOKEN_ERROR_T * unexpected_token_error_init(token_type_T expected_type, token_T *found, position_T start, position_T end, hb_arena_T *arena)
Definition errors.c:88
MISSING_CLOSING_TAG_ERROR_T * missing_closing_tag_error_init(token_T *opening_tag, position_T start, position_T end, hb_arena_T *arena)
Definition errors.c:186
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_arena_T *arena)
Definition errors.c:725
void append_unclosederb_tag_error(token_T *opening_tag, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:959
char * error_message(ERROR_T *error)
UNEXPECTED_ERROR_T * unexpected_error_init(const char *description, const char *expected, const char *found, position_T start, position_T end, hb_arena_T *arena)
Definition errors.c:32
void append_erb_control_flow_scope_error(const char *keyword, position_T start, position_T end, hb_array_T *errors, hb_arena_T *arena)
Definition errors.c:489
UNCLOSED_ELEMENT_ERROR_T * unclosed_element_error_init(token_T *opening_tag, position_T start, position_T end, hb_arena_T *arena)
Definition errors.c:352
ERROR_T base
Definition errors.h:121
const char * open_condition
Definition errors.h:123
const char * tag_name
Definition errors.h:122
size_t open_column
Definition errors.h:125
const char * close_condition
Definition errors.h:126
size_t open_line
Definition errors.h:124
size_t close_line
Definition errors.h:127
size_t close_column
Definition errors.h:128
size_t column
Definition errors.h:117
ERROR_T base
Definition errors.h:115
size_t line
Definition errors.h:116
Definition errors.h:109
ERROR_T base
Definition errors.h:110
Definition errors.h:94
const char * keyword
Definition errors.h:96
ERROR_T base
Definition errors.h:95
Definition errors.h:104
ERROR_T base
Definition errors.h:105
Definition errors.h:39
error_type_T type
Definition errors.h:40
char * message
Definition errors.h:42
location_T location
Definition errors.h:41
token_T * closing_tag
Definition errors.h:133
ERROR_T base
Definition errors.h:132
Definition location.h:9
Definition errors.h:99
ERROR_T base
Definition errors.h:100
const char * keyword
Definition errors.h:101
Definition errors.h:152
const char * attribute_name
Definition errors.h:154
ERROR_T base
Definition errors.h:153
Definition errors.h:64
ERROR_T base
Definition errors.h:65
token_T * opening_tag
Definition errors.h:66
Definition errors.h:59
token_T * closing_tag
Definition errors.h:61
ERROR_T base
Definition errors.h:60
Definition errors.h:162
size_t nested_tag_column
Definition errors.h:166
size_t nested_tag_line
Definition errors.h:165
token_T * opening_tag
Definition errors.h:164
ERROR_T base
Definition errors.h:163
Definition errors.h:136
ERROR_T base
Definition errors.h:137
position_T insertion_point
Definition errors.h:139
token_T * opening_tag
Definition errors.h:138
Definition position.h:8
Definition errors.h:87
ERROR_T base
Definition errors.h:88
const char * error_message
Definition errors.h:89
const char * diagnostic_id
Definition errors.h:90
const char * level
Definition errors.h:91
Definition errors.h:69
token_T * opening_tag
Definition errors.h:71
token_T * closing_tag
Definition errors.h:72
ERROR_T base
Definition errors.h:70
Definition token_struct.h:54
Definition errors.h:157
token_T * opening_tag
Definition errors.h:159
ERROR_T base
Definition errors.h:158
Definition errors.h:82
ERROR_T base
Definition errors.h:83
token_T * opening_tag
Definition errors.h:84
Definition errors.h:142
ERROR_T base
Definition errors.h:143
token_T * tag_name
Definition errors.h:144
Definition errors.h:147
token_T * opening_quote
Definition errors.h:149
ERROR_T base
Definition errors.h:148
Definition errors.h:46
const char * description
Definition errors.h:48
const char * found
Definition errors.h:50
ERROR_T base
Definition errors.h:47
const char * expected
Definition errors.h:49
Definition errors.h:53
token_T * found
Definition errors.h:56
ERROR_T base
Definition errors.h:54
token_type_T expected_type
Definition errors.h:55
Definition errors.h:75
const char * found
Definition errors.h:79
ERROR_T base
Definition errors.h:76
token_T * tag_name
Definition errors.h:77
const char * expected
Definition errors.h:78
token_type_T
Definition token_struct.h:9