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
37
43
44
45typedef struct {
47 const char* description;
48 const char* expected;
49 const char* found;
51
57
62
67
73
74typedef struct {
77 const char* expected;
78 const char* found;
80
85
86typedef struct {
88 const char* error_message;
89 const char* diagnostic_id;
90 const char* level;
92
93typedef struct {
95 const char* keyword;
97
98typedef struct {
100 const char* keyword;
102
103typedef struct {
105 /* no additional fields */
107
108typedef struct {
110 /* no additional fields */
112
118
129
134
140
145
150
155
160
167
168UNEXPECTED_ERROR_T* unexpected_error_init(const char* description, const char* expected, const char* found, position_T start, position_T end);
169void append_unexpected_error(const char* description, const char* expected, const char* found, position_T start, position_T end, hb_array_T* errors);
171void append_unexpected_token_error(token_type_T expected_type, token_T* found, position_T start, position_T end, hb_array_T* errors);
173void append_missing_opening_tag_error(token_T* closing_tag, position_T start, position_T end, hb_array_T* errors);
175void append_missing_closing_tag_error(token_T* opening_tag, position_T start, position_T end, hb_array_T* errors);
177void append_tag_names_mismatch_error(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_array_T* errors);
178VOID_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);
179void 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);
181void append_unclosed_element_error(token_T* opening_tag, position_T start, position_T end, hb_array_T* errors);
182RUBY_PARSE_ERROR_T* ruby_parse_error_init(const char* error_message, const char* diagnostic_id, const char* level, position_T start, position_T end);
183void 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);
185void append_erb_control_flow_scope_error(const char* keyword, position_T start, position_T end, hb_array_T* errors);
187void append_missingerb_end_tag_error(const char* keyword, position_T start, position_T end, hb_array_T* errors);
189void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_array_T* errors);
191void append_erb_case_with_conditions_error(position_T start, position_T end, hb_array_T* errors);
193void append_conditional_element_multiple_tags_error(size_t line, size_t column, position_T start, position_T end, hb_array_T* errors);
194CONDITIONAL_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);
195void 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);
197void append_invalid_comment_closing_tag_error(token_T* closing_tag, position_T start, position_T end, hb_array_T* errors);
199void append_omitted_closing_tag_error(token_T* opening_tag, position_T insertion_point, position_T start, position_T end, hb_array_T* errors);
201void append_unclosed_open_tag_error(token_T* tag_name, position_T start, position_T end, hb_array_T* errors);
203void append_unclosed_quote_error(token_T* opening_quote, position_T start, position_T end, hb_array_T* errors);
205void append_missing_attribute_value_error(const char* attribute_name, position_T start, position_T end, hb_array_T* errors);
207void append_unclosederb_tag_error(token_T* opening_tag, position_T start, position_T end, hb_array_T* errors);
208NESTEDERB_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);
209void 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);
210
211void error_init(ERROR_T* error, error_type_T type, position_T start, position_T end);
212
213size_t error_sizeof(void);
215
216char* error_message(ERROR_T* error);
217
218const char* error_type_to_string(ERROR_T* error);
219const char* error_human_type(ERROR_T* error);
220
221void error_free(ERROR_T* error);
222
223void error_pretty_print(ERROR_T* error, size_t indent, size_t relative_indent, hb_buffer_T* buffer);
224
226 const char* name, hb_array_T* array, size_t indent, size_t relative_indent, bool last_property,
227 hb_buffer_T* buffer
228);
229
230#endif
ERB_CASE_WITH_CONDITIONS_ERROR_T * erb_case_with_conditions_error_init(position_T start, position_T end)
Definition errors.c:470
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:480
void append_missing_attribute_value_error(const char *attribute_name, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:768
void error_free(ERROR_T *error)
Definition errors.c:1060
MISSING_OPENING_TAG_ERROR_T * missing_opening_tag_error_init(token_T *closing_tag, position_T start, position_T end)
Definition errors.c:123
void append_missing_opening_tag_error(token_T *closing_tag, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:157
UNCLOSEDERB_TAG_ERROR_T * unclosederb_tag_error_init(token_T *opening_tag, position_T start, position_T end)
Definition errors.c:772
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:246
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:570
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:384
MISSING_CLOSING_TAG_ERROR_T * missing_closing_tag_error_init(token_T *opening_tag, position_T start, position_T end)
Definition errors.c:161
void append_unclosed_quote_error(token_T *opening_quote, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:730
void append_missingerb_end_tag_error(const char *keyword, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:452
void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_array_T *errors)
Definition errors.c:466
void append_unclosed_open_tag_error(token_T *tag_name, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:692
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:299
ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR_T * erb_multiple_blocks_in_tag_error_init(position_T start, position_T end)
Definition errors.c:456
UNCLOSED_ELEMENT_ERROR_T * unclosed_element_error_init(token_T *opening_tag, position_T start, position_T end)
Definition errors.c:303
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:204
void append_missing_closing_tag_error(token_T *opening_tag, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:200
UNCLOSED_QUOTE_ERROR_T * unclosed_quote_error_init(token_T *opening_quote, position_T start, position_T end)
Definition errors.c:696
void append_unclosed_element_error(token_T *opening_tag, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:337
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:612
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:1442
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:75
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:35
@ 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:34
@ MISSING_ATTRIBUTE_VALUE_ERROR
Definition errors.h:33
@ 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: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:420
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:341
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:654
MISSING_ATTRIBUTE_VALUE_ERROR_T * missing_attribute_value_error_init(const char *attribute_name, position_T start, position_T end)
Definition errors.c:734
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:518
const char * error_human_type(ERROR_T *error)
Definition errors.c:880
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:574
void append_unclosederb_tag_error(token_T *opening_tag, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:806
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:484
void append_invalid_comment_closing_tag_error(token_T *closing_tag, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:608
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:250
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:848
UNCLOSED_OPEN_TAG_ERROR_T * unclosed_open_tag_error_init(token_T *tag_name, position_T start, position_T end)
Definition errors.c:658
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:1088
const char * error_type_to_string(ERROR_T *error)
Definition errors.c:852
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:514
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:810
void append_erb_control_flow_scope_error(const char *keyword, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:416
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:79
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:119
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:380
char * error_message(ERROR_T *error)
ERROR_T base
Definition errors.h:120
const char * open_condition
Definition errors.h:122
const char * tag_name
Definition errors.h:121
size_t open_column
Definition errors.h:124
const char * close_condition
Definition errors.h:125
size_t open_line
Definition errors.h:123
size_t close_line
Definition errors.h:126
size_t close_column
Definition errors.h:127
size_t column
Definition errors.h:116
ERROR_T base
Definition errors.h:114
size_t line
Definition errors.h:115
Definition errors.h:108
ERROR_T base
Definition errors.h:109
Definition errors.h:93
const char * keyword
Definition errors.h:95
ERROR_T base
Definition errors.h:94
Definition errors.h:103
ERROR_T base
Definition errors.h:104
Definition errors.h:38
error_type_T type
Definition errors.h:39
char * message
Definition errors.h:41
location_T location
Definition errors.h:40
token_T * closing_tag
Definition errors.h:132
ERROR_T base
Definition errors.h:131
Definition location.h:9
Definition errors.h:98
ERROR_T base
Definition errors.h:99
const char * keyword
Definition errors.h:100
Definition errors.h:151
const char * attribute_name
Definition errors.h:153
ERROR_T base
Definition errors.h:152
Definition errors.h:63
ERROR_T base
Definition errors.h:64
token_T * opening_tag
Definition errors.h:65
Definition errors.h:58
token_T * closing_tag
Definition errors.h:60
ERROR_T base
Definition errors.h:59
Definition errors.h:161
size_t nested_tag_column
Definition errors.h:165
size_t nested_tag_line
Definition errors.h:164
token_T * opening_tag
Definition errors.h:163
ERROR_T base
Definition errors.h:162
Definition errors.h:135
ERROR_T base
Definition errors.h:136
position_T insertion_point
Definition errors.h:138
token_T * opening_tag
Definition errors.h:137
Definition position.h:8
Definition errors.h:86
ERROR_T base
Definition errors.h:87
const char * error_message
Definition errors.h:88
const char * diagnostic_id
Definition errors.h:89
const char * level
Definition errors.h:90
Definition errors.h:68
token_T * opening_tag
Definition errors.h:70
token_T * closing_tag
Definition errors.h:71
ERROR_T base
Definition errors.h:69
Definition token_struct.h:52
Definition errors.h:156
token_T * opening_tag
Definition errors.h:158
ERROR_T base
Definition errors.h:157
Definition errors.h:81
ERROR_T base
Definition errors.h:82
token_T * opening_tag
Definition errors.h:83
Definition errors.h:141
ERROR_T base
Definition errors.h:142
token_T * tag_name
Definition errors.h:143
Definition errors.h:146
token_T * opening_quote
Definition errors.h:148
ERROR_T base
Definition errors.h:147
Definition errors.h:45
const char * description
Definition errors.h:47
const char * found
Definition errors.h:49
ERROR_T base
Definition errors.h:46
const char * expected
Definition errors.h:48
Definition errors.h:52
token_T * found
Definition errors.h:55
ERROR_T base
Definition errors.h:53
token_type_T expected_type
Definition errors.h:54
Definition errors.h:74
const char * found
Definition errors.h:78
ERROR_T base
Definition errors.h:75
token_T * tag_name
Definition errors.h:76
const char * expected
Definition errors.h:77
token_type_T
Definition token_struct.h:7