Ruby 4.1.0dev (2026-05-15 revision 4d87d43b01dbb312eb1ff5fbbc6c9f33218d91a2)
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
19
33
44
56
64
72
82
92
93#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:822
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:830
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:806
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:814
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:798
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
#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:554