Skip to content

Commit

Permalink
clear pathMap keys (#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
goccy authored Nov 15, 2024
1 parent d7847db commit 69159b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ func (p *parser) setSameLineCommentIfExists(ctx *context, node ast.Node) error {
}

func (p *parser) parseDocument(ctx *context) (*ast.DocumentNode, error) {
p.pathMap = make(map[string]ast.Node)
startTk := p.currentToken()
p.progress(1) // skip document header token
body, err := p.parseToken(ctx, p.currentToken())
Expand Down
7 changes: 7 additions & 0 deletions parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ a: !tag
a:
b: c
`,
`
foo: xxx
---
foo: yyy
---
foo: zzz
`,
}
for _, src := range sources {
Expand Down

0 comments on commit 69159b3

Please sign in to comment.