implement source ID, better error handling in nested input
This commit is contained in:
+3
-2
@@ -7,8 +7,8 @@
|
||||
#ifndef FORTH_FH_CONFIG_H
|
||||
#define FORTH_FH_CONFIG_H
|
||||
|
||||
#define DATA_STACK_DEPTH 256
|
||||
#define RETURN_STACK_DEPTH 256
|
||||
#define DATA_STACK_DEPTH 16
|
||||
#define RETURN_STACK_DEPTH 16
|
||||
#define MAX_NAME_LEN 32
|
||||
#define HEAP_SIZE (1024*1024)
|
||||
#define MAXLINE 65535
|
||||
@@ -33,6 +33,7 @@
|
||||
#define MAGICADDR_INPTR 0xFFFFF175ULL
|
||||
#define MAGICADDR_UNRESOLVED 0xFFFFFBADULL
|
||||
#define MAGICADDR_ENDCASE_UNRESOLVED 0xFFFC5BADULL
|
||||
#define MAGICADDR_SOURCEID 0xFFFF5C1DULL
|
||||
|
||||
#define FH_PROMPT_STR "> "
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ enum fh_error {
|
||||
FH_ERR_NOT_APPLICABLE,
|
||||
FH_ERR_PICTNUM_FULL,
|
||||
FH_ERR_BAD_DEFER,
|
||||
FH_ERR_ABORT, // technical error used to abort from nested input source
|
||||
FH_ERR_MAX,
|
||||
};
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ struct fh_input_spec_s {
|
||||
fh_input_error_method_t save_input;
|
||||
fh_input_error_method_t restore_input;
|
||||
uint32_t linenum;
|
||||
int32_t source_id;
|
||||
char *cwd; // CWD of the input, used for relative includes. malloc'd (strdup)
|
||||
|
||||
// saved values, filled when pushing
|
||||
|
||||
Reference in New Issue
Block a user