Documentation
¶
Overview ¶
Package emit renders parse trees as JSON with byte-parity to libpg_query's hand-rolled C emitter (pg_query_outfuncs_json.c + pg_query_json_helper.c at the pinned 18.0.0).
The C emitter is generated from the same struct metadata the pinned pg_query.proto was generated from, so the proto descriptor carries everything the output format needs: message fields are declared in C struct order, each field's json_name is the C field name, and the field type selects the WRITE_*_FIELD macro. The walker below is therefore driven by protobuf reflection rather than by generated per-node code; byte-parity is enforced corpus-wide by the golden round-trip test in this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseResult ¶
func ParseResult(tree *ast.ParseResult) string
ParseResult renders the full document: pg_query_nodes_to_json.
Types ¶
This section is empty.