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 "array.h"
8#include "buffer.h"
9#include "errors.h"
10#include "location.h"
11#include "position.h"
12#include "token.h"
13
25
31
32
33typedef struct {
35 const char* description;
36 const char* expected;
37 const char* found;
39
45
50
55
61
67
68typedef struct {
71 const char* expected;
72 const char* found;
74
79
80typedef struct {
82 const char* error_message;
83 const char* diagnostic_id;
84 const char* level;
86
87UNEXPECTED_ERROR_T* unexpected_error_init(const char* description, const char* expected, const char* found, position_T* start, position_T* end);
88void append_unexpected_error(const char* description, const char* expected, const char* found, position_T* start, position_T* end, array_T* errors);
90void append_unexpected_token_error(token_type_T expected_type, token_T* found, position_T* start, position_T* end, array_T* errors);
92void append_missing_opening_tag_error(token_T* closing_tag, position_T* start, position_T* end, array_T* errors);
94void append_missing_closing_tag_error(token_T* opening_tag, position_T* start, position_T* end, array_T* errors);
96void append_tag_names_mismatch_error(token_T* opening_tag, token_T* closing_tag, position_T* start, position_T* end, array_T* errors);
97QUOTES_MISMATCH_ERROR_T* quotes_mismatch_error_init(token_T* opening_quote, token_T* closing_quote, position_T* start, position_T* end);
98void append_quotes_mismatch_error(token_T* opening_quote, token_T* closing_quote, position_T* start, position_T* end, array_T* errors);
99VOID_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);
100void append_void_element_closing_tag_error(token_T* tag_name, const char* expected, const char* found, position_T* start, position_T* end, array_T* errors);
102void append_unclosed_element_error(token_T* opening_tag, position_T* start, position_T* end, array_T* errors);
103RUBY_PARSE_ERROR_T* ruby_parse_error_init(const char* error_message, const char* diagnostic_id, const char* level, position_T* start, position_T* end);
104void append_ruby_parse_error(const char* error_message, const char* diagnostic_id, const char* level, position_T* start, position_T* end, array_T* errors);
105
106void error_init(ERROR_T* error, error_type_T type, position_T* start, position_T* end);
107
108size_t error_sizeof(void);
110
111char* error_message(ERROR_T* error);
112
113const char* error_type_to_string(ERROR_T* error);
114const char* error_human_type(ERROR_T* error);
115
116void error_free(ERROR_T* error);
117
118void error_pretty_print(ERROR_T* error, size_t indent, size_t relative_indent, buffer_T* buffer);
119
121 const char* name, array_T* array, size_t indent, size_t relative_indent, bool last_property,
122 buffer_T* buffer
123);
124
125#endif
error_type_T error_type(ERROR_T *error)
void append_ruby_parse_error(const char *error_message, const char *diagnostic_id, const char *level, position_T *start, position_T *end, array_T *errors)
Definition errors.c:423
void error_free(ERROR_T *error)
Definition errors.c:531
UNEXPECTED_ERROR_T * unexpected_error_init(const char *description, const char *expected, const char *found, position_T *start, position_T *end)
Definition errors.c:30
MISSING_CLOSING_TAG_ERROR_T * missing_closing_tag_error_init(token_T *opening_tag, position_T *start, position_T *end)
Definition errors.c:160
void append_unclosed_element_error(token_T *opening_tag, position_T *start, position_T *end, array_T *errors)
Definition errors.c:380
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:249
void append_unexpected_error(const char *description, const char *expected, const char *found, position_T *start, position_T *end, array_T *errors)
Definition errors.c:74
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:203
void append_void_element_closing_tag_error(token_T *tag_name, const char *expected, const char *found, position_T *start, position_T *end, array_T *errors)
Definition errors.c:342
struct ERROR_STRUCT ERROR_T
error_type_T
Definition errors.h:14
@ 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
@ QUOTES_MISMATCH_ERROR
Definition errors.h:20
@ MISSING_OPENING_TAG_ERROR
Definition errors.h:17
const char * error_human_type(ERROR_T *error)
Definition errors.c:443
void append_unexpected_token_error(token_type_T expected_type, token_T *found, position_T *start, position_T *end, array_T *errors)
Definition errors.c:118
size_t error_sizeof(void)
Definition errors.c:19
void append_missing_closing_tag_error(token_T *opening_tag, position_T *start, position_T *end, array_T *errors)
Definition errors.c:199
void append_tag_names_mismatch_error(token_T *opening_tag, token_T *closing_tag, position_T *start, position_T *end, array_T *errors)
Definition errors.c:245
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:293
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:78
void error_pretty_print_array(const char *name, array_T *array, size_t indent, size_t relative_indent, bool last_property, buffer_T *buffer)
Definition errors.c:547
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:384
const char * error_type_to_string(ERROR_T *error)
Definition errors.c:427
void append_missing_opening_tag_error(token_T *closing_tag, position_T *start, position_T *end, array_T *errors)
Definition errors.c:156
UNCLOSED_ELEMENT_ERROR_T * unclosed_element_error_init(token_T *opening_tag, position_T *start, position_T *end)
Definition errors.c:346
void append_quotes_mismatch_error(token_T *opening_quote, token_T *closing_quote, position_T *start, position_T *end, array_T *errors)
Definition errors.c:289
void error_init(ERROR_T *error, error_type_T type, position_T *start, position_T *end)
Definition errors.c:23
char * error_message(ERROR_T *error)
void error_pretty_print(ERROR_T *error, size_t indent, size_t relative_indent, buffer_T *buffer)
Definition errors.c:726
MISSING_OPENING_TAG_ERROR_T * missing_opening_tag_error_init(token_T *closing_tag, position_T *start, position_T *end)
Definition errors.c:122
Definition array.h:6
Definition buffer.h:7
Definition errors.h:26
location_T * location
Definition errors.h:28
error_type_T type
Definition errors.h:27
char * message
Definition errors.h:29
Definition location.h:8
Definition errors.h:51
ERROR_T base
Definition errors.h:52
token_T * opening_tag
Definition errors.h:53
Definition errors.h:46
token_T * closing_tag
Definition errors.h:48
ERROR_T base
Definition errors.h:47
Definition position.h:6
Definition errors.h:62
token_T * closing_quote
Definition errors.h:65
token_T * opening_quote
Definition errors.h:64
ERROR_T base
Definition errors.h:63
Definition errors.h:80
ERROR_T base
Definition errors.h:81
const char * error_message
Definition errors.h:82
const char * diagnostic_id
Definition errors.h:83
const char * level
Definition errors.h:84
Definition errors.h:56
token_T * opening_tag
Definition errors.h:58
token_T * closing_tag
Definition errors.h:59
ERROR_T base
Definition errors.h:57
Definition token_struct.h:44
Definition errors.h:75
ERROR_T base
Definition errors.h:76
token_T * opening_tag
Definition errors.h:77
Definition errors.h:33
const char * description
Definition errors.h:35
const char * found
Definition errors.h:37
ERROR_T base
Definition errors.h:34
const char * expected
Definition errors.h:36
Definition errors.h:40
token_T * found
Definition errors.h:43
ERROR_T base
Definition errors.h:41
token_type_T expected_type
Definition errors.h:42
Definition errors.h:68
const char * found
Definition errors.h:72
ERROR_T base
Definition errors.h:69
token_T * tag_name
Definition errors.h:70
const char * expected
Definition errors.h:71
token_type_T
Definition token_struct.h:7