예제 #1
0
파일: expr.go 프로젝트: gsrpc/gslang
// NewUnaryOp .
func NewUnaryOp(token lexer.TokenType, operand Expr) *UnaryOp {
	lit := &UnaryOp{
		Token:   token,
		Operand: operand,
	}

	lit._init(token.String())

	return lit
}
예제 #2
0
파일: expr.go 프로젝트: gsrpc/gslang
// NewBinaryOp .
func NewBinaryOp(token lexer.TokenType, lhs, rhs Expr) *BinaryOp {
	lit := &BinaryOp{
		Token: token,
		LHS:   lhs,
		RHS:   rhs,
	}

	lit._init(token.String())

	return lit
}