printer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ASTToString

func ASTToString(meta parser.FileMeta) (string, error)

ASTToString convert ast to code

func PrintAstNode

func PrintAstNode(node any, indent int) ([]byte, error)

PrintAstNode convert node to code node: The node type must be *ast.File, *CommentedNode, []ast.Decl, []ast.Stmt, or assignment-compatible to ast.Expr, ast.Decl, ast.Spec, or ast.Stmt. indent: code indented by {indent} tab

func PrintAstNodes

func PrintAstNodes[T any](nodes []T, indent int) ([]byte, error)

PrintAstNodes print node array, T is node type suitable for PrintAsNode

Types

This section is empty.

Jump to

Keyboard shortcuts

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