fix code generation for logical expressions with "~"
more precise diagnostic for IF/THEN syntax errors
one more fix in logical expressions and "~"
tune up error diagnostic in case of referencing unknown fields