Ruby 4.1.0dev (2026-11-18 revision bcf3b03b44ae598e3adb59d359cf32202091a318)
diagnostic.h
Go to the documentation of this file.
1
6#ifndef PRISM_DIAGNOSTIC_H
7#define PRISM_DIAGNOSTIC_H
8
12
13#include "prism/ast.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
23
44
55
67
75
83
93
103
113
114#ifdef __cplusplus
115}
116#endif
117
118#endif
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.
Definition diagnostic.c:827
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.
Definition diagnostic.c:835
PRISM_EXPORTED_FUNCTION pm_location_t pm_diagnostic_location(const pm_diagnostic_t *diagnostic) PRISM_NONNULL(1)
Get the location of the given diagnostic.
Definition diagnostic.c:811
PRISM_EXPORTED_FUNCTION const pm_diagnostic_t * pm_diagnostic_next(const pm_diagnostic_t *diagnostic) PRISM_NONNULL(1)
Get the diagnostic that follows the given diagnostic among the errors or the warnings of the parser t...
Definition diagnostic.c:843
PRISM_EXPORTED_FUNCTION const char * pm_diagnostic_message(const pm_diagnostic_t *diagnostic) PRISM_NONNULL(1)
Get the message of the given diagnostic.
Definition diagnostic.c:819
PRISM_EXPORTED_FUNCTION const char * pm_diagnostic_type(const pm_diagnostic_t *diagnostic) PRISM_NONNULL(1)
Get the type of the given diagnostic.
Definition diagnostic.c:803
pm_warning_level_t
The levels of warnings generated during parsing.
Definition diagnostic.h:48
@ PM_WARNING_LEVEL_DEFAULT
For warnings which should be emitted if $VERBOSE != nil.
Definition diagnostic.h:50
@ PM_WARNING_LEVEL_VERBOSE
For warnings which should be emitted if $VERBOSE == true.
Definition diagnostic.h:53
pm_error_level_t
The levels of errors generated during parsing.
Definition diagnostic.h:27
@ PM_ERROR_LEVEL_ARGUMENT
For errors that should raise an argument error.
Definition diagnostic.h:32
@ PM_ERROR_LEVEL_LOAD
For errors that should raise a load error.
Definition diagnostic.h:35
@ PM_ERROR_LEVEL_STACK
For errors that should raise a system stack error.
Definition diagnostic.h:42
@ PM_ERROR_LEVEL_SYNTAX
For errors that should raise a syntax error.
Definition diagnostic.h:29
#define PRISM_EXPORTED_FUNCTION
By default, we compile with -fvisibility=hidden.
Definition exported.h:20
#define PRISM_NONNULL(...)
Mark the parameters of a function as non-null.
Definition nonnull.h:13
This struct represents a slice in the source code, defined by an offset and a length.
Definition ast.h:579