Skip to content

Commit

Permalink
syntax: use Parser.matched consistently
Browse files Browse the repository at this point in the history
It's the same behavior, but the code becomes more consistent.

While here, make DebugPrint always finish the output with a newline.
  • Loading branch information
mvdan committed Jul 31, 2024
1 parent 3697a78 commit e81efe5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions syntax/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions syntax/walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit e81efe5

Please sign in to comment.