package
0.0.0-20210525052339-fb7d6bd9331e
Repository: https://github.com/lab47/exprcore.git
Documentation: pkg.go.dev
# Functions
End returns the end position of the expression.
MakePosition returns position with the specified components.
Parse parses the input data and returns the corresponding parse tree.
ParseCompoundStmt parses a single compound statement: a blank line, a def, for, while, or if statement, or a semicolon-separated list of simple statements followed by a newline.
ParseExpr parses a exprcore expression.
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
@.
No description provided by the author
^.
^=.
:.
,.
No description provided by the author
No description provided by the author
.
the end of a DSHELL.
an expandation within a shell expression.
the start of a shell expression with expandation.
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
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 bar.
/.
/=.
//.
//=.
*.
*=.
**.
"foo" or 'foo' or '''foo''' or r'foo' or r"foo".
~.
No description provided by the author
No description provided by the author
# Structs
An AssignStmt represents an assignment: x = 0 x, y = y, x x += 1.
A AtExpr represents @ ident.
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 exprcore 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.
No description provided by the author
No description provided by the author
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 ProtoEntry represents a dictionary entry: Key: Value.
A ProtoExpr represents a prototype literal: %{ List }.
A ReturnStmt returns from a function.
No description provided by the author
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.