package
0.0.0-20250205221240-492d3672b3f4
Repository: https://github.com/google/starlark-go.git
Documentation: pkg.go.dev
# Functions
End returns the end position of the expression.
LegacyFileOptions returns a new FileOptions containing the current values of the resolver package's legacy global variables such as [resolve.AllowRecursion], etc.
MakePosition returns position with the specified components.
Parse calls the Parse method of LegacyFileOptions().
ParseCompoundStmt calls the ParseCompoundStmt method of LegacyFileOptions().
ParseExpr calls the ParseExpr method of LegacyFileOptions().
Quote returns a Starlark literal that denotes s.
Start returns the start position of the expression.
Walk traverses a syntax tree in depth-first order.
# Constants
&.
&=.
Keywords.
No description provided by the author
b"foo", etc.
^.
^=.
:.
,.
No description provided by the author
No description provided by the author
.
No description provided by the author
No description provided by the author
No description provided by the author
=.
==.
1.23e45.
No description provided by the author
>=.
>.
>>.
>>=.
x.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
123.
No description provided by the author
{.
[.
<=.
No description provided by the author
(.
<.
<<.
<<=.
-.
-=.
!=.
No description provided by the author
No description provided by the author
synthesized by parser from NOT IN.
No description provided by the author
No description provided by the author
No description provided by the author
%.
%=.
|.
|=.
+.
+= (keep order consistent with PLUS..GTGT).
}.
].
retain comments in AST; see Node.Comments.
No description provided by the author
).
;.
/.
/=.
//.
//=.
*.
*=.
**.
"foo" or 'foo' or '''foo''' or r'foo' or r"foo".
~.
No description provided by the author
# Structs
An AssignStmt represents an assignment:
x = 0 x, y = y, x x += 1.
A BinaryExpr represents a binary expression: X Op Y.
A BranchStmt changes the flow of control: break, continue, pass.
A CallExpr represents a function call expression: Fn(Args).
A Comment represents a single # comment.
Comments collects the comments associated with an expression.
A Comprehension represents a list or dict comprehension: [Body for ..
CondExpr represents the conditional: X if COND else ELSE.
A DefStmt represents a function definition.
A DictEntry represents a dictionary entry: Key: Value.
A DictExpr represents a dictionary literal: { List }.
A DotExpr represents a field or method selector: X.Name.
An Error describes the nature and position of a scanner or parser error.
An ExprStmt is an expression evaluated for side effects.
A File represents a Starlark file.
FileOptions specifies various per-file options that affect static aspects of an individual file such as parsing, name resolution, and code generation.
A FilePortion describes the content of a portion of a file.
A ForClause represents a for clause in a list comprehension: for Vars in X.
A ForStmt represents a loop: for Vars in X: Body.
An Ident represents an identifier.
An IfClause represents an if clause in a list comprehension: if Cond.
An IfStmt is a conditional: If Cond: True; else: False.
An IndexExpr represents an index expression: X[Y].
A LambdaExpr represents an inline function abstraction.
A ListExpr represents a list literal: [ List ].
A Literal represents a literal string or number.
A LoadStmt loads another module and binds names from it: load(Module, "x", y="foo").
A ParenExpr represents a parenthesized expression: (X).
A Position describes the location of a rune of input.
A ReturnStmt returns from a function.
A SliceExpr represents a slice or substring expression: X[Lo:Hi:Step].
A TupleExpr represents a tuple literal: (List).
A UnaryExpr represents a unary expression: Op X.
A WhileStmt represents a while loop: while X: Body.