Skip to content

Commit 97faa53

Browse files
committed
Fixed color settings in terminal
1 parent 2a00c4d commit 97faa53

File tree

6 files changed

+25
-31
lines changed

6 files changed

+25
-31
lines changed

Rhodus_Version_3/RhodusVersionThreeProject.dproj

Lines changed: 7 additions & 7 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>
@@ -263,23 +263,23 @@
263263
<Overwrite>true</Overwrite>
264264
</Platform>
265265
</DeployFile>
266-
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
267-
<Platform Name="iOSSimulator">
266+
<DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
267+
<Platform Name="OSX32">
268268
<Overwrite>true</Overwrite>
269269
</Platform>
270270
</DeployFile>
271-
<DeployFile LocalName="Win32\Debug\RhodusVersionThreeProject.exe" Configuration="Debug" Class="ProjectOutput">
271+
<DeployFile LocalName="Win32\Release\RhodusVersionThreeProject.exe" Configuration="Release" Class="ProjectOutput">
272272
<Platform Name="Win32">
273273
<RemoteName>RhodusVersionThreeProject.exe</RemoteName>
274274
<Overwrite>true</Overwrite>
275275
</Platform>
276276
</DeployFile>
277-
<DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
278-
<Platform Name="OSX32">
277+
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
278+
<Platform Name="iOSSimulator">
279279
<Overwrite>true</Overwrite>
280280
</Platform>
281281
</DeployFile>
282-
<DeployFile LocalName="Win32\Release\RhodusVersionThreeProject.exe" Configuration="Release" Class="ProjectOutput">
282+
<DeployFile LocalName="Win32\Debug\RhodusVersionThreeProject.exe" Configuration="Debug" Class="ProjectOutput">
283283
<Platform Name="Win32">
284284
<RemoteName>RhodusVersionThreeProject.exe</RemoteName>
285285
<Overwrite>true</Overwrite>
0 Bytes
Binary file not shown.

Rhodus_Version_3/SampleScripts/bugglobal.rh

Lines changed: 0 additions & 10 deletions
This file was deleted.

Rhodus_Version_3/uRepl.pas

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,29 @@ procedure startRepl;
88

99
implementation
1010

11-
Uses StrUtils,
12-
uMemoryManager,
11+
Uses StrUtils,
12+
uMemoryManager,
1313
uBuiltInGlobal,
1414
uBuiltInSys,
15-
uSyntaxParser,
16-
uRhodusTypes,
15+
uSyntaxParser,
16+
uRhodusTypes,
1717
uSymbolTable,
18-
uCommands,
18+
uCommands,
1919
IOUtils,
2020
uCompile,
2121
uMachineStack;
22-
22+
2323

2424
var rhodus : TRhodus;
2525
sourceCode : string;
2626
syntaxError : TSyntaxError;
2727
compilerError : TCompilerError;
28-
currentColor : string;
2928

3029

3130
// Print methods to support output from the VM
3231
// -------------------------------------------------------------------------------
3332
procedure print (astr : AnsiString);
3433
begin
35-
uTerminal.setColor (currentColor);
3634
write (astr);
3735
end;
3836

@@ -55,8 +53,7 @@ function myRead (const prompt : AnsiString) : PAnsiChar;
5553

5654
procedure setColor (acolor : AnsiString);
5755
begin
58-
currentColor := acolor;
59-
uTerminal.setColor(currentColor);
56+
uTerminal.setColor(aColor);
6057
end;
6158

6259

@@ -211,7 +208,11 @@ procedure executeCode (const sourceCode : string);
211208
end;
212209
end
213210
else
211+
begin
212+
setGreen;
214213
writeln ('ERROR ' + '[line ' + inttostr (syntaxError.lineNumber) + ', column: ' + inttostr (syntaxError.columnNumber) + '] ' + syntaxError.errorMsg);
214+
setWhite;
215+
end;
215216
end;
216217

217218

Rhodus_Version_3/uRhodusEngine.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ function TRhodus.runCode (module : TModule; interactive : boolean) : boolean;
387387
except
388388
on e:exception do
389389
begin
390-
//setGreen;
390+
setColor('Cyan');
391391
printLnCallBack ('ERROR: ' + e.Message);
392-
//setWhite;
392+
setWhite;
393393
result := False;
394394
end;
395395
end;

Rhodus_Version_3/uTerminal.pas

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ procedure setGreen;
2121
procedure setBlue;
2222
procedure setYellow;
2323
procedure setWhite;
24+
procedure setAqua;
2425
procedure setUpConsole;
2526
procedure shutDownConsole;
2627
procedure clearConsoleScreen;
@@ -32,7 +33,7 @@ procedure setCurrentColors;
3233

3334
implementation
3435

35-
Uses Windows, Classes, SysUtils, StrUtils, Vcl.GraphUtil, uCommands;
36+
Uses Windows, Classes, SysUtils, StrUtils, Vcl.GraphUtil, uCommands, uRepl;
3637

3738
type
3839
COORD = record
@@ -178,7 +179,9 @@ procedure setWhite;
178179

179180
procedure setGreen;
180181
begin
181-
currentColor[0] := 0; currentColor[1] := 255; currentColor[2] := 0;
182+
currentColor[0] := 0;
183+
currentColor[1] := 255;
184+
currentColor[2] := 0;
182185
setCurrentColors;
183186
end;
184187

0 commit comments

Comments
 (0)