Files
Kevin Newton 6bb22453e7 [ruby/prism] Better C++ hygiene
Make all public prism headers check for C++ so that consumers do
not have to wrap includes in extern "C".

https://github.com/ruby/prism/commit/a7071e9939
2026-10-20 03:12:57 +00:00

37 lines
899 B
C

/**
* @file stream.h
*
* Functions for parsing streams.
*/
#ifndef PRISM_STREAM_H
#define PRISM_STREAM_H
#include "prism/compiler/exported.h"
#include "prism/compiler/nonnull.h"
#include "prism/arena.h"
#include "prism/options.h"
#include "prism/parser.h"
#include "prism/source.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Parse a stream of Ruby source and return the tree.
*
* @param parser The out parameter to write the parser to.
* @param arena The arena to use for all AST-lifetime allocations.
* @param source The source to use, created via pm_source_stream_new.
* @param options The optional options to use when parsing.
* @returns The AST representing the source.
*/
PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse_stream(pm_parser_t **parser, pm_arena_t *arena, pm_source_t *source, const pm_options_t *options) PRISM_NONNULL(1, 2, 3);
#ifdef __cplusplus
}
#endif
#endif