fix: qdup/tuck/2swap bugs, getline, and cached word pointers
Co-authored-by: aider (openrouter/moonshotai/kimi-k2.6) <aider@aider.chat>
This commit is contained in:
@@ -7,10 +7,14 @@
|
||||
#include <ctype.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
// Configuration (all hard limits removed)
|
||||
#define MAX_NAME_LEN 31
|
||||
|
||||
#define F_IMMEDIATE (1 << 7)
|
||||
#define F_HIDDEN (1 << 6)
|
||||
|
||||
// Core types
|
||||
typedef struct Word Word;
|
||||
typedef union Cell {
|
||||
@@ -45,7 +49,8 @@ extern int32_t compile_idx;
|
||||
extern int32_t compile_cap;
|
||||
extern char compiling_name[MAX_NAME_LEN + 1];
|
||||
|
||||
extern char input_buf[1024]; // fixed for line input
|
||||
extern char* input_buf; // line buffer (dynamic, managed by getline)
|
||||
extern size_t input_buf_cap;
|
||||
extern char* input_ptr;
|
||||
|
||||
extern int64_t *compile_stack; // holds indices into compile_buf
|
||||
@@ -56,6 +61,14 @@ extern Cell *user_mem;
|
||||
extern int64_t user_mem_size; // in cells
|
||||
extern Cell* here;
|
||||
|
||||
// Pointers to critical hidden/primitive words (set during init)
|
||||
extern Word* w_exit;
|
||||
extern Word* w_docolon;
|
||||
extern Word* w_lit;
|
||||
extern Word* w_branch;
|
||||
extern Word* w_zbranch;
|
||||
extern Word* w_dot_quote_inner;
|
||||
|
||||
// Core function prototypes
|
||||
void data_push(int64_t val);
|
||||
int64_t data_pop(void);
|
||||
|
||||
Reference in New Issue
Block a user