I created the RFE 
[feature-requests:#835] 
<https://sourceforge.net/p/oorexx/feature-requests/835/> Trace entry in 
routine/method when trace is the first instruction
The attached patch is a POC implementation that follows these rules:

The entry trace is activated when the trace instruction is the first 
instruction in a routine/method (or the second if the first instruction is an 
expose).
    ::routine myRoutine
    trace r

    ::method myMethod
    expose something
    trace value (arg(3) == .true)~?("r", "o”)
    use strict arg arg1, arg2, trace=.false

The trace instruction can be in an interpret instruction.
    ::routine myRoutine
    interpret "trace r"

    ::routine myRoutine
    interpret "trace" arg(1)

The following cases don't activate the entry trace:
    ::routine myRoutine
    use strict arg arg1, arg2, trace=.false
    if trace then trace r -- trace is not the first instruction

    ::routine myRoutine
    interpret "x = 0; trace r" -- trace is not the first instruction

    ::routine myRoutine
    interpret "interpret ""trace r""" -- trace is not in a routine/method (the 
immediate parent is an interpret instruction)


The function trace() is not yet covered by the patch, but should give the same 
entry trace.
    trace = trace(“r”)
is equivalent to
    trace r


_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to