Пример #1
0
 protected virtual LayeObject Infix__Concat(LayeState state, LayeObject ths, params LayeObject[] args)
 {
     return new LayeString(ths.ToString(state) + args[0].ToString(state));
 }
Пример #2
0
 /// <summary>
 /// Raises an exception in this Laye state.
 /// The exception will propogate up the call stack until handled.
 /// If the exception propogates through all stacks, the exception is thrown
 /// as a <c>UnhandledLayeException</c> exception.
 /// 
 /// The given exception can be any Laye object.
 /// 
 /// A specific type is provided for detailed exceptions, the <c>Exception</c> type.
 /// It's not necessary to use this type, but it's provided for convenience.
 /// </summary>
 /// <param name="obj"></param>
 public void RaiseException(LayeObject obj)
 {
     if (exceptionHandlers.Count == 0)
         throw new UnhandledLayeException(GetStackTrace(), obj.ToString(this));
     else
     {
         lastException = obj;
         var handler = exceptionHandlers.Pop();
         stack.Top.activeExceptionHandlers--;
         stack.Unwind(stack.FrameCount - handler.frameIndex);
         stack.Top.ip = handler.catchIP - 1;
     }
 }
Пример #3
0
 protected override LayeObject IMethod__toString(LayeState state, LayeObject ths, params LayeObject[] args)
 {
     return new LayeString(ths.ToString());
 }