[Wisp-cvs] wisp/modules universal.wrti,1.22,1.23 wisptyp.wrti,1.18,1.19
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2002-09-26 18:22:41
|
Update of /cvsroot/wisp/wisp/modules In directory usw-pr-cvs1:/tmp/cvs-serv28730/modules Modified Files: universal.wrti wisptyp.wrti Log Message: Made Worth's syntax stack visible to the source being translated. Index: universal.wrti =================================================================== RCS file: /cvsroot/wisp/wisp/modules/universal.wrti,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- universal.wrti 18 Sep 2002 21:15:12 -0000 1.22 +++ universal.wrti 26 Sep 2002 18:21:38 -0000 1.23 @@ -113,7 +113,8 @@ (if-empty (,(ret)) (,(jmp ,0))) - ,(\skip)) + ,(\skip) + drop) (macro execute (stack<=! 1) @@ -529,8 +530,51 @@ (macro max 2dup < if swap then drop swap) - (macro unless - 0 = if) + ;; Syntax + + (macro if + 0 = ; booleanize and negate the condition + 1 stack=! ; force calling convention + gen-label dup ->synstack <if> ; generate the label + ?jump) ; jump as necessary + (macro else + <if> annihilate ; check context + 0 stack=! ; force calling convention + gen-label dup ->synstack + jump + <-synstack <-synstack swap ->synstack <if> ; fetch the else-label + stick-label) + (macro then + <if> annihilate ; check context + 0 stack=! ; force calling convention + <-synstack + stick-label) + + (macro begin + 0 stack=! gen-label dup ->synstack stick-label <begin>) + (macro until + 0 = ; booleanize and negate the condition + 1 stack=! ; force calling convention + <begin> annihilate ; check context + <-synstack ?jump) ; jump + (macro while + 0 = ; booleanize and negate the condition + 1 stack=! ; force calling convention + <begin> annihilate ; check context + gen-label dup ->synstack ; generate exit label + ?jump ; jump + <while>) ; establish new context + (macro repeat + 0 stack=! <while> annihilate + <-synstack ; exit label + <-synstack ; start label + jump + stick-label) + + (macro fra + gen-label dup ->synstack <fra>) + (macro here + <fra> annihilate <-synstack stick-label) ;; Memory calculations Index: wisptyp.wrti =================================================================== RCS file: /cvsroot/wisp/wisp/modules/wisptyp.wrti,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- wisptyp.wrti 18 Sep 2002 21:15:13 -0000 1.18 +++ wisptyp.wrti 26 Sep 2002 18:21:38 -0000 1.19 @@ -147,10 +147,10 @@ ,(\skip)) (macro <: - (fra)) + fra) (macro :> - (here) (believe %eax)) + here (believe %eax)) (extern N_signal_argcount) |