The Lambda Lab
/
projects
/
forth.jl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7f2c4e5
)
Improved decompiler support for non-docol words.
author
Tim Vaughan
<tgvaughan@gmail.com>
Mon, 2 May 2016 01:12:40 +0000
(13:12 +1200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Mon, 2 May 2016 01:12:40 +0000
(13:12 +1200)
src/lib.4th
patch
|
blob
|
history
diff --git
a/src/lib.4th
b/src/lib.4th
index
b6c523b
..
6b2d8ae
100644
(file)
--- a/
src/lib.4th
+++ b/
src/lib.4th
@@
-631,9
+631,33
@@
DROP ( at this point, the stack is: start-of-word end-of-word )
SWAP ( end-of-word start-of-word )
DROP ( at this point, the stack is: start-of-word end-of-word )
SWAP ( end-of-word start-of-word )
+ DUP >CFA @ CASE
+ DOCOL OF
+ \ Colon definition
+ ':' EMIT SPACE DUP ID. SPACE
+ DUP ?IMMEDIATE IF ." IMMEDIATE " THEN CR
+ ENDOF
+ DOVAR OF
+ \ Variable definition
+ ." Variable " DUP ID. CR
+ 2DROP EXIT
+ ENDOF
+ DOCON OF
+ \ Constant definition
+ ." Constant " DUP ID. CR
+ 2DROP EXIT
+ ENDOF
+
+ \ Unknown codeword
+ ." Primitive or word with unrecognized codeword." CR
+ DROP 2DROP EXIT
+ ENDCASE
+
( begin the definition with : NAME [IMMEDIATE] )
( begin the definition with : NAME [IMMEDIATE] )
- ':' EMIT SPACE DUP ID. SPACE
- DUP ?IMMEDIATE IF ." IMMEDIATE " THEN CR 4
+ ( ':' EMIT SPACE DUP ID. SPACE
+ DUP ?IMMEDIATE IF ." IMMEDIATE " THEN CR 4 )
+
+ 4 SPACES
>DFA ( get the data address, ie. points after DOCOL | end-of-word start-of-data )
>DFA ( get the data address, ie. points after DOCOL | end-of-word start-of-data )
@@
-699,9
+723,3
@@
2DROP ( restore stack )
;
2DROP ( restore stack )
;
-
-( WELCOME MESSAGE ------------------------------------------------------------- )
-
-CR CR ." --- TimForth initialized --- "
-
-