Missing Type in Interface ExprNode, lhs can be both an ExprNode and ExprNode[]
DevDimov opened this issue · 1 comments
DevDimov commented
In Interface ExprNode
, lhs
can be both an ExprNode
and ExprNode[]
For example, jsonata('($x := 1; $y := 2;)').ast().expressions
outputs
[
{
type: "bind",
value: ":=",
position: 7,
lhs: { value: "x", type: "variable", position: 4 },
rhs: { value: 1, type: "number", position: 9 },
},
{
type: "bind",
value: ":=",
position: 15,
lhs: { value: "y", type: "variable", position: 13 },
rhs: { value: 2, type: "number", position: 16 },
},
];
And jsonata('{"x": y, "z": 1}').ast()
outputs
{
"type": "unary",
"value": "{",
"position": 1,
"lhs": [
[
{
"value": "x",
"type": "string",
"position": 4
},
{
"type": "path",
"steps": [
{
"value": "y",
"type": "name",
"position": 7
}
]
}
],
[
{
"value": "z",
"type": "string",
"position": 12
},
{
"value": 1,
"type": "number",
"position": 15
}
]
]
}
Similar issue: #585
I'm using node v20.13.0 and jsonata v2.0.4. Happy to open a pull request.