Ejemplo n.º 1
0
 public override DObject OpADD(DObject other)
 {
     return(new DString(value + other.ToString()));
 }
Ejemplo n.º 2
0
        public override Member OpINDEX(DObject other)
        {
            var key = pairs.Keys.ToList().Find(x => x.Equals(other));

            if (key == null)
            {
                throw new InterpreterException(Interpreter.current.CurrentToken, "No key exists: " + other.ToString());
            }

            return(pairs[key]);
        }
Ejemplo n.º 3
0
 public void Print(DObject obj)
 {
     Console.WriteLine(obj.ToString());
 }
Ejemplo n.º 4
0
 public void Write(DObject obj)
 {
     Console.Write(obj.ToString());
 }
Ejemplo n.º 5
0
 public override Member OpINDEX(DObject other)
 {
     return(GetMember(other.ToString()));
     //throw new Exception("A table cannot be indexed. Instead, make getter and setter methods.");
 }