1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-07-22 11:29:18 +00:00

Error on local constants

This commit is contained in:
dschmenk 2023-02-25 19:21:36 -08:00
parent cdb734d1ba
commit 9125b7bfd4
2 changed files with 3 additions and 0 deletions

View File

@ -1361,6 +1361,8 @@ int parse_vars(int type, int ignore_vars)
emit_sysflags(value);
break;
case CONST_TOKEN:
if (type & LOCAL_TYPE)
parse_error("Cannot define local constant");
if (scan() != ID_TOKEN)
parse_error("Missing variable");
idstr = tokenstr;

View File

@ -1076,6 +1076,7 @@ def parse_vars(type, ignore_vars)
modsysflags, drop, drop = parse_constexpr
break
is CONST_TKN
if type & LOCAL_TYPE; exit_err(ERR_INVAL|ERR_GLOBAL|ERR_INIT); fin
if scan <> ID_TKN; exit_err(ERR_INVAL|ERR_CONST); fin
idptr = tknptr
idlen = tknlen