Skip to content

Commit 61b5161

Browse files
committed
Better error reporting and new color options
1 parent fac5e6a commit 61b5161

26 files changed

Lines changed: 1229 additions & 644 deletions

Rhodus_Version_3/RhodusVersionThreeProject.dpr

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ program RhodusVersionThreeProject;
3030

3131
uses
3232
{$IFDEF DEBUG}
33-
FastMM4 in '..\..\Library\FastMM\FastMM4.pas',
33+
//FastMM4 in '..\..\Library\FastMM\FastMM4.pas',
3434
{$ENDIF }
3535
Windows,
3636
ShellAPI,
@@ -39,6 +39,8 @@ uses
3939
Math,
4040
IOUtils,
4141
Classes,
42+
Vcl.GraphUtil,
43+
Vcl.Graphics,
4244
System.Types,
4345
System.Generics.Defaults,
4446
System.Generics.Collections,
@@ -80,7 +82,9 @@ uses
8082
uRhodusTypes in '..\VirtualMachine\uRhodusTypes.pas';
8183

8284
var sourceCode : string;
85+
fragment : string;
8386
runFramework : TRunFramework;
87+
color : TColor;
8488

8589

8690
function searchHelp (const helpStr : string) : string;
@@ -223,6 +227,7 @@ begin
223227

224228
try
225229
computeBaseLineMemoryAllocated;
230+
SetExtendedConsoleMode; // To get more colors
226231
displayWelcome;
227232
while True do
228233
begin
@@ -235,8 +240,28 @@ begin
235240
if runCommand (sourceCode) then
236241
continue;
237242

238-
runFramework.showAssembler := bolShowAssembler;
239-
runFramework.runCode (sourceCode, True);
243+
runFramework.showAssembler := bolShowAssembler;
244+
245+
if sourceCode = '#p' then
246+
begin
247+
writeln ('Type q or return to exit and run program');
248+
write ('... ');
249+
sourceCode := '';
250+
readln (fragment);
251+
while (fragment <> 'q') and (fragment <> '') do
252+
begin
253+
if sourceCode = '' then
254+
sourceCode := fragment
255+
else
256+
sourceCode := sourceCode + sLineBreak + fragment;
257+
write ('... ');
258+
readln (fragment)
259+
end;
260+
// writeln (sourceCode);
261+
runFramework.runCode (sourceCode, True);
262+
end
263+
else
264+
runFramework.runCode (sourceCode, True);
240265

241266
except
242267
on e:exception do

Rhodus_Version_3/RhodusVersionThreeProject.dproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<FrameworkType>None</FrameworkType>
66
<MainSource>RhodusVersionThreeProject.dpr</MainSource>
77
<Base>True</Base>
8-
<Config Condition="'$(Config)'==''">Release</Config>
8+
<Config Condition="'$(Config)'==''">Debug</Config>
99
<Platform Condition="'$(Platform)'==''">Win32</Platform>
1010
<TargetedPlatforms>3</TargetedPlatforms>
1111
<AppType>Console</AppType>
@@ -137,8 +137,8 @@
137137
<DCC_RangeChecking>true</DCC_RangeChecking>
138138
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
139139
<VerInfo_MajorVer>3</VerInfo_MajorVer>
140-
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=3.0.0.3;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
141-
<VerInfo_Build>3</VerInfo_Build>
140+
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=3.0.0.5;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
141+
<VerInfo_Build>5</VerInfo_Build>
142142
</PropertyGroup>
143143
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
144144
<DCC_MapFile>3</DCC_MapFile>
@@ -168,7 +168,6 @@
168168
<DelphiCompile Include="$(MainSource)">
169169
<MainSource>MainSource</MainSource>
170170
</DelphiCompile>
171-
<DCCReference Include="..\..\Library\FastMM\FastMM4.pas"/>
172171
<DCCReference Include="uScanner.pas"/>
173172
<DCCReference Include="..\..\Library\FastMM\FastMM4Messages.pas"/>
174173
<DCCReference Include="uFindWindows.pas"/>
-640 Bytes
Binary file not shown.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
setColor ("yellow")
3+
println ("yellow")
4+
5+
setColor ("aqua")
6+
println ("aqua")
7+
8+
setColor ("purple")
9+
println ("purple")
10+
11+
setColor ("red")
12+
println ("red")
13+
14+
setColor ("green")
15+
println ("green")
16+
17+
setColor("RoyalBlue")
18+
println ("Royal Blue")
19+
20+
setColor("DeepSkyBlue")
21+
println ("Deep Sky Blue")
22+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
a = 1.2
3+
24
function callme ()
35
println ("calling lib")
46
end

Rhodus_Version_3/TestScripts/arith1.rh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ import testUtils
88
//setColor ("white")
99
testUtils.beginTests ("")
1010
testUtils.runtestTrue (1E2 == 100);
11-
//testUtils.runtestTrue (1.2E2 == 120);
12-
//testUtils.runtestTrue (0.1E2 == 10);
13-
//testUtils.runtestTrue (1E-2 == 0.01);
14-
//testUtils.runtestTrue (1.2E-2 == 0.012);
15-
//testUtils.runtestTrue (-1E-2 == -0.01);
16-
17-
//testUtils.runtestTrue (2 + 3 == 5);
18-
//testUtils.runtestTrue (2 - 3 == -1);
19-
//testUtils.runtestTrue (3 - 2 == 1);
20-
//testUtils.runtestTrue (2 * 3 == 6);
21-
//testUtils.runtestTrue (10 / 2 == 5);
22-
//testUtils.runtestTrue (2^4 == 16);
23-
//testUtils.endTests()
11+
testUtils.runtestTrue (1.2E2 == 120);
12+
testUtils.runtestTrue (0.1E2 == 10);
13+
testUtils.runtestTrue (1E-2 == 0.01);
14+
testUtils.runtestTrue (1.2E-2 == 0.012);
15+
testUtils.runtestTrue (-1E-2 == -0.01);
16+
17+
testUtils.runtestTrue (2 + 3 == 5);
18+
testUtils.runtestTrue (2 - 3 == -1);
19+
testUtils.runtestTrue (3 - 2 == 1);
20+
testUtils.runtestTrue (2 * 3 == 6);
21+
testUtils.runtestTrue (10 / 2 == 5);
22+
testUtils.runtestTrue (2^4 == 16);
23+
testUtils.endTests()
2424

2525
/*
2626
testUtils.beginTests ("")

Rhodus_Version_3/TestScripts/testUtils.rh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ testNumber = 0; nSuccess = 0; nFail = 0
33

44
function beginTests(msg)
55
global nSuccess, nFail, testNumber
6-
setColor ("blue")
6+
setColor ("DeepSkyBlue")
77
print (testNumber, " ", msg)
88
setColor ("white")
99
nSuccess = 0

0 commit comments

Comments
 (0)