1 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ;; and now
for something completely different
...
5 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7 ;; colon calls defered word
"COMPILER:(TRACE-COLON)"
8 ;; semi calls defered word
"COMPILER:(TRACE-SEMI)"
11 ALSO COMPILER DEFINITIONS
13 0 VALUE TRACE
-ENTER
-EXIT
16 : (DO-TRACE
-ENTER
) ( -- )
20 " >>>ENTER: " STRLITERAL COMPILE TYPE
21 LATEST
-NFA DUP C@ SWAP CELL
+ SWAP STRLITERAL COMPILE XTYPE
23 \ COMPILE DEBUG
:BACKTRACE
27 ' (DO-TRACE-ENTER) TO (TRACE-COLON)
30 : (DO-TRACE-EXIT) ( -- )
34 " >>>EXIT: " STRLITERAL COMPILE TYPE
35 LATEST-NFA DUP C@ SWAP CELL+ SWAP STRLITERAL COMPILE XTYPE
37 \ COMPILE DEBUG:BACKTRACE
41 ' (DO-TRACE
-EXIT
) TO (TRACE
-SEMI
)
44 : (DO-TRACE
-DOES
) ( -- )
48 " >>>DOES: " STRLITERAL COMPILE TYPE
49 LATEST
-NFA DUP C@ SWAP CELL
+ SWAP STRLITERAL COMPILE XTYPE
50 " -- PFA: " STRLITERAL COMPILE TYPE
53 \ COMPILE DEBUG
:BACKTRACE
57 ' (DO-TRACE-DOES) TO (TRACE-DOES)
64 ALSO DEBUG DEFINITIONS
66 : (REPLACE) ( what-cfa with-cfa -- )
67 COMPILER:(CREATE-NAMELESS) CFA->PFA SWAP
68 STATE @ >R [COMPILE] ]
69 COMPILE DROP [COMPILE] CFALITERAL COMPILE EXECUTE-TAIL
74 : REPLACE ( -- ) \ what with
75 -FIND-REQUIRED -FIND-REQUIRED (REPLACE)