Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor EvaluationStage.go to follow a declarative approach #8

Merged
merged 7 commits into from
Mar 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions evaluationStage.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,20 @@ func (this *evaluationStage) setToNonStage(other evaluationStage) {
this.typeErrorFormat = other.typeErrorFormat
}

func (this *evaluationStage) isShortCircuitable() bool {
// test
var symbolMap = map[OperatorSymbol]bool{
AND: true,
OR: true,
TERNARY_TRUE: true,
TERNARY_FALSE: true,
COALESCE: true,
}

switch this.symbol {
case AND:
fallthrough
case OR:
fallthrough
case TERNARY_TRUE:
fallthrough
case TERNARY_FALSE:
fallthrough
case COALESCE:
func (this *evaluationStage) isShortCircuitable() bool {
var symbolE = this.symbol
if symbolMap[symbolE] {
return true
}

return false
}

Expand Down Expand Up @@ -428,8 +427,6 @@ func inStage(left interface{}, right interface{}, parameters Parameters) (interf
return false, nil
}

//

func isString(value interface{}) bool {

switch value.(type) {
Expand Down