More record support/work/fixes
This commit is contained in:
parent
3b175bc692
commit
f8b8244ab1
|
@ -1287,6 +1287,9 @@ Begin
|
||||||
|
|
||||||
VarNum := FindVariable(IdentStr);
|
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, '');
|
If VarData[VarNum]^.vType <> iFile Then Error (mpsTypeMismatch, '');
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
@ -1304,6 +1307,10 @@ Begin
|
||||||
Error (mpsTypeMismatch, '');
|
Error (mpsTypeMismatch, '');
|
||||||
|
|
||||||
OutWord (VarData[VarNum]^.VarID);
|
OutWord (VarData[VarNum]^.VarID);
|
||||||
|
|
||||||
|
ParseArray (VarNum, True);
|
||||||
|
ParseElement (VarNum, False, iLongInt);
|
||||||
|
// added array and element 1.10a14 for onecard := deck[1] problem
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure TParserEngine.NewBooleanCrap;
|
Procedure TParserEngine.NewBooleanCrap;
|
||||||
|
@ -2248,6 +2255,7 @@ Var
|
||||||
VarNum : LongInt;
|
VarNum : LongInt;
|
||||||
SavedPos : LongInt;
|
SavedPos : LongInt;
|
||||||
Count : LongInt;
|
Count : LongInt;
|
||||||
|
TargetType : TIdentTypes;
|
||||||
Begin
|
Begin
|
||||||
OutString(Char(opCase));
|
OutString(Char(opCase));
|
||||||
|
|
||||||
|
@ -2270,7 +2278,32 @@ Begin
|
||||||
Exit;
|
Exit;
|
||||||
End;
|
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
|
If VarData[VarNum]^.vType = iString Then
|
||||||
ParseVarString
|
ParseVarString
|
||||||
|
@ -2283,8 +2316,12 @@ Begin
|
||||||
Else
|
Else
|
||||||
If VarData[VarNum]^.vType in vNums Then
|
If VarData[VarNum]^.vType in vNums Then
|
||||||
ParseVarNumber(True)
|
ParseVarNumber(True)
|
||||||
|
Else
|
||||||
|
If VarData[VarNum]^.vType = iRecord Then
|
||||||
|
ParseVarRecord
|
||||||
Else
|
Else
|
||||||
Error (mpsTypeMismatch, '');
|
Error (mpsTypeMismatch, '');
|
||||||
|
*)
|
||||||
|
|
||||||
Case tkwType of
|
Case tkwType of
|
||||||
1 : GetStr (tkw[wCaseOf], True, False);
|
1 : GetStr (tkw[wCaseOf], True, False);
|
||||||
|
@ -2299,7 +2336,7 @@ Begin
|
||||||
NextChar;
|
NextChar;
|
||||||
PrevChar;
|
PrevChar;
|
||||||
|
|
||||||
Case VarData[VarNum]^.vType of
|
Case TargetType of
|
||||||
iChar,
|
iChar,
|
||||||
iString: Repeat
|
iString: Repeat
|
||||||
ParseVarString;
|
ParseVarString;
|
||||||
|
|
|
@ -931,6 +931,9 @@ Var
|
||||||
Target : Byte;
|
Target : Byte;
|
||||||
TempStr : String;
|
TempStr : String;
|
||||||
RecID : Word;
|
RecID : Word;
|
||||||
|
|
||||||
|
AD : TArrayInfo;
|
||||||
|
RI : TRecInfo;
|
||||||
Begin
|
Begin
|
||||||
CheckArray (VarNum, ArrayData, RecInfo);
|
CheckArray (VarNum, ArrayData, RecInfo);
|
||||||
|
|
||||||
|
@ -964,7 +967,17 @@ Begin
|
||||||
|
|
||||||
RecID := FindVariable(W);
|
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;
|
End;
|
||||||
End;
|
End;
|
||||||
|
@ -1250,6 +1263,8 @@ Begin
|
||||||
Param[Count].vID := FindVariable(W);
|
Param[Count].vID := FindVariable(W);
|
||||||
Param[Count].vSize := VarData[Param[Count].vID]^.DataSize;
|
Param[Count].vSize := VarData[Param[Count].vID]^.DataSize;
|
||||||
Param[Count].vData := VarData[Param[Count].vID]^.Data;
|
Param[Count].vData := VarData[Param[Count].vID]^.Data;
|
||||||
|
//parsesometrihng
|
||||||
|
CheckArray (Param[Count].vID, ArrayData, RecInfo);
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
|
Loading…
Reference in New Issue