$darkmode
Herb C Reference
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 
14 typedef enum {
26 } error_type_T;
27 
28 typedef struct ERROR_STRUCT {
31  char* message;
33 
34 
35 typedef struct {
37  const char* description;
38  const char* expected;
39  const char* found;
41 
42 typedef struct {
47 
48 typedef struct {
52 
53 typedef struct {
57 
58 typedef struct {
63 
64 typedef struct {
69 
70 typedef struct {
73  const char* expected;
74  const char* found;
76 
77 typedef struct {
81 
82 typedef struct {
84  const char* error_message;
85  const char* diagnostic_id;
86  const char* level;
88 
89 typedef struct {
91  const char* keyword;
93 
94 typedef struct {
96  const char* keyword;
98 
99 UNEXPECTED_ERROR_T* unexpected_error_init(const char* description, const char* expected, const char* found, position_T start, position_T end);
100 void append_unexpected_error(const char* description, const char* expected, const char* found, position_T start, position_T end, hb_array_T* errors);
102 void append_unexpected_token_error(token_type_T expected_type, token_T* found, position_T start, position_T end, hb_array_T* errors);
104 void append_missing_opening_tag_error(token_T* closing_tag, position_T start, position_T end, hb_array_T* errors);
106 void append_missing_closing_tag_error(token_T* opening_tag, position_T start, position_T end, hb_array_T* errors);
108 void append_tag_names_mismatch_error(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_array_T* errors);
109 QUOTES_MISMATCH_ERROR_T* quotes_mismatch_error_init(token_T* opening_quote, token_T* closing_quote, position_T start, position_T end);
110 void append_quotes_mismatch_error(token_T* opening_quote, token_T* closing_quote, position_T start, position_T end, hb_array_T* errors);
111 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);
112 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);
114 void append_unclosed_element_error(token_T* opening_tag, position_T start, position_T end, hb_array_T* errors);
115 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);
116 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);
118 void append_erb_control_flow_scope_error(const char* keyword, position_T start, position_T end, hb_array_T* errors);
120 void append_missingerb_end_tag_error(const char* keyword, position_T start, position_T end, hb_array_T* errors);
121 
122 void error_init(ERROR_T* error, error_type_T type, position_T start, position_T end);
123 
124 size_t error_sizeof(void);
126 
127 char* error_message(ERROR_T* error);
128 
129 const char* error_type_to_string(ERROR_T* error);
130 const char* error_human_type(ERROR_T* error);
131 
132 void error_free(ERROR_T* error);
133 
134 void error_pretty_print(ERROR_T* error, size_t indent, size_t relative_indent, hb_buffer_T* buffer);
135 
137  const char* name, hb_array_T* array, size_t indent, size_t relative_indent, bool last_property,
138  hb_buffer_T* buffer
139 );
140 
141 #endif
error_type_T error_type(ERROR_T *error)
void append_quotes_mismatch_error(token_T *opening_quote, token_T *closing_quote, position_T start, position_T end, hb_array_T *errors)
Definition: errors.c:290
void error_free(ERROR_T *error)
Definition: errors.c:619
void append_missing_opening_tag_error(token_T *closing_tag, position_T start, position_T end, hb_array_T *errors)
Definition: errors.c:157
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
const char * error_human_type(ERROR_T *error)
Definition: errors.c:518
MISSING_CLOSING_TAG_ERROR_T * missing_closing_tag_error_init(token_T *opening_tag, position_T start, position_T end)
Definition: errors.c:161
ERB_CONTROL_FLOW_SCOPE_ERROR_T * erb_control_flow_scope_error_init(const char *keyword, position_T start, position_T end)
Definition: errors.c:428
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
QUOTES_MISMATCH_ERROR_T * quotes_mismatch_error_init(token_T *opening_quote, token_T *closing_quote, position_T start, position_T end)
Definition: errors.c:250
void append_missingerb_end_tag_error(const char *keyword, position_T start, position_T end, hb_array_T *errors)
Definition: errors.c:496
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:343
void append_missing_closing_tag_error(token_T *opening_tag, position_T start, position_T end, hb_array_T *errors)
Definition: errors.c:200
void append_unclosed_element_error(token_T *opening_tag, position_T start, position_T end, hb_array_T *errors)
Definition: errors.c:381
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:294
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:844
const char * error_type_to_string(ERROR_T *error)
Definition: errors.c:500
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
@ MISSINGERB_END_TAG_ERROR
Definition: errors.h:25
@ UNEXPECTED_ERROR
Definition: errors.h:15
@ UNEXPECTED_TOKEN_ERROR
Definition: errors.h:16
@ VOID_ELEMENT_CLOSING_TAG_ERROR
Definition: errors.h:21
@ MISSING_CLOSING_TAG_ERROR
Definition: errors.h:18
@ RUBY_PARSE_ERROR
Definition: errors.h:23
@ TAG_NAMES_MISMATCH_ERROR
Definition: errors.h:19
@ UNCLOSED_ELEMENT_ERROR
Definition: errors.h:22
@ ERB_CONTROL_FLOW_SCOPE_ERROR
Definition: errors.h:24
@ QUOTES_MISMATCH_ERROR
Definition: errors.h:20
@ MISSING_OPENING_TAG_ERROR
Definition: errors.h:17
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
size_t error_sizeof(void)
Definition: errors.c:19
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:385
void error_init(ERROR_T *error, error_type_T type, position_T start, position_T end)
Definition: errors.c:23
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:637
MISSINGERB_END_TAG_ERROR_T * missingerb_end_tag_error_init(const char *keyword, position_T start, position_T end)
Definition: errors.c:464
void append_erb_control_flow_scope_error(const char *keyword, position_T start, position_T end, hb_array_T *errors)
Definition: errors.c:460
MISSING_OPENING_TAG_ERROR_T * missing_opening_tag_error_init(token_T *closing_tag, position_T start, position_T end)
Definition: errors.c:123
UNCLOSED_ELEMENT_ERROR_T * unclosed_element_error_init(token_T *opening_tag, position_T start, position_T end)
Definition: errors.c:347
char * error_message(ERROR_T *error)
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:424
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
Definition: errors.h:89
const char * keyword
Definition: errors.h:91
ERROR_T base
Definition: errors.h:90
Definition: errors.h:28
error_type_T type
Definition: errors.h:29
char * message
Definition: errors.h:31
location_T location
Definition: errors.h:30
Definition: location.h:9
Definition: errors.h:94
ERROR_T base
Definition: errors.h:95
const char * keyword
Definition: errors.h:96
Definition: errors.h:53
ERROR_T base
Definition: errors.h:54
token_T * opening_tag
Definition: errors.h:55
Definition: errors.h:48
token_T * closing_tag
Definition: errors.h:50
ERROR_T base
Definition: errors.h:49
Definition: position.h:6
Definition: errors.h:64
token_T * closing_quote
Definition: errors.h:67
token_T * opening_quote
Definition: errors.h:66
ERROR_T base
Definition: errors.h:65
Definition: errors.h:82
ERROR_T base
Definition: errors.h:83
const char * error_message
Definition: errors.h:84
const char * diagnostic_id
Definition: errors.h:85
const char * level
Definition: errors.h:86
Definition: errors.h:58
token_T * opening_tag
Definition: errors.h:60
token_T * closing_tag
Definition: errors.h:61
ERROR_T base
Definition: errors.h:59
Definition: token_struct.h:51
Definition: errors.h:77
ERROR_T base
Definition: errors.h:78
token_T * opening_tag
Definition: errors.h:79
Definition: errors.h:35
const char * description
Definition: errors.h:37
const char * found
Definition: errors.h:39
ERROR_T base
Definition: errors.h:36
const char * expected
Definition: errors.h:38
Definition: errors.h:42
token_T * found
Definition: errors.h:45
ERROR_T base
Definition: errors.h:43
token_type_T expected_type
Definition: errors.h:44
Definition: errors.h:70
const char * found
Definition: errors.h:74
ERROR_T base
Definition: errors.h:71
token_T * tag_name
Definition: errors.h:72
const char * expected
Definition: errors.h:73
token_type_T
Definition: token_struct.h:7