More record support/work/fixes
This commit is contained in:
parent
3b175bc692
commit
f8b8244ab1
|
@ -1287,6 +1287,9 @@ Begin
|
|||
|
||||
VarNum := FindVariable(IdentStr);
|
||||
|
||||
// need to create a file type parser in execute
|
||||
// so we can output the record size and support "file of records"
|
||||
|
||||
If VarData[VarNum]^.vType <> iFile Then Error (mpsTypeMismatch, '');
|
||||
End;
|
||||
|
||||
|
@ -1304,6 +1307,10 @@ Begin
|
|||
Error (mpsTypeMismatch, '');
|
||||
|
||||
OutWord (VarData[VarNum]^.VarID);
|
||||
|
||||
ParseArray (VarNum, True);
|
||||
ParseElement (VarNum, False, iLongInt);
|
||||
// added array and element 1.10a14 for onecard := deck[1] problem
|
||||
End;
|
||||
|
||||
Procedure TParserEngine.NewBooleanCrap;
|
||||
|
@ -2245,9 +2252,10 @@ End;
|
|||
|
||||
Procedure TParserEngine.StatementCase;
|
||||
Var
|
||||
VarNum : LongInt;
|
||||
SavedPos : LongInt;
|
||||
Count : LongInt;
|
||||
VarNum : LongInt;
|
||||
SavedPos : LongInt;
|
||||
Count : LongInt;
|
||||
TargetType : TIdentTypes;
|
||||
Begin
|
||||
OutString(Char(opCase));
|
||||
|
||||
|
@ -2270,7 +2278,32 @@ Begin
|
|||
Exit;
|
||||
End;
|
||||
|
||||
OutString(Char(Byte(VarData[VarNum]^.vType)));
|
||||
TargetType := VarData[VarNum]^.vType;
|
||||
|
||||
If TargetType = iRecord Then
|
||||
TargetType := ParseElementType(VarNum, True);
|
||||
|
||||
OutString(Char(Byte(TargetType)));
|
||||
//asf
|
||||
//asdf
|
||||
|
||||
Case TargetType of
|
||||
iString : ParseVarString;
|
||||
iChar : ParseVarChar;
|
||||
iBool : ParseVarBoolean;
|
||||
iByte,
|
||||
iShort,
|
||||
iWord,
|
||||
iInteger,
|
||||
iLongInt,
|
||||
iCardinal,
|
||||
iReal : ParseVarNumber(True);
|
||||
Else
|
||||
Error (mpsTypeMismatch, '');
|
||||
End;
|
||||
|
||||
|
||||
(*
|
||||
|
||||
If VarData[VarNum]^.vType = iString Then
|
||||
ParseVarString
|
||||
|
@ -2283,8 +2316,12 @@ Begin
|
|||
Else
|
||||
If VarData[VarNum]^.vType in vNums Then
|
||||
ParseVarNumber(True)
|
||||
Else
|
||||
If VarData[VarNum]^.vType = iRecord Then
|
||||
ParseVarRecord
|
||||
Else
|
||||
Error (mpsTypeMismatch, '');
|
||||
*)
|
||||
|
||||
Case tkwType of
|
||||
1 : GetStr (tkw[wCaseOf], True, False);
|
||||
|
@ -2299,7 +2336,7 @@ Begin
|
|||
NextChar;
|
||||
PrevChar;
|
||||
|
||||
Case VarData[VarNum]^.vType of
|
||||
Case TargetType of
|
||||
iChar,
|
||||
iString: Repeat
|
||||
ParseVarString;
|
||||
|
|
|
@ -931,6 +931,9 @@ Var
|
|||
Target : Byte;
|
||||
TempStr : String;
|
||||
RecID : Word;
|
||||
|
||||
AD : TArrayInfo;
|
||||
RI : TRecInfo;
|
||||
Begin
|
||||
CheckArray (VarNum, ArrayData, RecInfo);
|
||||
|
||||
|
@ -964,7 +967,17 @@ Begin
|
|||
|
||||
RecID := FindVariable(W);
|
||||
|
||||
Move (VarData[RecID]^.Data^, GetDataPtr(VarNum, ArrayData, RecInfo)^, VarData[RecID]^.DataSize);
|
||||
CheckArray (RecID, AD, RI);
|
||||
//asdf DEBUG DEBUG
|
||||
// how do we get the real size of the shit here?
|
||||
// i added Checkarray here and ParseElement in ParseVarRecord for compiler
|
||||
//session.io.outfullln('datasize=' + stri2s(vardata[recid]^.datasize));
|
||||
//session.io.outfullln('varsize=' + stri2s(vardata[recid]^.varsize));
|
||||
//session.io.outfullln('|PN');
|
||||
|
||||
Move (GetDataPtr(RecID, AD, RI)^, GetDataPtr(VarNum, ArrayData, RecInfo)^, RecInfo.OneSize {VarData[RecID]^.VarSize});
|
||||
|
||||
// Move (VarData[RecID]^.Data^, GetDataPtr(VarNum, ArrayData, RecInfo)^, VarData[RecID]^.DataSize);
|
||||
End;
|
||||
End;
|
||||
End;
|
||||
|
@ -1250,6 +1263,8 @@ Begin
|
|||
Param[Count].vID := FindVariable(W);
|
||||
Param[Count].vSize := VarData[Param[Count].vID]^.DataSize;
|
||||
Param[Count].vData := VarData[Param[Count].vID]^.Data;
|
||||
//parsesometrihng
|
||||
CheckArray (Param[Count].vID, ArrayData, RecInfo);
|
||||
End;
|
||||
End;
|
||||
End;
|
||||
|
|
Loading…
Reference in New Issue