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
29
35
36
37typedef struct {
39 const char* description;
40 const char* expected;
41 const char* found;
43
49
54
59
65
71
72typedef struct {
75 const char* expected;
76 const char* found;
78
83
84typedef struct {
86 const char* error_message;
87 const char* diagnostic_id;
88 const char* level;
90
91typedef struct {
93 const char* keyword;
95
96typedef struct {
98 const char* keyword;
100
101typedef struct {
103 /* no additional fields */
105
106typedef struct {
108 /* no additional fields */
110
111UNEXPECTED_ERROR_T* unexpected_error_init(const char* description, const char* expected, const char* found, position_T start, position_T end);
112void append_unexpected_error(const char* description, const char* expected, const char* found, position_T start, position_T end, hb_array_T* errors);
114void append_unexpected_token_error(token_type_T expected_type, token_T* found, position_T start, position_T end, hb_array_T* errors);
116void append_missing_opening_tag_error(token_T* closing_tag, position_T start, position_T end, hb_array_T* errors);
118void append_missing_closing_tag_error(token_T* opening_tag, position_T start, position_T end, hb_array_T* errors);
120void append_tag_names_mismatch_error(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_array_T* errors);
122void append_quotes_mismatch_error(token_T* opening_quote, token_T* closing_quote, position_T start, position_T end, hb_array_T* errors);
123VOID_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);
124void 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);
126void append_unclosed_element_error(token_T* opening_tag, position_T start, position_T end, hb_array_T* errors);
127RUBY_PARSE_ERROR_T* ruby_parse_error_init(const char* error_message, const char* diagnostic_id, const char* level, position_T start, position_T end);
128void 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);
130void append_erb_control_flow_scope_error(const char* keyword, position_T start, position_T end, hb_array_T* errors);
132void append_missingerb_end_tag_error(const char* keyword, position_T start, position_T end, hb_array_T* errors);
134void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_array_T* errors);
136void append_erb_case_with_conditions_error(position_T start, position_T end, hb_array_T* errors);
137
138void error_init(ERROR_T* error, error_type_T type, position_T start, position_T end);
139
140size_t error_sizeof(void);
142
143char* error_message(ERROR_T* error);
144
145const char* error_type_to_string(ERROR_T* error);
146const char* error_human_type(ERROR_T* error);
147
148void error_free(ERROR_T* error);
149
150void error_pretty_print(ERROR_T* error, size_t indent, size_t relative_indent, hb_buffer_T* buffer);
151
153 const char* name, hb_array_T* array, size_t indent, size_t relative_indent, bool last_property,
154 hb_buffer_T* buffer
155);
156
157#endif
ERB_CASE_WITH_CONDITIONS_ERROR_T * erb_case_with_conditions_error_init(position_T start, position_T end)
Definition errors.c:514
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 append_erb_case_with_conditions_error(position_T start, position_T end, hb_array_T *errors)
Definition errors.c:524
void error_free(ERROR_T *error)
Definition errors.c:663
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
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
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:428
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_missingerb_end_tag_error(const char *keyword, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:496
void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_array_T *errors)
Definition errors.c:510
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
ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR_T * erb_multiple_blocks_in_tag_error_init(position_T start, position_T end)
Definition errors.c:500
UNCLOSED_ELEMENT_ERROR_T * unclosed_element_error_init(token_T *opening_tag, position_T start, position_T end)
Definition errors.c:347
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
void append_unclosed_element_error(token_T *opening_tag, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:381
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:916
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
@ ERB_CASE_WITH_CONDITIONS_ERROR
Definition errors.h:27
@ 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
@ ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR
Definition errors.h:26
MISSINGERB_END_TAG_ERROR_T * missingerb_end_tag_error_init(const char *keyword, position_T start, position_T end)
Definition errors.c:464
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
const char * error_human_type(ERROR_T *error)
Definition errors.c:548
size_t error_sizeof(void)
Definition errors.c:19
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 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:294
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:683
const char * error_type_to_string(ERROR_T *error)
Definition errors.c:528
void append_erb_control_flow_scope_error(const char *keyword, position_T start, position_T end, hb_array_T *errors)
Definition errors.c:460
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:424
char * error_message(ERROR_T *error)
Definition errors.h:106
ERROR_T base
Definition errors.h:107
Definition errors.h:91
const char * keyword
Definition errors.h:93
ERROR_T base
Definition errors.h:92
Definition errors.h:101
ERROR_T base
Definition errors.h:102
Definition errors.h:30
error_type_T type
Definition errors.h:31
char * message
Definition errors.h:33
location_T location
Definition errors.h:32
Definition location.h:9
Definition errors.h:96
ERROR_T base
Definition errors.h:97
const char * keyword
Definition errors.h:98
Definition errors.h:55
ERROR_T base
Definition errors.h:56
token_T * opening_tag
Definition errors.h:57
Definition errors.h:50
token_T * closing_tag
Definition errors.h:52
ERROR_T base
Definition errors.h:51
Definition position.h:8
Definition errors.h:66
token_T * closing_quote
Definition errors.h:69
token_T * opening_quote
Definition errors.h:68
ERROR_T base
Definition errors.h:67
Definition errors.h:84
ERROR_T base
Definition errors.h:85
const char * error_message
Definition errors.h:86
const char * diagnostic_id
Definition errors.h:87
const char * level
Definition errors.h:88
Definition errors.h:60
token_T * opening_tag
Definition errors.h:62
token_T * closing_tag
Definition errors.h:63
ERROR_T base
Definition errors.h:61
Definition token_struct.h:51
Definition errors.h:79
ERROR_T base
Definition errors.h:80
token_T * opening_tag
Definition errors.h:81
Definition errors.h:37
const char * description
Definition errors.h:39
const char * found
Definition errors.h:41
ERROR_T base
Definition errors.h:38
const char * expected
Definition errors.h:40
Definition errors.h:44
token_T * found
Definition errors.h:47
ERROR_T base
Definition errors.h:45
token_type_T expected_type
Definition errors.h:46
Definition errors.h:72
const char * found
Definition errors.h:76
ERROR_T base
Definition errors.h:73
token_T * tag_name
Definition errors.h:74
const char * expected
Definition errors.h:75
token_type_T
Definition token_struct.h:7