astext

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: Apache-2.0 Imports: 3 Imported by: 51

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	Text string // represents a single line comment
}

Comment is a comment.

type Object

type Object struct {
	ast.Object

	Fields []ObjectField

	// Oneline prints this field on a single line.
	Oneline bool
}

Object wraps ast.Object and adds the ability to be printed on one line.

type ObjectField

type ObjectField struct {
	ast.ObjectField

	// Comment is a comment for the object field.
	Comment *Comment

	// Oneline prints this field on a single line.
	Oneline bool
}

ObjectField wraps ast.ObjectField and adds commenting and the ability to be printed on one line.

func CreateField

func CreateField(name string) (*ObjectField, error)

CreateField creates an ObjectField with a name. If the name matches `reFieldStr`, it will create an ObjectField with Kind `ObjectFieldStr`. If not, it will create an identifier and set the ObjectField kind to `ObjectFieldId`.

type ObjectFields

type ObjectFields []ObjectField

ObjectFields is a slice of ObjectField.

Jump to

Keyboard shortcuts

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