Standard library / go/ast
go/ast.BadExpr
Placeholder for a malformed expression. Parser recovery can retain these nodes; do not assume recovered source is valid. Expected stdout: '3 7\n'.
Formal Syntax & Structure
go syntaxgo
type BadExpr struct { From, To token.Pos}Working Example
Example Snippetgo
package main
import ( "fmt" "go/ast")
func main() { x := &ast.BadExpr{From: 3, To: 7}; fmt.Println(x.Pos(), x.End()) }