Beispiel #1
0
        public static void onBreakPoint(ProseRuntime runtime, PNode source, BreakPointObject.RuntimeData rtdata, string script)
        {
            breakPointDepth++;

            runtime.read(script, runtime.GlobalClient);
            runtime.read("read file \"Libraries/REPL/onbreak.prose\"", runtime.GlobalClient);
            ProseREPLLoop();

            breakPointDepth--;
        }
Beispiel #2
0
        private PNode debugFilterIncomingPNode(PNode node)
        {
            node = filterIncomingPNode(node);

            bool filterAgain = false;                           //	Determines if we repeatedly apply this.

            do
            {
                if (node == null)
                {
                    break;
                }

                //	Check for breakpoints
                if (node.value is BreakPointObject)
                {
                    BreakPointObject             bp     = (BreakPointObject)node.value;
                    BreakPointObject.RuntimeData rtdata = new BreakPointObject.RuntimeData();

                    //	Do any action associated with the breakpoint and make the default callback if asked
                    if (bp.doBreakPoint(this, node, rtdata))
                    {
                        if (OnBreakPoint != null)
                        {
                            OnBreakPoint(this, node, rtdata, bp.BreakScript);
                        }
                    }

                    //	Remove the breakpoint
                    if (node.prev != null)
                    {
                        node.prev.next = node.next;
                    }
                    if (node.next != null)
                    {
                        node.next.prev = node.prev;
                    }

                    filterAgain = true;

                    //	Skip over the breakpoint
                    node = node.next;
                }
            } while (filterAgain);

            return(node);
        }
Beispiel #3
0
 //	Overriding instructions:
 //	Return true if you want the runtime to make the standard breakpoint callback.
 //	Return false if you prefer to handle the event yourself in the body of onBreak()
 public bool onBreak(ProseRuntime runtime, PNode source, BreakPointObject.RuntimeData rtdata)
 {
     //	Handle the breakpoint in a non-standard way if you want
     //	by putting something in the body of this function.
     return(true);
 }
Beispiel #4
0
 public bool doBreakPoint(ProseRuntime runtime, PNode source, BreakPointObject.RuntimeData rtdata)
 {
     return(onBreak(runtime, source, rtdata));
 }
Beispiel #5
0
        private PNode debugFilterIncomingPNode(PNode node)
        {
            node = filterIncomingPNode(node);

            bool filterAgain = false;		//	Determines if we repeatedly apply this.

            do {
                if (node == null)
                    break;

                //	Check for breakpoints
                if (node.value is BreakPointObject)
                {
                    BreakPointObject bp = (BreakPointObject) node.value;
                    BreakPointObject.RuntimeData rtdata = new BreakPointObject.RuntimeData();

                    //	Do any action associated with the breakpoint and make the default callback if asked
                    if (bp.doBreakPoint(this, node, rtdata)) {
                        if (OnBreakPoint != null)
                            OnBreakPoint(this, node, rtdata, bp.BreakScript);
                    }

                    //	Remove the breakpoint
                    if (node.prev != null)
                        node.prev.next = node.next;
                    if (node.next != null)
                        node.next.prev = node.prev;

                    filterAgain = true;

                    //	Skip over the breakpoint
                    node = node.next;
                }
            } while (filterAgain);

            return node;
        }