printer

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 9 Imported by: 36

Documentation

Overview

Package printer implements printing of jsonnet AST nodes.

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	IndentSize: 2,
}

DefaultConfig is a default configuration.

Functions

func Fprint

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

Fprint prints a node to the supplied writer using the default configuration.

Types

type Config

type Config struct {
	IndentSize int
	IndentMode IndentMode
}

Config is a configuration for the printer.

func (*Config) Fprint

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

Fprint prints a node to the supplied writer.

type IndentMode

type IndentMode int

IndentMode is the indent mode for Config.

const (
	// IndentModeSpace indents with spaces.
	IndentModeSpace IndentMode = iota
	// IndentModeTab indents with tabs.
	IndentModeTab
)

Jump to

Keyboard shortcuts

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