printer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package printer contains utilities for pretty-printing Alloy ASTs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fprint

func Fprint(w io.Writer, node ast.Node) error

Fprint pretty-prints the specified node to w. The Node type must be an *ast.File, ast.Body, or a type that implements ast.Stmt or ast.Expr.

Types

type Config

type Config struct {
	Indent int // Indentation to apply to all emitted code. Default 0.
}

Config configures behavior of the printer.

func (*Config) Fprint

func (c *Config) Fprint(w io.Writer, node ast.Node) (err error)

Fprint pretty-prints the specified node to w. The Node type must be an *ast.File, ast.Body, or a type that implements ast.Stmt or ast.Expr.

Jump to

Keyboard shortcuts

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