Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
DW0RKiN committed Jun 30, 2022
1 parent 38466a7 commit 081ed0e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
11 changes: 7 additions & 4 deletions M4/if.m4
Expand Up @@ -19,10 +19,13 @@ else{}ELSE_STACK:popdef({ELSE_STACK}){}dnl
})dnl
dnl
dnl
define({THEN},{
ifelse(ELSE_STACK, THEN_STACK,{else{}ELSE_STACK EQU $ ; = endif
popdef({ELSE_STACK})})endif{}THEN_STACK:dnl
popdef({THEN_STACK})}){}dnl
define({THEN},{dnl
__{}ifelse(ELSE_STACK, THEN_STACK,{
__{}__{}else{}ELSE_STACK EQU $ ; = endif{}popdef({ELSE_STACK})}){}dnl
__{}ifelse(THEN_STACK,{THEN_STACK},{
__{}__{}.error {THEN for non-existent IF}},
__{}{
__{}__{}endif{}THEN_STACK:{}popdef({THEN_STACK})})}){}dnl
dnl
dnl
dnl 0= if
Expand Down
22 changes: 14 additions & 8 deletions M4/loop/begin.m4
Expand Up @@ -35,20 +35,26 @@ define({DUP_WHILE},{
dnl
dnl
dnl ( -- )
define({BREAK},{
jp break{}BEGIN_STACK ; 3:10 break BEGIN_STACK})dnl
define({BREAK},{ifelse(BEGIN_STACK,{BEGIN_STACK},{
__{}__{}.error {REPEAT for non-existent BEGIN}},
__{}{
__{}__{} jp break{}BEGIN_STACK ; 3:10 break BEGIN_STACK})})dnl
dnl
dnl
dnl ( -- )
define({REPEAT},{
jp begin{}BEGIN_STACK ; 3:10 repeat BEGIN_STACK
break{}BEGIN_STACK: ; repeat BEGIN_STACK{}popdef({BEGIN_STACK})})dnl
define({REPEAT},{ifelse(BEGIN_STACK,{BEGIN_STACK},{
__{}__{}.error {REPEAT for non-existent BEGIN}},
__{}{
__{}__{} jp begin{}BEGIN_STACK ; 3:10 repeat BEGIN_STACK
__{}__{}break{}BEGIN_STACK: ; repeat BEGIN_STACK{}popdef({BEGIN_STACK})})}){}dnl
dnl
dnl
dnl ( -- )
define({AGAIN},{
jp begin{}BEGIN_STACK ; 3:10 again BEGIN_STACK
break{}BEGIN_STACK: ; again BEGIN_STACK{}popdef({BEGIN_STACK})})dnl
define({AGAIN},{ifelse(BEGIN_STACK,{BEGIN_STACK},{
__{}__{}.error {REPEAT for non-existent BEGIN}},
__{}{
__{}__{} jp begin{}BEGIN_STACK ; 3:10 again BEGIN_STACK
__{}__{}break{}BEGIN_STACK: ; again BEGIN_STACK{}popdef({BEGIN_STACK})})}){}dnl
dnl
dnl
dnl ( flag -- )
Expand Down

0 comments on commit 081ed0e

Please sign in to comment.