Beispiel #1
0
        public IList<HandlerInfo> FindActiveHandlersFor(IokeObject condition, BindIndex stopIndex)
        {
            var result = new SaneList<HandlerInfo>();

            foreach(IList<HandlerInfo> lrp in Handlers) {
                foreach(HandlerInfo rp in lrp) {
                    if(rp.index.LessThan(stopIndex)) {
                        return result;
                    }

                    foreach(object possibleKind in rp.applicableConditions) {
                        if(IokeObject.IsMimic(condition, IokeObject.As(possibleKind, condition))) {
                            result.Add(rp);
                        }
                    }
                }
            }

            return result;
        }
Beispiel #2
0
 public RestartInfo(string name, IokeObject restart, object token, BindIndex index, object data)
 {
     this.name = name;
     this.restart = restart;
     this.token = token;
     this.index = index;
     this.data = data;
 }
Beispiel #3
0
 public RescueInfo(IokeObject rescue, IList applicableConditions, object token, BindIndex index)
 {
     this.rescue = rescue;
     this.applicableConditions = applicableConditions;
     this.token = token;
     this.index = index;
 }
Beispiel #4
0
 public HandlerInfo(IokeObject handler, IList applicableConditions, object token, BindIndex index)
 {
     this.handler = handler;
     this.applicableConditions = applicableConditions;
     this.token = token;
     this.index = index;
 }
Beispiel #5
0
 public bool LessThan(BindIndex other)
 {
     return this.row < other.row ||
         (this.row == other.row && this.col < other.col);
 }
Beispiel #6
0
 public bool GreaterThan(BindIndex other)
 {
     return this.row > other.row ||
         (this.row == other.row && this.col > other.col);
 }