Skip to content

Commit 35126a9

Browse files
committed
Resolve double-escaping issue with pair node key
1 parent e5a9516 commit 35126a9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ast/print.go

+3
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ func (n *MapNode) String() string {
212212

213213
func (n *PairNode) String() string {
214214
if str, ok := n.Key.(*StringNode); ok {
215+
if utils.IsValidIdentifier(str.Value) {
216+
return fmt.Sprintf("%s: %s", str.Value, n.Value.String())
217+
}
215218
return fmt.Sprintf("%s: %s", str.String(), n.Value.String())
216219
}
217220
return fmt.Sprintf("(%s): %s", n.Key.String(), n.Value.String())

0 commit comments

Comments
 (0)