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

41 lines
836 B
C

/**
* @file json.h
*/
#ifndef PRISM_JSON_H
#define PRISM_JSON_H
#include "prism/excludes.h"
/* We optionally support dumping to JSON. For systems that don't want or need
* this functionality, it can be turned off with the PRISM_EXCLUDE_JSON define.
*/
#ifndef PRISM_EXCLUDE_JSON
#include "prism/compiler/exported.h"
#include "prism/compiler/nonnull.h"
#include "prism/ast.h"
#include "prism/buffer.h"
#include "prism/parser.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Dump JSON to the given buffer.
*
* @param buffer The buffer to serialize to.
* @param parser The parser that parsed the node.
* @param node The node to serialize.
*/
PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *node) PRISM_NONNULL(1, 2, 3);
#ifdef __cplusplus
}
#endif
#endif
#endif