reverted system type changes, added warning for absent else in case, -- noch

Former-commit-id: 929f688a9e
This commit is contained in:
norayr 2015-03-19 15:33:10 +04:00
parent b0b0a3b546
commit a1eff0b339
9 changed files with 410 additions and 304 deletions

View file

@ -29,16 +29,19 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *)
(* Structure forms *)
Undef = 0; Byte = 1; Bool = 2; Char = 3;
SInt = 4; Int = 5; LInt = 6;
Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12;
Pointer = 13; ProcTyp = 14;
Comp = 15;
(*Int8 = 7; Int16 = 8; Int32 = 9; Int64 = 10;
Real = 11; LReal = 12; Set = 13; String = 14; NilTyp = 15; NoTyp = 16;
Pointer = 17; ProcTyp = 18;
Comp = 19;*)
Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12;
(*Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12;
Pointer = 13; ProcTyp = 14;
Int8 = 16; Int16 = 17; Int32 = 18; Int64 = 19;
Comp = (*15*)20;
Int8 = 15; Int16 = 16; Int32 = 17; Int64 = 18;
Comp = (*15*)19;*)
intSet = {SInt..LInt, Int8..Int64};
intSet = {SInt..LInt(*, Int8..Int64*)};
(* composite structure forms *)
Basic = 1; Array = 2; DynArr = 3; Record = 4;
@ -289,7 +292,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *)
OPS.Get(sym); resTyp := OPT.undftyp;
IF sym = ident THEN qualident(res);
IF res^.mode = Typ THEN
IF (res^.typ^.form < Comp) OR (res^.typ^.form >= Int8) & (res^.typ^.form <= Int64) THEN resTyp := res^.typ;
IF (res^.typ^.form < Comp) (*OR (res^.typ^.form >= Int8) & (res^.typ^.form <= Int64)*) THEN resTyp := res^.typ;
ELSE err(54)
END
ELSE err(52)
@ -487,6 +490,8 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *)
| integer: x := OPB.NewIntConst(OPS.intval)
| real: x := OPB.NewRealConst(OPS.realval, OPT.realtyp)
| longreal: x := OPB.NewRealConst(OPS.lrlval, OPT.lrltyp)
ELSE
OPM.LogWStr("unhandled case in OPP.Factor, OPS.numtyp = "); OPM.LogWNum(OPS.numtyp, 0); OPM.LogWLn;
END ;
OPS.Get(sym)
ELSIF sym = string THEN
@ -779,7 +784,11 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *)
ELSE low := 1; high := 0
END ;
e := sym = else;
IF e THEN OPS.Get(sym); StatSeq(y) ELSE y := NIL END ;
IF e THEN OPS.Get(sym); StatSeq(y)
ELSE
y := NIL;
OPM.Mark(-307, OPM.curpos); (* notice about no else symbol; -- noch *)
END ;
OPB.Construct(Ncaselse, cases, y); OPB.Construct(Ncase, x, cases);
cases^.conval := OPT.NewConst();
cases^.conval^.intval := low; cases^.conval^.intval2 := high;