astjson

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package astjson encodes and decodes an *ast.Program to and from a kind-tagged JSON document. The document is the editable AST surface handed to JavaScript plugins running inside QuickJS: every node becomes an object with a "kind" discriminator plus its exported fields, so plugin authors can inspect and patch the tree with plain JS and hand it back.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeProgram

func DecodeProgram(data []byte) (*ast.Program, error)

DecodeProgram reconstructs a program from an AST document. It accepts the output of EncodeProgram or a hand-edited equivalent.

func EncodeProgram

func EncodeProgram(p *ast.Program) ([]byte, error)

EncodeProgram converts a parsed program into the AST document JSON.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL