new prefix operator "!" as logic NOT
This commit is contained in:
parent
760c1ee6da
commit
6b3351b324
@ -444,8 +444,7 @@ func (parser *parser) parseGeneral(scanner *scanner, ctx parserContext, termSymb
|
||||
} else if tk.IsSymbol(SymStar) {
|
||||
tk.SetSymbol(SymDereference)
|
||||
} else if tk.IsSymbol(SymExclamation) {
|
||||
err = tk.Errorf("postfix opertor %q requires an operand on its left side", tk)
|
||||
break
|
||||
tk.SetSymbol(SymNot)
|
||||
}
|
||||
firstToken = false
|
||||
}
|
||||
|
@ -26,12 +26,13 @@ func TestBool(t *testing.T) {
|
||||
/* 12 */ {`true or false`, true, nil},
|
||||
/* 13 */ {`true or []`, true, nil},
|
||||
/* 14 */ {`[] or false`, nil, errors.New(`got list as left operand type of 'OR' operator, it must be bool`)},
|
||||
/* 15 */ {`!true`, false, nil},
|
||||
/* 13 */ //{`true or []`, nil, errors.New(`[1:8] left operand 'true' [bool] and right operand '[]' [list] are not compatible with operator "OR"`)},
|
||||
}
|
||||
|
||||
// t.Setenv("EXPR_PATH", ".")
|
||||
|
||||
// runTestSuiteSpec(t, section, inputs, 1)
|
||||
// runTestSuiteSpec(t, section, inputs, 15)
|
||||
runTestSuite(t, section, inputs)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user