aboutsummaryrefslogtreecommitdiffstats
path: root/forthmachine.h
diff options
context:
space:
mode:
authordan <[email protected]>2023-06-03 18:25:58 -0400
committerdan <[email protected]>2023-06-03 18:25:58 -0400
commitf59e909a1adaf545dba4c77d83523eeb5063fbcb (patch)
tree0c3b1a133d9023c2e988afd79233e363f348859d /forthmachine.h
parentb528f7d498b301bcfbd42ea011ed31569f36b378 (diff)
downloadforth-f59e909a1adaf545dba4c77d83523eeb5063fbcb.tar.gz
forth-f59e909a1adaf545dba4c77d83523eeb5063fbcb.tar.bz2
forth-f59e909a1adaf545dba4c77d83523eeb5063fbcb.zip
feat: add do ... loop;
Diffstat (limited to 'forthmachine.h')
-rw-r--r--forthmachine.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/forthmachine.h b/forthmachine.h
index 4a55952..814e957 100644
--- a/forthmachine.h
+++ b/forthmachine.h
@@ -21,6 +21,7 @@ typedef enum {
compileditem_stackop = 0,
compileditem_literal = 1,
compileditem_ifcontrol = 2,
+ compileditem_doloopcontrol = 3,
} compileditem_type;
typedef struct {
@@ -31,6 +32,7 @@ typedef struct {
struct {
int jumpto;
};
+ int loopbackto;
};
} compileditem;
@@ -72,6 +74,7 @@ struct forthmachine {
stack* s;
char* outputbuffer;
errorhandler errorhandler;
+ stack* lcs;
};
#define MAX_OUTPUT_BUFFER_SIZE 1024