Compiler errors

This commit is contained in:
Michael Schimmel
2025-11-25 18:11:04 +01:00
parent 0a1df4e9fe
commit 85ef043b04
5 changed files with 464 additions and 103 deletions
+20 -1
View File
@@ -245,7 +245,7 @@ begin
begin
var layout: IScopeLayout;
// Bind now returns the bound AST and provides the layout
Result := FEnvironment.Environment.Bind(Result, layout);
Result := FEnvironment.Environment.Bind(Result, layout, [], nil);
if CompilerStageBox.ItemIndex > 2 then
// Specialize no longer needs descriptor
@@ -286,6 +286,25 @@ begin
Result := FCurrExec.Func([]);
except
on E: ECompilationFailed do
begin
Memo1.Lines.BeginUpdate;
try
Memo1.Lines.Clear;
// Die Hauptnachricht der Exception (z.B. "Compilation failed with 5 error(s)...")
Memo1.Lines.Add(E.Message);
Memo1.Lines.Add(''); // Leerzeile zur optischen Trennung
// Iteration durch alle gesammelten Fehler im Log
for var err in E.Errors do
begin
// err.ToString formatiert automatisch als "[Error] Nachricht" etc.
Memo1.Lines.Add(err.ToString);
end;
finally
Memo1.Lines.EndUpdate;
end;
end;
on E: Exception do
begin
FCurrExec.Func := nil;