expr-lang / expr

Expression language and expression evaluation for Go
https://expr-lang.org
MIT License
5.85k stars 378 forks source link

Double escaping pair node key #639

Closed aizeNR closed 2 months ago

aizeNR commented 2 months ago

Hi, in commit add escaping pair node key, but str.String() already uses this and it causes double escaping.

Example https://go.dev/play/p/WTkUxu5yM4e

package main

import (
    "fmt"

    "github.com/expr-lang/expr/parser"
)

func main() {
    tree, err := parser.Parse(`{"9": 10}`)
    if err != nil {
        fmt.Print(err.Error())
        return
    }

    fmt.Print(tree.Node.String())
}