Provides a low-level interface to the go/parser package.
Package parser implements a parser for Go source files. Input may be
provided in a variety of forms (see the various Parse* functions); the
output is an abstract syntax tree (AST) representing the Go source. The
parser is invoked through one of the Parse* functions.
The parser accepts a larger language than is syntactically permitted by
the Go spec, for simplicity, and for improved robustness in the presence
of syntax errors. For instance, in method declarations, the receiver is
treated like an ordinary parameter list and thus may contain multiple
entries where the spec permits exactly one. Consequently, the corresponding
field in the AST (ast.FuncDecl.Recv) field is not restricted to one entry.
ConstantsConstants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.
report all errors (not just the first 10 on different lines)
report declaration errors
stop parsing after import declarations
stop parsing after package clause
parse comments and add them to AST
same as AllErrors, for backward-compatibility
print a trace of parsed productions
Functions, Macros, and Special Forms
ParseExpr is a convenience function for obtaining the AST of an expression x.
The position information recorded in the AST is undefined. The filename used
in error messages is the empty string.
If syntax errors were found, the result is a partial AST (with ast.Bad* nodes
representing the fragments of erroneous source code). Multiple errors are
returned via a scanner.ErrorList which is sorted by source position.
Go input arguments: (x string)
Go return type: (go/ast.Expr, error)
Joker input arguments: [^String x]
Joker return type: [go.std.go.ast/Expr Error]
*ModeConcrete GoType v1.0
ModeConcrete GoType v1.0
A Mode value is a set of flags (or 0).
They control the amount of source code parsed and other optional