Prism Ruby parser
Loading...
Searching...
No Matches
diagnostic.h
Go to the documentation of this file.
1
6#ifndef PRISM_DIAGNOSTIC_H
7#define PRISM_DIAGNOSTIC_H
8
9#include "prism/compiler/exported.h"
10#include "prism/compiler/nodiscard.h"
11#include "prism/compiler/nonnull.h"
12
13#include "prism/ast.h"
14
19
33
44
55PRISM_EXPORTED_FUNCTION const char * pm_diagnostic_type(const pm_diagnostic_t *diagnostic) PRISM_NONNULL(1);
56
63PRISM_EXPORTED_FUNCTION pm_location_t pm_diagnostic_location(const pm_diagnostic_t *diagnostic) PRISM_NONNULL(1);
64
71PRISM_EXPORTED_FUNCTION const char * pm_diagnostic_message(const pm_diagnostic_t *diagnostic) PRISM_NONNULL(1);
72
81PRISM_EXPORTED_FUNCTION pm_error_level_t pm_diagnostic_error_level(const pm_diagnostic_t *diagnostic) PRISM_NONNULL(1);
82
91PRISM_EXPORTED_FUNCTION pm_warning_level_t pm_diagnostic_warning_level(const pm_diagnostic_t *diagnostic) PRISM_NONNULL(1);
92
93#endif
The abstract syntax tree.
PRISM_EXPORTED_FUNCTION pm_error_level_t pm_diagnostic_error_level(const pm_diagnostic_t *diagnostic) PRISM_NONNULL(1)
Get the error level associated with the given diagnostic.
PRISM_EXPORTED_FUNCTION pm_warning_level_t pm_diagnostic_warning_level(const pm_diagnostic_t *diagnostic) PRISM_NONNULL(1)
Get the warning level associated with the given diagnostic.
PRISM_EXPORTED_FUNCTION pm_location_t pm_diagnostic_location(const pm_diagnostic_t *diagnostic) PRISM_NONNULL(1)
Get the location of the given diagnostic.
struct pm_diagnostic_t pm_diagnostic_t
An opaque pointer to a diagnostic generated during parsing.
Definition diagnostic.h:18
PRISM_EXPORTED_FUNCTION const char * pm_diagnostic_message(const pm_diagnostic_t *diagnostic) PRISM_NONNULL(1)
Get the message of the given diagnostic.
PRISM_EXPORTED_FUNCTION const char * pm_diagnostic_type(const pm_diagnostic_t *diagnostic) PRISM_NONNULL(1)
Get the type of the given diagnostic.
pm_warning_level_t
The levels of warnings generated during parsing.
Definition diagnostic.h:37
@ PM_WARNING_LEVEL_DEFAULT
For warnings which should be emitted if $VERBOSE != nil.
Definition diagnostic.h:39
@ PM_WARNING_LEVEL_VERBOSE
For warnings which should be emitted if $VERBOSE == true.
Definition diagnostic.h:42
pm_error_level_t
The levels of errors generated during parsing.
Definition diagnostic.h:23
@ PM_ERROR_LEVEL_ARGUMENT
For errors that should raise an argument error.
Definition diagnostic.h:28
@ PM_ERROR_LEVEL_LOAD
For errors that should raise a load error.
Definition diagnostic.h:31
@ PM_ERROR_LEVEL_SYNTAX
For errors that should raise a syntax error.
Definition diagnostic.h:25
This struct represents a slice in the source code, defined by an offset and a length.
Definition ast.h:559