Exemplo n.º 1
0
void checkuminus(expr* e){
	if(e->type ==CONSTBOOL_E ||
	e->type==CONSTSTRING_E||
	e->type==NIL_E||
	e->type==NEWTABLE_E||
	e->type==PROGRAMFUNC_E||
	e->type==LIBRARYFUNC_E||
	e->type==BOOLEXPR_E)
	comperror("Illegal expr to unary -");
}
Exemplo n.º 2
0
// Since we may know at compile time a unary
// minus type conflict, we can spot it. You can
// also use negation test For implementation.
//
void checkuminus(expr* e){
	if (e->type == constbool_e ||
		e->type == conststring_e ||
		e->type == nil_e ||
		e->type == newtable_e ||
		e->type == programfunc_e ||
		e->type == libraryfunc_e ||
		e->type == boolexpr_e)
		comperror("Illegal expr to unary -");
}