|
Prism Ruby parser
|
A function for formatting the errors in a parser into a buffer. More...
#include "prism/compiler/exported.h"#include "prism/compiler/nodiscard.h"#include "prism/compiler/nonnull.h"#include "prism/buffer.h"#include "prism/diagnostic.h"#include "prism/parser.h"

Go to the source code of this file.
Enumerations | |
| enum | pm_errors_format_type_t { PM_ERRORS_FORMAT_PLAIN = 1 , PM_ERRORS_FORMAT_STYLE = 2 , PM_ERRORS_FORMAT_COLOR = 3 } |
| The type of formatting to use when formatting errors. More... | |
Functions | |
| PRISM_EXPORTED_FUNCTION pm_error_level_t | pm_errors_format (const pm_parser_t *parser, pm_buffer_t *buffer, pm_errors_format_type_t format_type) PRISM_NONNULL(1 |
| Format the errors in a parser into a buffer. | |
A function for formatting the errors in a parser into a buffer.
The type of formatting to use when formatting errors.
| PRISM_EXPORTED_FUNCTION pm_error_level_t pm_errors_format | ( | const pm_parser_t * | parser, |
| pm_buffer_t * | buffer, | ||
| pm_errors_format_type_t | format_type | ||
| ) |
Format the errors in a parser into a buffer.
After return, the buffer will contain the formatted errors and any relevant source snippets if available and possible.
| parser | The parser containing the errors to format. Note that the parser does not need to be fully initialized, but it will need to have start, end, start_line, encoding, line_offsets, filepath, and error_list initialized. |
| buffer | The buffer to format the errors into. |
| format_type | The type of formatting to use when formatting the errors. |