Skip to content

Commit 23ede36

Browse files
committed
clear pathMap keys
1 parent d7847db commit 23ede36

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

parser/parser.go

+1
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ func (p *parser) setSameLineCommentIfExists(ctx *context, node ast.Node) error {
830830
}
831831

832832
func (p *parser) parseDocument(ctx *context) (*ast.DocumentNode, error) {
833+
p.pathMap = make(map[string]ast.Node)
833834
startTk := p.currentToken()
834835
p.progress(1) // skip document header token
835836
body, err := p.parseToken(ctx, p.currentToken())

parser/parser_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ a: !tag
133133
a:
134134
b: c
135135
136+
`,
137+
`
138+
foo: xxx
139+
---
140+
foo: yyy
141+
---
142+
foo: zzz
136143
`,
137144
}
138145
for _, src := range sources {

0 commit comments

Comments
 (0)