mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
handled EvaluateNodes panic (#1140)
This commit is contained in:
parent
3924ed8a35
commit
406bbb8ca4
@ -22,6 +22,7 @@ type allAtOnceEvaluator struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewAllAtOnceEvaluator() Evaluator {
|
func NewAllAtOnceEvaluator() Evaluator {
|
||||||
|
InitExpressionParser()
|
||||||
return &allAtOnceEvaluator{treeNavigator: NewDataTreeNavigator()}
|
return &allAtOnceEvaluator{treeNavigator: NewDataTreeNavigator()}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@ var evaluateNodesScenario = []expressionScenario{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestAllAtOnceEvaluateNodes(t *testing.T) {
|
func TestAllAtOnceEvaluateNodes(t *testing.T) {
|
||||||
InitExpressionParser()
|
|
||||||
var evaluator = NewAllAtOnceEvaluator()
|
var evaluator = NewAllAtOnceEvaluator()
|
||||||
for _, tt := range evaluateNodesScenario {
|
for _, tt := range evaluateNodesScenario {
|
||||||
node := test.ParseData(tt.document)
|
node := test.ParseData(tt.document)
|
||||||
|
@ -7,9 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func getExpressionParser() ExpressionParserInterface {
|
func getExpressionParser() ExpressionParserInterface {
|
||||||
if ExpressionParser == nil {
|
InitExpressionParser()
|
||||||
ExpressionParser = newExpressionParser()
|
|
||||||
}
|
|
||||||
return ExpressionParser
|
return ExpressionParser
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user