Added github action fix for parsing xml, updated linter

This commit is contained in:
Mike Farah
2022-02-07 11:55:55 +11:00
parent 06e944dcb6
commit 26356ff4be
48 changed files with 238 additions and 339 deletions
+5 -5
View File
@@ -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
}
}