Herb C Reference
Loading...
Searching...
No Matches
errors.c File Reference
#include "include/array.h"
#include "include/errors.h"
#include "include/location.h"
#include "include/position.h"
#include "include/pretty_print.h"
#include "include/token.h"
#include "include/util.h"
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>

Macros

#define ERROR_MESSAGES_TRUNCATED_LENGTH   128
 

Functions

size_t error_sizeof (void)
 
void error_init (ERROR_T *error, const error_type_T type, position_T *start, position_T *end)
 
UNEXPECTED_ERROR_Tunexpected_error_init (const char *description, const char *expected, const char *found, position_T *start, position_T *end)
 
void append_unexpected_error (const char *description, const char *expected, const char *found, position_T *start, position_T *end, array_T *errors)
 
UNEXPECTED_TOKEN_ERROR_Tunexpected_token_error_init (token_type_T expected_type, token_T *found, position_T *start, position_T *end)
 
void append_unexpected_token_error (token_type_T expected_type, token_T *found, position_T *start, position_T *end, array_T *errors)
 
MISSING_OPENING_TAG_ERROR_Tmissing_opening_tag_error_init (token_T *closing_tag, position_T *start, position_T *end)
 
void append_missing_opening_tag_error (token_T *closing_tag, position_T *start, position_T *end, array_T *errors)
 
MISSING_CLOSING_TAG_ERROR_Tmissing_closing_tag_error_init (token_T *opening_tag, position_T *start, position_T *end)
 
void append_missing_closing_tag_error (token_T *opening_tag, position_T *start, position_T *end, array_T *errors)
 
TAG_NAMES_MISMATCH_ERROR_Ttag_names_mismatch_error_init (token_T *opening_tag, token_T *closing_tag, position_T *start, position_T *end)
 
void append_tag_names_mismatch_error (token_T *opening_tag, token_T *closing_tag, position_T *start, position_T *end, array_T *errors)
 
QUOTES_MISMATCH_ERROR_Tquotes_mismatch_error_init (token_T *opening_quote, token_T *closing_quote, position_T *start, position_T *end)
 
void append_quotes_mismatch_error (token_T *opening_quote, token_T *closing_quote, position_T *start, position_T *end, array_T *errors)
 
VOID_ELEMENT_CLOSING_TAG_ERROR_Tvoid_element_closing_tag_error_init (token_T *tag_name, const char *expected, const char *found, position_T *start, position_T *end)
 
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)
 
UNCLOSED_ELEMENT_ERROR_Tunclosed_element_error_init (token_T *opening_tag, position_T *start, position_T *end)
 
void append_unclosed_element_error (token_T *opening_tag, position_T *start, position_T *end, array_T *errors)
 
RUBY_PARSE_ERROR_Truby_parse_error_init (const char *error_message, const char *diagnostic_id, const char *level, position_T *start, position_T *end)
 
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)
 
const char * error_type_to_string (ERROR_T *error)
 
const char * error_human_type (ERROR_T *error)
 
void error_free_base_error (ERROR_T *error)
 
static void error_free_unexpected_error (UNEXPECTED_ERROR_T *unexpected_error)
 
static void error_free_unexpected_token_error (UNEXPECTED_TOKEN_ERROR_T *unexpected_token_error)
 
static void error_free_missing_opening_tag_error (MISSING_OPENING_TAG_ERROR_T *missing_opening_tag_error)
 
static void error_free_missing_closing_tag_error (MISSING_CLOSING_TAG_ERROR_T *missing_closing_tag_error)
 
static void error_free_tag_names_mismatch_error (TAG_NAMES_MISMATCH_ERROR_T *tag_names_mismatch_error)
 
static void error_free_quotes_mismatch_error (QUOTES_MISMATCH_ERROR_T *quotes_mismatch_error)
 
static void error_free_void_element_closing_tag_error (VOID_ELEMENT_CLOSING_TAG_ERROR_T *void_element_closing_tag_error)
 
static void error_free_unclosed_element_error (UNCLOSED_ELEMENT_ERROR_T *unclosed_element_error)
 
static void error_free_ruby_parse_error (RUBY_PARSE_ERROR_T *ruby_parse_error)
 
void error_free (ERROR_T *error)
 
void error_pretty_print_array (const char *name, array_T *array, const size_t indent, const size_t relative_indent, const bool last_property, buffer_T *buffer)
 
static void error_pretty_print_unexpected_error (UNEXPECTED_ERROR_T *error, const size_t indent, const size_t relative_indent, buffer_T *buffer)
 
static void error_pretty_print_unexpected_token_error (UNEXPECTED_TOKEN_ERROR_T *error, const size_t indent, const size_t relative_indent, buffer_T *buffer)
 
static void error_pretty_print_missing_opening_tag_error (MISSING_OPENING_TAG_ERROR_T *error, const size_t indent, const size_t relative_indent, buffer_T *buffer)
 
static void error_pretty_print_missing_closing_tag_error (MISSING_CLOSING_TAG_ERROR_T *error, const size_t indent, const size_t relative_indent, buffer_T *buffer)
 
static void error_pretty_print_tag_names_mismatch_error (TAG_NAMES_MISMATCH_ERROR_T *error, const size_t indent, const size_t relative_indent, buffer_T *buffer)
 
static void error_pretty_print_quotes_mismatch_error (QUOTES_MISMATCH_ERROR_T *error, const size_t indent, const size_t relative_indent, buffer_T *buffer)
 
static void error_pretty_print_void_element_closing_tag_error (VOID_ELEMENT_CLOSING_TAG_ERROR_T *error, const size_t indent, const size_t relative_indent, buffer_T *buffer)
 
static void error_pretty_print_unclosed_element_error (UNCLOSED_ELEMENT_ERROR_T *error, const size_t indent, const size_t relative_indent, buffer_T *buffer)
 
static void error_pretty_print_ruby_parse_error (RUBY_PARSE_ERROR_T *error, const size_t indent, const size_t relative_indent, buffer_T *buffer)
 
void error_pretty_print (ERROR_T *error, const size_t indent, const size_t relative_indent, buffer_T *buffer)
 

Macro Definition Documentation

◆ ERROR_MESSAGES_TRUNCATED_LENGTH

#define ERROR_MESSAGES_TRUNCATED_LENGTH   128

Function Documentation

◆ error_sizeof()

size_t error_sizeof ( void  )

◆ error_init()

void error_init ( ERROR_T error,
const error_type_T  type,
position_T start,
position_T end 
)

◆ unexpected_error_init()

UNEXPECTED_ERROR_T * unexpected_error_init ( const char *  description,
const char *  expected,
const char *  found,
position_T start,
position_T end 
)

◆ append_unexpected_error()

void append_unexpected_error ( const char *  description,
const char *  expected,
const char *  found,
position_T start,
position_T end,
array_T errors 
)

◆ unexpected_token_error_init()

UNEXPECTED_TOKEN_ERROR_T * unexpected_token_error_init ( token_type_T  expected_type,
token_T found,
position_T start,
position_T end 
)

◆ append_unexpected_token_error()

void append_unexpected_token_error ( token_type_T  expected_type,
token_T found,
position_T start,
position_T end,
array_T errors 
)

◆ missing_opening_tag_error_init()

MISSING_OPENING_TAG_ERROR_T * missing_opening_tag_error_init ( token_T closing_tag,
position_T start,
position_T end 
)

◆ append_missing_opening_tag_error()

void append_missing_opening_tag_error ( token_T closing_tag,
position_T start,
position_T end,
array_T errors 
)

◆ missing_closing_tag_error_init()

MISSING_CLOSING_TAG_ERROR_T * missing_closing_tag_error_init ( token_T opening_tag,
position_T start,
position_T end 
)

◆ append_missing_closing_tag_error()

void append_missing_closing_tag_error ( token_T opening_tag,
position_T start,
position_T end,
array_T errors 
)

◆ tag_names_mismatch_error_init()

TAG_NAMES_MISMATCH_ERROR_T * tag_names_mismatch_error_init ( token_T opening_tag,
token_T closing_tag,
position_T start,
position_T end 
)

◆ append_tag_names_mismatch_error()

void append_tag_names_mismatch_error ( token_T opening_tag,
token_T closing_tag,
position_T start,
position_T end,
array_T errors 
)

◆ quotes_mismatch_error_init()

QUOTES_MISMATCH_ERROR_T * quotes_mismatch_error_init ( token_T opening_quote,
token_T closing_quote,
position_T start,
position_T end 
)

◆ append_quotes_mismatch_error()

void append_quotes_mismatch_error ( token_T opening_quote,
token_T closing_quote,
position_T start,
position_T end,
array_T errors 
)

◆ void_element_closing_tag_error_init()

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 
)

◆ append_void_element_closing_tag_error()

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 
)

◆ unclosed_element_error_init()

UNCLOSED_ELEMENT_ERROR_T * unclosed_element_error_init ( token_T opening_tag,
position_T start,
position_T end 
)

◆ append_unclosed_element_error()

void append_unclosed_element_error ( token_T opening_tag,
position_T start,
position_T end,
array_T errors 
)

◆ ruby_parse_error_init()

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 
)

◆ append_ruby_parse_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 
)

◆ error_type_to_string()

const char * error_type_to_string ( ERROR_T error)

◆ error_human_type()

const char * error_human_type ( ERROR_T error)

◆ error_free_base_error()

void error_free_base_error ( ERROR_T error)

◆ error_free_unexpected_error()

static void error_free_unexpected_error ( UNEXPECTED_ERROR_T unexpected_error)
static

◆ error_free_unexpected_token_error()

static void error_free_unexpected_token_error ( UNEXPECTED_TOKEN_ERROR_T unexpected_token_error)
static

◆ error_free_missing_opening_tag_error()

static void error_free_missing_opening_tag_error ( MISSING_OPENING_TAG_ERROR_T missing_opening_tag_error)
static

◆ error_free_missing_closing_tag_error()

static void error_free_missing_closing_tag_error ( MISSING_CLOSING_TAG_ERROR_T missing_closing_tag_error)
static

◆ error_free_tag_names_mismatch_error()

static void error_free_tag_names_mismatch_error ( TAG_NAMES_MISMATCH_ERROR_T tag_names_mismatch_error)
static

◆ error_free_quotes_mismatch_error()

static void error_free_quotes_mismatch_error ( QUOTES_MISMATCH_ERROR_T quotes_mismatch_error)
static

◆ error_free_void_element_closing_tag_error()

static void error_free_void_element_closing_tag_error ( VOID_ELEMENT_CLOSING_TAG_ERROR_T void_element_closing_tag_error)
static

◆ error_free_unclosed_element_error()

static void error_free_unclosed_element_error ( UNCLOSED_ELEMENT_ERROR_T unclosed_element_error)
static

◆ error_free_ruby_parse_error()

static void error_free_ruby_parse_error ( RUBY_PARSE_ERROR_T ruby_parse_error)
static

◆ error_free()

void error_free ( ERROR_T error)

◆ error_pretty_print_array()

void error_pretty_print_array ( const char *  name,
array_T array,
const size_t  indent,
const size_t  relative_indent,
const bool  last_property,
buffer_T buffer 
)

◆ error_pretty_print_unexpected_error()

static void error_pretty_print_unexpected_error ( UNEXPECTED_ERROR_T error,
const size_t  indent,
const size_t  relative_indent,
buffer_T buffer 
)
static

◆ error_pretty_print_unexpected_token_error()

static void error_pretty_print_unexpected_token_error ( UNEXPECTED_TOKEN_ERROR_T error,
const size_t  indent,
const size_t  relative_indent,
buffer_T buffer 
)
static

◆ error_pretty_print_missing_opening_tag_error()

static void error_pretty_print_missing_opening_tag_error ( MISSING_OPENING_TAG_ERROR_T error,
const size_t  indent,
const size_t  relative_indent,
buffer_T buffer 
)
static

◆ error_pretty_print_missing_closing_tag_error()

static void error_pretty_print_missing_closing_tag_error ( MISSING_CLOSING_TAG_ERROR_T error,
const size_t  indent,
const size_t  relative_indent,
buffer_T buffer 
)
static

◆ error_pretty_print_tag_names_mismatch_error()

static void error_pretty_print_tag_names_mismatch_error ( TAG_NAMES_MISMATCH_ERROR_T error,
const size_t  indent,
const size_t  relative_indent,
buffer_T buffer 
)
static

◆ error_pretty_print_quotes_mismatch_error()

static void error_pretty_print_quotes_mismatch_error ( QUOTES_MISMATCH_ERROR_T error,
const size_t  indent,
const size_t  relative_indent,
buffer_T buffer 
)
static

◆ error_pretty_print_void_element_closing_tag_error()

static void error_pretty_print_void_element_closing_tag_error ( VOID_ELEMENT_CLOSING_TAG_ERROR_T error,
const size_t  indent,
const size_t  relative_indent,
buffer_T buffer 
)
static

◆ error_pretty_print_unclosed_element_error()

static void error_pretty_print_unclosed_element_error ( UNCLOSED_ELEMENT_ERROR_T error,
const size_t  indent,
const size_t  relative_indent,
buffer_T buffer 
)
static

◆ error_pretty_print_ruby_parse_error()

static void error_pretty_print_ruby_parse_error ( RUBY_PARSE_ERROR_T error,
const size_t  indent,
const size_t  relative_indent,
buffer_T buffer 
)
static

◆ error_pretty_print()

void error_pretty_print ( ERROR_T error,
const size_t  indent,
const size_t  relative_indent,
buffer_T buffer 
)