diff --git a/syntax/parser.go b/syntax/parser.go index 59a45b18..2a2ae910 100644 --- a/syntax/parser.go +++ b/syntax/parser.go @@ -1359,8 +1359,7 @@ func (p *Parser) paramExp() *ParamExp { p.curErr("not a valid parameter expansion operator: %v", p.tok) } p.quote = old - pe.Rbrace = p.pos - p.matched(pe.Dollar, dollBrace, rightBrace) + pe.Rbrace = p.matched(pe.Dollar, dollBrace, rightBrace) return pe } diff --git a/syntax/walk.go b/syntax/walk.go index 27fdcb1b..85d66924 100644 --- a/syntax/walk.go +++ b/syntax/walk.go @@ -235,6 +235,7 @@ func Walk(node Node, f func(Node) bool) { func DebugPrint(w io.Writer, node Node) error { p := debugPrinter{out: w} p.print(reflect.ValueOf(node)) + p.printf("\n") return p.err }