| |
|
| defer printdebugdata ( -- ) \ gforth print-debug-data |
defer printdebugdata ( -- ) \ gforth print-debug-data |
| ' .s IS printdebugdata |
' .s IS printdebugdata |
| defer printdebugline ( addr -- ) \ gforth print-debug-line |
defer .debugline ( nfile nline -- ) \ gforth print-debug-line |
| |
|
| : (printdebugline) ( addr -- ) |
: (.debugline) ( nfile nline -- ) |
| cr print-sourcepos ." :" |
cr .sourcepos ." :" |
| \ it would be nice to print the name of the following word, |
\ it would be nice to print the name of the following word, |
| \ but that's not easily possible for primitives |
\ but that's not easily possible for primitives |
| printdebugdata |
printdebugdata |
| cr ; |
cr ; |
| |
|
| ' (printdebugline) IS printdebugline |
' (.debugline) IS .debugline |
| |
|
| : (~~) ( -- ) |
|
| r@ printdebugline |
|
| r> sourcepos %size + >r ; |
|
| |
|
| : ~~ ( compilation -- ; run-time -- ) \ gforth tilde-tilde |
: ~~ ( compilation -- ; run-time -- ) \ gforth tilde-tilde |
| POSTPONE (~~) sourcepos, ; immediate |
compile-sourcepos POSTPONE .debugline ; immediate |
| |
|