Bike.Interpreter.Interpreter.OpAdd C# (CSharp) Метод

OpAdd() публичный Метод

public OpAdd ( object lv, object rv ) : object
lv object
rv object
Результат object
        public object OpAdd(object lv, object rv)
        {
            if (lv == null && rv == null)
                throw ErrorFactory.CreateTypeError( "Invalid operand type: 'null'");
            if (lv is BikeString)
                return new BikeString(Stringify(lv) + (rv == null ? "null" : Stringify(rv)));
            if (rv is BikeString)
                return new BikeString((lv == null ? "null" : Stringify(lv)) + Stringify(rv));
            if (lv is BikeNumber && rv is BikeNumber)
                return new BikeNumber(((BikeNumber)lv).Value + ((BikeNumber)rv).Value);
            throw ErrorFactory.CreateTypeError(string.Format("Invalid operand type: {0} and {1}", lv, rv));
        }