mirror of
https://github.com/mikefarah/yq.git
synced 2026-08-24 08:22:13 +08:00
Added github action fix for parsing xml, updated linter
This commit is contained in:
@@ -7,8 +7,8 @@ import (
|
||||
|
||||
type ExpressionNode struct {
|
||||
Operation *Operation
|
||||
Lhs *ExpressionNode
|
||||
Rhs *ExpressionNode
|
||||
LHS *ExpressionNode
|
||||
RHS *ExpressionNode
|
||||
}
|
||||
|
||||
type ExpressionParserInterface interface {
|
||||
@@ -55,15 +55,15 @@ func (p *expressionParserImpl) createExpressionTree(postFixPath []*Operation) (*
|
||||
return nil, fmt.Errorf("'%v' expects 1 arg but received none", strings.TrimSpace(Operation.StringValue))
|
||||
}
|
||||
remaining, rhs := stack[:len(stack)-1], stack[len(stack)-1]
|
||||
newNode.Rhs = rhs
|
||||
newNode.RHS = rhs
|
||||
stack = remaining
|
||||
} else if numArgs == 2 {
|
||||
if len(stack) < 2 {
|
||||
return nil, fmt.Errorf("'%v' expects 2 args but there is %v", strings.TrimSpace(Operation.StringValue), len(stack))
|
||||
}
|
||||
remaining, lhs, rhs := stack[:len(stack)-2], stack[len(stack)-2], stack[len(stack)-1]
|
||||
newNode.Lhs = lhs
|
||||
newNode.Rhs = rhs
|
||||
newNode.LHS = lhs
|
||||
newNode.RHS = rhs
|
||||
stack = remaining
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user