diff --git a/parser.go b/parser.go index 5c23171..2859b65 100644 --- a/parser.go +++ b/parser.go @@ -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 } diff --git a/t_bool_test.go b/t_bool_test.go index 6997352..c864fd0 100644 --- a/t_bool_test.go +++ b/t_bool_test.go @@ -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) }