UrForth: fixed "(BASED-NUMBER)" with radix postfix
[urasm.git] / urflibs / init / bootstrap / 70-replace.f
blobd5e1b9757bd1dd9abc3ce69e407d7630540c8cc9
1 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ;; and now for something completely different...
3 ;; UrAsm Forth Engine!
4 ;; GPLv3 ONLY
5 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7 ;; colon calls defered word "COMPILER:(TRACE-COLON)"
8 ;; semi calls defered word "COMPILER:(TRACE-SEMI)"
10 (* no more!
11 ALSO COMPILER DEFINITIONS
13 0 VALUE TRACE-ENTER-EXIT
16 : (DO-TRACE-ENTER) ( -- )
17 ?COMP
18 TRACE-ENTER-EXIT IF
19 COMPILE ENDCR
20 " >>>ENTER: " STRLITERAL COMPILE TYPE
21 LATEST-NFA DUP C@ SWAP CELL+ SWAP STRLITERAL COMPILE XTYPE
22 COMPILE CR
23 \ COMPILE DEBUG:BACKTRACE
24 ENDIF
25 ; (HIDDEN)
27 ' (DO-TRACE-ENTER) TO (TRACE-COLON)
30 : (DO-TRACE-EXIT) ( -- )
31 ?COMP
32 TRACE-ENTER-EXIT IF
33 COMPILE ENDCR
34 " >>>EXIT: " STRLITERAL COMPILE TYPE
35 LATEST-NFA DUP C@ SWAP CELL+ SWAP STRLITERAL COMPILE XTYPE
36 COMPILE CR
37 \ COMPILE DEBUG:BACKTRACE
38 ENDIF
39 ; (HIDDEN)
41 ' (DO-TRACE-EXIT) TO (TRACE-SEMI)
44 : (DO-TRACE-DOES) ( -- )
45 ?COMP
46 TRACE-ENTER-EXIT IF
47 COMPILE ENDCR
48 " >>>DOES: " STRLITERAL COMPILE TYPE
49 LATEST-NFA DUP C@ SWAP CELL+ SWAP STRLITERAL COMPILE XTYPE
50 " -- PFA: " STRLITERAL COMPILE TYPE
51 COMPILE DUP COMPILE .
52 COMPILE CR
53 \ COMPILE DEBUG:BACKTRACE
54 ENDIF
55 ; (HIDDEN)
57 ' (DO-TRACE-DOES) TO (TRACE-DOES)
60 PREVIOUS DEFINITIONS
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
70 R> STATE !
71 SWAP!
74 : REPLACE ( -- ) \ what with
75 -FIND-REQUIRED -FIND-REQUIRED (REPLACE)
78 PREVIOUS DEFINITIONS