1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-08-09 16:25:01 +00:00
This commit is contained in:
dschmenk
2016-11-28 10:39:56 -08:00
3 changed files with 13 additions and 9 deletions

Binary file not shown.

View File

@@ -638,13 +638,19 @@ int parse_value(int rvalue)
ref_type = (scantoken == PTRB_TOKEN) ? BPTR_TYPE : WPTR_TYPE; ref_type = (scantoken == PTRB_TOKEN) ? BPTR_TYPE : WPTR_TYPE;
if (!parse_const(&ref_offset)) if (!parse_const(&ref_offset))
scan_rewind(tokenstr); scan_rewind(tokenstr);
if (ref_offset != 0)
{
emit_const(ref_offset);
emit_op(ADD_TOKEN);
ref_offset = 0;
}
break; break;
case DOT_TOKEN: case DOT_TOKEN:
case COLON_TOKEN: case COLON_TOKEN:
/* /*
* Structure member offset * Structure member offset
*/ */
ref_type = (ref_type & (VAR_TYPE | CONST_TYPE)) ref_type = (ref_type & (VAR_TYPE | CONST_TYPE))
? ((scantoken == DOT_TOKEN) ? BYTE_TYPE : WORD_TYPE) ? ((scantoken == DOT_TOKEN) ? BYTE_TYPE : WORD_TYPE)
: ((scantoken == DOT_TOKEN) ? BPTR_TYPE : WPTR_TYPE); : ((scantoken == DOT_TOKEN) ? BPTR_TYPE : WPTR_TYPE);
if (parse_const(&const_offset)) if (parse_const(&const_offset))
@@ -990,7 +996,7 @@ int parse_stmnt(void)
return (0); return (0);
} }
} }
else if (scantoken == EOL_TOKEN) else if (scantoken == EOL_TOKEN)
{ {
next_line(); next_line();
} }
@@ -1087,7 +1093,7 @@ int parse_stmnt(void)
} }
if (type & LOCAL_TYPE) if (type & LOCAL_TYPE)
(elem_type & BYTE_TYPE) ? emit_slb(addr + elem_offset) : emit_slw(addr + elem_offset); (elem_type & BYTE_TYPE) ? emit_slb(addr + elem_offset) : emit_slw(addr + elem_offset);
else else
(elem_type & BYTE_TYPE) ? emit_sab(addr, elem_offset, type) : emit_saw(addr, elem_offset, type); (elem_type & BYTE_TYPE) ? emit_sab(addr, elem_offset, type) : emit_saw(addr, elem_offset, type);
break; break;
} }
@@ -1116,7 +1122,7 @@ int parse_stmnt(void)
} }
} }
break; break;
} }
} }
else if (type & FUNC_TYPE) else if (type & FUNC_TYPE)
{ {
@@ -1189,7 +1195,7 @@ int parse_var(int type)
long constval; long constval;
int consttype, constsize, arraysize, idlen = 0; int consttype, constsize, arraysize, idlen = 0;
long size = 1; long size = 1;
if (scan() == OPEN_BRACKET_TOKEN) if (scan() == OPEN_BRACKET_TOKEN)
{ {
size = 0; size = 0;
@@ -1303,7 +1309,7 @@ int parse_struc(void)
return (0); return (0);
} }
scan(); scan();
} }
} }
if (type & WORD_TYPE) if (type & WORD_TYPE)
size *= 2; size *= 2;
@@ -1323,7 +1329,7 @@ int parse_vars(int type)
long value; long value;
int idlen, size; int idlen, size;
char *idstr; char *idstr;
switch (scantoken) switch (scantoken)
{ {
case SYSFLAGS_TOKEN: case SYSFLAGS_TOKEN:

View File

@@ -3290,8 +3290,6 @@ def parse_value(rvalue)
emit_op($02) emit_op($02)
ref_offset = 0 ref_offset = 0
fin fin
if ref_type & BPTR_TYPE; emit_lb
elsif ref_type & WPTR_TYPE; emit_lw; fin
fin fin
while parse_expr while parse_expr
if token <> COMMA_TKN if token <> COMMA_TKN