Exemple #1
0
func (v *SemanticalVisitor) VisitIn(n *parser.NodeIn) error {
	lval := n.LeftValue()
	if lval.Operator() != lexical.T_LITERAL {
		return throwSemanticalError("LValue at In operator shoud be a literal")
	}

	rval := n.RightValue()
	if rval.Operator() != lexical.T_ID {
		return throwSemanticalError("RValue at In operator shoud be a Identifier")
	}

	return nil
}
Exemple #2
0
func (v *RuntimeVisitor) VisitIn(n *parser.NodeIn) error {
	lvalue := n.LeftValue().(*parser.NodeLiteral).Value()
	rvalue := n.RightValue().(*parser.NodeId).Value()
	boolRegister = n.Assertion(lvalue, metadata(rvalue))

	return nil
}