1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-04-09 01:37:17 +00:00

Allow CONST/PREDEF before IMPORT

This commit is contained in:
David Schmenk 2018-03-16 07:39:42 -07:00
parent d485654d0e
commit d165509293
3 changed files with 15 additions and 1 deletions

View File

@ -6,6 +6,8 @@
#define RVALUE 1
#define MAX_LAMBDA 64
int parse_mods(void);
int infunc = 0, break_tag = 0, cont_tag = 0, stack_loop = 0, infor = 0;
long infuncvals = 0;
t_token prevstmnt;
@ -1329,7 +1331,7 @@ int parse_struc(void)
int parse_vars(int type)
{
long value;
int idlen, size, cfnparms;
int idlen, size, cfnparms, emit = 0;
long cfnvals;
char *idstr;
@ -1392,6 +1394,7 @@ int parse_vars(int type)
if (type & WORD_TYPE)
cfnvals *= 2;
do parse_var(type, cfnvals); while (scantoken == COMMA_TOKEN);
emit = type == GLOBAL_TYPE;
break;
case PREDEF_TOKEN:
/*
@ -1432,6 +1435,12 @@ int parse_vars(int type)
else
parse_error("Bad function pre-declaration");
} while (scantoken == COMMA_TOKEN);
break;
case IMPORT_TOKEN:
if (emit || type != GLOBAL_TYPE)
parse_error("IMPORT after emitting data");
parse_mods();
break;
case EOL_TOKEN:
break;
default:

View File

@ -1124,6 +1124,10 @@ def parse_vars(type)
fin
until token <> COMMA_TKN
break
is IMPORT_TKN
if codeptr <> codebuff or type <> GLOBAL_TYPE; exit_err(ERR_INVAL|ERR_INIT); fin
parse_mods
break
is EOL_TKN
break
otherwise

View File

@ -251,6 +251,7 @@ word codebuff, codeptr, entrypoint
word modsysflags
byte[16] moddep_tbl[MODDEPNUM]
byte moddep_cnt, def_cnt = 1
predef parse_mods
predef emit_pending_seq#0
//
// Module relocation base address