mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-24 18:22:25 -05:00
Added operator support for arrays: "=", "<>", "+". Still in test phase, still needs support for static arrays.
This commit is contained in:
parent
8cf4c7adbb
commit
cd8d3a7a84
@ -616,7 +616,8 @@ begin
|
|||||||
ScriptErrorLine:= -1;
|
ScriptErrorLine:= -1;
|
||||||
OwnerSheet.Caption:= ScriptName;
|
OwnerSheet.Caption:= ScriptName;
|
||||||
SynEdit.Highlighter := SimbaForm.CurrHighlighter;
|
SynEdit.Highlighter := SimbaForm.CurrHighlighter;
|
||||||
SynEdit.Options:= SynEdit.Options + [eoTabIndent] - [eoSmartTabs];
|
SynEdit.Options := SynEdit.Options + [eoTabIndent, eoKeepCaretX, eoDragDropEditing] - [eoSmartTabs];
|
||||||
|
SynEdit.Options2 := SynEdit.Options2 + [eoCaretSkipsSelection];
|
||||||
SynEdit.IncrementColor.Background := $30D070;
|
SynEdit.IncrementColor.Background := $30D070;
|
||||||
SynEdit.HighlightAllColor.Background:= clYellow;
|
SynEdit.HighlightAllColor.Background:= clYellow;
|
||||||
SynEdit.HighlightAllColor.Foreground:= clDefault;
|
SynEdit.HighlightAllColor.Foreground:= clDefault;
|
||||||
@ -638,7 +639,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
AddKey(SynEdit,ecCodeCompletion,VK_SPACE,[ssCtrl]);
|
AddKey(SynEdit,ecCodeCompletion,VK_SPACE,[ssCtrl]);
|
||||||
AddKey(SynEdit,ecCodeHints,VK_SPACE,[ssCtrl,ssShift]);
|
AddKey(SynEdit,ecCodeHints,VK_SPACE,[ssCtrl,ssShift]);
|
||||||
// TSynPasSyn(SynEdit.Highlighter).NestedComments:= false; Does not work :(
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
@ -8194,6 +8194,10 @@ function TPSPascalCompiler.ProcessSub(BlockInfo: TPSBlockInfo): Boolean;
|
|||||||
((t2.BaseType = btString) or (t2.BaseType = btChar) or (t2.BaseType = btPchar) or (t2.BaseType = btWideString) or (t2.BaseType = btWideChar) or (t2.BaseType = btUnicodeString)) then
|
((t2.BaseType = btString) or (t2.BaseType = btChar) or (t2.BaseType = btPchar) or (t2.BaseType = btWideString) or (t2.BaseType = btWideChar) or (t2.BaseType = btUnicodeString)) then
|
||||||
Result := at2ut(FindBaseType(btWideString))
|
Result := at2ut(FindBaseType(btWideString))
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
else if (t1.BaseType = btArray) and (t1 = t2) then
|
||||||
|
Result := t1
|
||||||
|
|
||||||
else
|
else
|
||||||
Result := nil;
|
Result := nil;
|
||||||
end;
|
end;
|
||||||
|
@ -5065,7 +5065,18 @@ begin
|
|||||||
Set_Equal(var1, var2, TPSTypeRec_Record(var1Type).RealSize, b);
|
Set_Equal(var1, var2, TPSTypeRec_Record(var1Type).RealSize, b);
|
||||||
b := not b;
|
b := not b;
|
||||||
end else result := False;
|
end else result := False;
|
||||||
end
|
end;
|
||||||
|
btArray:
|
||||||
|
begin
|
||||||
|
if (var1Type = var2Type) or ((var2Type.BaseType = btArray) and (TPSTypeRec_Array(var1Type).FArrayType = TPSTypeRec_Array(var2Type).FArrayType)) then
|
||||||
|
begin
|
||||||
|
if (PSDynArrayGetLength(Pointer(var1^), var1Type) <> PSDynArrayGetLength(Pointer(var2^), var2Type)) then
|
||||||
|
b := False
|
||||||
|
else
|
||||||
|
Set_Equal(Pointer(var1^), Pointer(var2^), PSDynArrayGetLength(Pointer(var1^), var1Type) * TPSTypeRec_Array(var1Type).FArrayType.RealSize, b);
|
||||||
|
b := not b;
|
||||||
|
end else result := False;
|
||||||
|
end;
|
||||||
|
|
||||||
else begin
|
else begin
|
||||||
CMD_Err(erTypeMismatch);
|
CMD_Err(erTypeMismatch);
|
||||||
@ -5173,7 +5184,18 @@ begin
|
|||||||
begin
|
begin
|
||||||
Set_Equal(var1, var2, TPSTypeRec_Record(var1Type).RealSize, b);
|
Set_Equal(var1, var2, TPSTypeRec_Record(var1Type).RealSize, b);
|
||||||
end else result := False;
|
end else result := False;
|
||||||
end
|
end;
|
||||||
|
btArray:
|
||||||
|
begin
|
||||||
|
if (var1Type = var2Type) or ((var2Type.BaseType = btArray) and (TPSTypeRec_Array(var1Type).FArrayType = TPSTypeRec_Array(var2Type).FArrayType)) then
|
||||||
|
begin
|
||||||
|
if (PSDynArrayGetLength(Pointer(var1^), var1Type) <> PSDynArrayGetLength(Pointer(var2^), var2Type)) then
|
||||||
|
b := False
|
||||||
|
else
|
||||||
|
Set_Equal(Pointer(var1^), Pointer(var2^), PSDynArrayGetLength(Pointer(var1^), var1Type) * TPSTypeRec_Array(var1Type).FArrayType.RealSize, b);
|
||||||
|
end else result := False;
|
||||||
|
end;
|
||||||
|
|
||||||
else begin
|
else begin
|
||||||
CMD_Err(erTypeMismatch);
|
CMD_Err(erTypeMismatch);
|
||||||
exit;
|
exit;
|
||||||
@ -5480,6 +5502,16 @@ begin
|
|||||||
end else result := False;
|
end else result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
btArray:
|
||||||
|
begin
|
||||||
|
if (var1Type = var2Type) or ((var2Type.BaseType = btArray) and (TPSTypeRec_Array(var1Type).FArrayType = TPSTypeRec_Array(var2Type).FArrayType)) then
|
||||||
|
begin
|
||||||
|
tvar := PSDynArrayGetLength(Pointer(var1^), var1Type);
|
||||||
|
PSDynArraySetLength(Pointer(var1^), var1Type, tvar + PSDynArrayGetLength(Pointer(var2^), var2Type));
|
||||||
|
CopyArrayContents(Pointer(PtrInt(var1^) + Integer(tvar) * TPSTypeRec_Array(var1Type).ArrayType.RealSize), Pointer(var2^), PSDynArrayGetLength(Pointer(var2^), var2Type), TPSTypeRec_Array(var1Type).ArrayType);
|
||||||
|
end else result := False;
|
||||||
|
end;
|
||||||
|
|
||||||
else begin
|
else begin
|
||||||
CMD_Err(erTypeMismatch);
|
CMD_Err(erTypeMismatch);
|
||||||
exit;
|
exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user