package
0.21.0-rc1
Repository: https://github.com/google/go-jsonnet.git
Documentation: pkg.go.dev

# Functions

BuildSource transforms a source file string into a Source struct.
Clone creates an independent copy of an AST.
FodderAppend appends to the fodder but preserves constraints.
FodderConcat concats the two fodders but also preserves constraints.
FodderCountNewlines returns the number of new line chars represented by the fodder.
FodderElementCountNewlines returns the number of new line chars represented by the fodder element.
FodderEnsureCleanNewline adds a LineEnd to the fodder if necessary.
FodderHasCleanEndline is true if the fodder doesn't end with an interstitial.
FodderMoveFront moves b to the front of a.
LineBeginning returns the part of a line directly before LocationRange for example: local x = foo() ^^^^^ <- LocationRange loc then local x = foo() ^^^^^^^^^^ <- lineBeginning(loc).
LineEnding returns the part of a line directly after LocationRange for example: local x = foo() + test ^^^^^ <- LocationRange loc then local x = foo() + test ^^^^^^^ <- lineEnding(loc).
LocationBefore returns whether one code location refers to the location closer to the beginning of the file than the other one.
LocationRangeBetween returns a LocationRange containing both a and b.
MakeFodderElement is a helper function that checks some preconditions.
MakeLocationRange creates a LocationRange.
MakeLocationRangeMessage creates a pseudo-LocationRange with a message but no location information.
NewIdentifierSet creates a new IdentifierSet.
NewNodeBase creates a new NodeBase from initial LocationRange and Identifiers.
NewNodeBaseLoc creates a new NodeBase from an initial LocationRange.
ObjectFieldLocalNoMethod creates a non-method local object field.

# Constants

Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
Binary operators.
FodderInterstitial represents a comment in middle of a line.
FodderLineEnd represents a line ending.
FodderParagraph represents a comment consisting of at least one line.
<f1> 'assert' <expr2> '[' <opF> ':' <expr3> ']' <commaF> where expr3 can be nil.
<f1> '[' <expr1> <f2> ']' <colon> <expr2> <commaF>.
f:: e.
<f1> <id> <colon> <expr2> <commaF>.
f: e.
<expr1> <colon> <expr2> <commaF>.
f::: e.
<f1> 'local' <f2> <id> '=' <expr2> <commaF>.
Literal string kinds.
Literal string kinds.
Literal string kinds.
Unary operators.
Unary operators.
Unary operators.
Unary operators.
Literal string kinds.
Literal string kinds.

# Variables

BopMap is a map from binary operator token strings to BinaryOp values.
UopMap is a map from unary operator token strings to UnaryOp values.

# Structs

Apply represents a function call.
ApplyBrace represents e { }.
Arguments represents positional and named arguments to a function call f(x, y, z=1).
Array represents array constructors [1, 2, 3].
ArrayComp represents array comprehensions (which are like Python list comprehensions).
Assert represents an assert expression (not an object-level assert).
Binary represents binary operators.
CommaSeparatedExpr represents an expression that is an element of a comma-separated list of expressions (e.g.
CommaSeparatedID represents an expression that is an element of a comma-separated list of identifiers (e.g.
Conditional represents if/then/else.
DesugaredObject represents object constructors { f: e ..
DesugaredObjectField represents a desugared object field.
Dollar represents the $ keyword.
Error represents the error e.
FodderElement is a single piece of fodder.
ForSpec represents a for-specification in a comprehension.
Function represents a function definition.
IfSpec represents an if-specification in a comprehension.
Import represents import "file".
ImportBin represents importbin "file".
ImportStr represents importstr "file".
Index represents both e[e] and the syntax sugar e.f.
InSuper represents the e in super construct.
LiteralBoolean represents true and false.
LiteralNull represents the null keyword.
LiteralNumber represents a JSON number.
LiteralString represents a JSON string.
Local represents local x = e; e.
LocalBind is a helper struct for astLocal.
Location represents a single location in an (unspecified) file.
LocationRange represents a range of a source file.
NamedArgument represents a named argument to function call x=1.
NodeBase holds fields common to all node types.
Object represents object constructors { f: e ..
ObjectComp represents object comprehension { [e]: e for x in e for.
ObjectField represents a field of an object or object comprehension.
Parameter represents a parameter of function.
Parens represents parentheses ( e ).
Self represents the self keyword.
Slice represents an array slice a[begin:end:step].
Source represents a source file.
SourceProvider represents a source provider.
SuperIndex represents the super[e] and super.f constructs.
Unary represents unary operators.
Var represents variables.

# Interfaces

Node represents a node in the AST.

# Type aliases

BinaryOp represents a binary operator.
DesugaredObjectFields represents a DesugaredObjectField slice.
DiagnosticFileName is a file name used for diagnostics.
Fodder is stuff that is usually thrown away by lexers/preprocessors but is kept so that the source can be round tripped with near full fidelity.
FodderKind is an enum.
Identifier represents a variable / parameter / field name.
Identifiers represents an Identifier slice.
IdentifierSet represents an Identifier set.
LiteralStringKind represents the kind of a literal string.
LocalBinds represents a LocalBind slice.
Nodes represents a Node slice.
ObjectFieldHide represents the visibility of an object field.
ObjectFieldKind represents the kind of an object field.
ObjectFields represents an ObjectField slice.
UnaryOp represents a unary operator.