some more fixes
This commit is contained in:
parent
03c5092815
commit
0bffe65c24
7 changed files with 19 additions and 6 deletions
|
@ -239,6 +239,7 @@ enter.o: LLlex.h
|
||||||
enter.o: debug.h
|
enter.o: debug.h
|
||||||
enter.o: debugcst.h
|
enter.o: debugcst.h
|
||||||
enter.o: def.h
|
enter.o: def.h
|
||||||
|
enter.o: f_info.h
|
||||||
enter.o: idf.h
|
enter.o: idf.h
|
||||||
enter.o: main.h
|
enter.o: main.h
|
||||||
enter.o: misc.h
|
enter.o: misc.h
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
static char Version[] = "ACK Modula-2 compiler Version 0.12";
|
static char Version[] = "ACK Modula-2 compiler Version 0.13";
|
||||||
|
|
|
@ -132,7 +132,6 @@ CodeExpr(nd, ds, true_label, false_label)
|
||||||
ds->dsg_kind = DSG_LOADED;
|
ds->dsg_kind = DSG_LOADED;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Xset:
|
|
||||||
case Set: {
|
case Set: {
|
||||||
register unsigned i = (unsigned) (tp->tp_size) / (int) word_size;
|
register unsigned i = (unsigned) (tp->tp_size) / (int) word_size;
|
||||||
register arith *st = nd->nd_set + i;
|
register arith *st = nd->nd_set + i;
|
||||||
|
@ -397,8 +396,14 @@ CodeParameters(param, arg)
|
||||||
if (left->nd_symb == STRING) {
|
if (left->nd_symb == STRING) {
|
||||||
CodeString(left);
|
CodeString(left);
|
||||||
}
|
}
|
||||||
else if (left->nd_class == Call || left->nd_class == Value) {
|
else switch(left->nd_class) {
|
||||||
/* ouch! forgot about these ones! */
|
case Arrsel:
|
||||||
|
case Arrow:
|
||||||
|
case Def:
|
||||||
|
case LinkDef:
|
||||||
|
CodeDAddress(left);
|
||||||
|
break;
|
||||||
|
default:{
|
||||||
arith tmp, TmpSpace();
|
arith tmp, TmpSpace();
|
||||||
|
|
||||||
CodePExpr(left);
|
CodePExpr(left);
|
||||||
|
@ -406,8 +411,9 @@ CodeParameters(param, arg)
|
||||||
C_lal(tmp);
|
C_lal(tmp);
|
||||||
C_sti(WA(left->nd_type->tp_size));
|
C_sti(WA(left->nd_type->tp_size));
|
||||||
C_lal(tmp);
|
C_lal(tmp);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else CodeDAddress(left);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (IsVarParam(param)) {
|
if (IsVarParam(param)) {
|
||||||
|
|
|
@ -414,6 +414,7 @@ SetType(struct type **ptp;) :
|
||||||
type-identifiers
|
type-identifiers
|
||||||
*/
|
*/
|
||||||
PointerType(register struct type **ptp;) :
|
PointerType(register struct type **ptp;) :
|
||||||
|
{ *ptp = construct_type(T_POINTER, NULLTYPE); }
|
||||||
POINTER TO
|
POINTER TO
|
||||||
[ %if (type_or_forward(ptp))
|
[ %if (type_or_forward(ptp))
|
||||||
type(&((*ptp)->tp_next))
|
type(&((*ptp)->tp_next))
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "node.h"
|
#include "node.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "f_info.h"
|
||||||
|
|
||||||
struct def *
|
struct def *
|
||||||
Enter(name, kind, type, pnam)
|
Enter(name, kind, type, pnam)
|
||||||
|
@ -463,12 +464,16 @@ EnterImportList(Idlist, local)
|
||||||
register struct node *idlist = Idlist;
|
register struct node *idlist = Idlist;
|
||||||
struct scope *sc = enclosing(CurrVis)->sc_scope;
|
struct scope *sc = enclosing(CurrVis)->sc_scope;
|
||||||
extern struct def *GetDefinitionModule();
|
extern struct def *GetDefinitionModule();
|
||||||
|
struct f_info f;
|
||||||
|
|
||||||
|
f = file_info;
|
||||||
|
|
||||||
for (; idlist; idlist = idlist->nd_left) {
|
for (; idlist; idlist = idlist->nd_left) {
|
||||||
DoImport(local ?
|
DoImport(local ?
|
||||||
ForwDef(idlist, sc) :
|
ForwDef(idlist, sc) :
|
||||||
GetDefinitionModule(idlist->nd_IDF, 1) ,
|
GetDefinitionModule(idlist->nd_IDF, 1) ,
|
||||||
CurrentScope);
|
CurrentScope);
|
||||||
|
file_info = f;
|
||||||
}
|
}
|
||||||
FreeNode(Idlist);
|
FreeNode(Idlist);
|
||||||
}
|
}
|
||||||
|
|
|
@ -590,7 +590,6 @@ type_or_forward(ptp)
|
||||||
register struct node *nd;
|
register struct node *nd;
|
||||||
register struct def *df1;
|
register struct def *df1;
|
||||||
|
|
||||||
*ptp = construct_type(T_POINTER, NULLTYPE);
|
|
||||||
if ((df1 = lookup(dot.TOK_IDF, CurrentScope, 1))) {
|
if ((df1 = lookup(dot.TOK_IDF, CurrentScope, 1))) {
|
||||||
/* Either a Module or a Type, but in both cases defined
|
/* Either a Module or a Type, but in both cases defined
|
||||||
in this scope, so this is the correct identification
|
in this scope, so this is the correct identification
|
||||||
|
|
|
@ -574,6 +574,7 @@ node_error(right, "type incompatibility in RETURN statement");
|
||||||
CodePString(right, func_type);
|
CodePString(right, func_type);
|
||||||
}
|
}
|
||||||
else CodePExpr(right);
|
else CodePExpr(right);
|
||||||
|
RangeCheck(func_type, right->nd_type);
|
||||||
}
|
}
|
||||||
C_bra(RETURN_LABEL);
|
C_bra(RETURN_LABEL);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue