Skip to content

Commit 43de2f7

Browse files
authored
Merge pull request #217 from peterdell/way2js4
Way2js4 - Update src
2 parents d10c05e + f3cd950 commit 43de2f7

File tree

7 files changed

+267
-264
lines changed

7 files changed

+267
-264
lines changed

projects/MakeMadPascal.bat

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
@echo off
2+
cd %~dp0
13
rem Replace .pas ^ .pas ^
24
rem Replace -inputFilePattern IdentifierAt(IdentIndex) -inputFilePattern
35
MakeMadPascal.exe -allThreads -allFiles -mpFolderPath .\.. -compileReference -compile -compare -openResults ^
46
-inputFilePattern samples\a8\graph\stereogram.pas ^
57
-inputFilePattern samples\common\math\fft\fourier.pas ^
6-
-inputFilePattern samples\tests\tests-medium\array-with-char-index.pas ^
7-
-inputFilePattern samples\a8\crt_console\life.pas ^
8+
-inputFilePattern samples\a8\crt_console\life2.pas ^
89
-inputFilePattern samples\a8\demoeffects\bobs.pas ^
910
-inputFilePattern samples\a8\demoeffects\bobs_f.pas ^
1011
-inputFilePattern samples\a8\games\jump.pas ^
@@ -20,6 +21,7 @@ MakeMadPascal.exe -allThreads -allFiles -mpFolderPath .\.. -compileReference -co
2021
-inputFilePattern samples\common\crt_console\life.pas ^
2122
-inputFilePattern samples\common\graphics\mandel.pas ^
2223
-inputFilePattern samples\common\object\hello.pas ^
24+
-inputFilePattern samples\tests\tests-array\array_bracket.pas ^
2325
-inputFilePattern samples\tests\tests-basic\negative-index-range.pas ^
2426
-inputFilePattern samples\tests\tests-medium\array-with-char-index.pas ^
2527
-inputFilePattern samples\vic-20\snake\vic20.pas ^

projects/MakeMadPascal.lpi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</Mode>
3737
<Mode Name="all">
3838
<local>
39-
<CommandLineParams Value="-allThreads -allFiles -compileReference -compile -compare -openResults -waitForKey -inputFilePa2ttern dynrec.pas"/>
39+
<CommandLineParams Value="-allThreads -allFiles -compileReference -compile -compare -openResults -waitForKey -inputFilePattern bracket"/>
4040
</local>
4141
</Mode>
4242
</Modes>

projects/MakeMadPascal.lpr

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
uses
1010
{$IFDEF DARWIN}
1111

12-
{$ENDIF} {$IFDEF WINDOWS}
12+
{$ENDIF} {$IFDEF WINDOWS}
1313
Windows,
14-
{$ENDIF} {$IFDEF UNIX}
14+
{$ENDIF} {$IFDEF UNIX}
1515
cthreads, cmem,
16-
{$ENDIF}
16+
{$ENDIF}
1717
Crt,
1818
Classes,
1919
Utilities,
@@ -272,26 +272,30 @@ TOptions = record
272272
line := UpperCase(line);
273273
CheckForLibrary(line, 'blibs', Result);
274274
CheckForLibrary(line, 'dlibs', Result);
275-
if (Pos('PROGRAM ', line) > 0) then
275+
if (Result.fileType = TFileType.UNKNOWN) and (Pos('PROGRAM ', line) > 0) then
276276
begin
277277
Result.fileType := TFileType.TPROGRAM;
278278
end;
279-
if (Pos('UNIT ', line) > 0) then
279+
if (Result.fileType = TFileType.UNKNOWN) and (Pos('UNIT ', line) > 0) then
280280
begin
281281
Result.fileType := TFileType.TUNIT;
282282
end;
283-
if (Pos('USES ', line) > 0) then
283+
284+
if Result.fileType = TFileType.UNKNOWN then
284285
begin
285-
if Result.fileType = TFileType.UNKNOWN then
286+
if (Pos('USES ', line) > 0) then
286287
begin
287-
Result.fileType := TFileType.TPROGRAM;
288+
289+
begin
290+
Result.fileType := TFileType.TPROGRAM;
291+
end;
292+
done := True;
293+
end;
294+
if (Pos('PROCEDURE ', line) > 0) or (Pos('FUNCTION ', line) > 0) then
295+
begin
296+
Result.fileType := TFileType.TINCLUDE;
297+
done := True;
288298
end;
289-
done := True;
290-
end;
291-
if (Pos('PROCEDURE ', line) > 0) or (Pos('FUNCTION ', line) > 0) then
292-
begin
293-
Result.fileType := TFileType.TINCLUDE;
294-
done := True;
295299
end;
296300

297301
if (Pos('BEGIN ', line) > 0) then
@@ -819,20 +823,21 @@ TParallelData = record
819823
Value := '';
820824
end;
821825

822-
function GetCountText(count: Cardinal; singular:String; plural:String):String;
826+
function GetCountText(Count: Cardinal; singular: String; plural: String): String;
823827
begin
824-
if count =1 then
828+
if Count = 1 then
825829
begin
826-
Result:=Format('%d %s', [count, singular]);
830+
Result := Format('%d %s', [Count, singular]);
827831
end
828832
else
829833
begin
830-
Result :=Format('%d %s', [count, plural]);
834+
Result := Format('%d %s', [Count, plural]);
831835
end;
832836
end;
833837

834838
procedure Main;
835-
const MP_ORIGIN_FOLDER = 'origin';
839+
const
840+
MP_ORIGIN_FOLDER = 'origin';
836841

837842
{$IFDEF DARWIN}
838843
const
@@ -1005,7 +1010,8 @@ TParallelData = record
10051010
threads := 1;
10061011
end;
10071012

1008-
Log(Format('Processing %s with %s.', [GetCountText(ProgramFiles.Count,'Pascal program','Pascal programs'), GetCountText(threads, 'thread', 'threads')]));
1013+
Log(Format('Processing %s with %s.', [GetCountText(ProgramFiles.Count, 'Pascal program', 'Pascal programs'),
1014+
GetCountText(threads, 'thread', 'threads')]));
10091015

10101016

10111017
if (options.cleanup) then
@@ -1095,7 +1101,8 @@ TParallelData = record
10951101
end
10961102
else
10971103
begin
1098-
operation.logMessages.Add(Format('Found %s.', [GetCountText(operation.diffFilePaths.Count, 'different file', 'different files')]));
1104+
operation.logMessages.Add(Format('Found %s.',
1105+
[GetCountText(operation.diffFilePaths.Count, 'different file', 'different files')]));
10991106
operation.logMessages.AddStrings(operation.diffFilePaths);
11001107
end;
11011108

projects/TestMadPascal.lpi

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
<Modes>
2727
<Mode Name="default">
2828
<local>
29-
<CommandLineParams Value="-iPath:C:\jac\system\Atari800\Programming\Repositories\Mad-Pascal\lib enum_proc_arg.pas"/>
30-
<WorkingDirectory Value="C:\jac\system\Atari800\Programming\Repositories\Mad-Pascal\samples\tests\tests-enum\"/>
29+
<CommandLineParams Value="-iPath:C:\jac\system\Atari800\Programming\Repositories\Mad-Pascal\lib aes_test.pas"/>
30+
<WorkingDirectory Value="C:\jac\system\Atari800\Programming\Repositories\Mad-Pascal\samples\a8\math\aes\"/>
3131
</local>
3232
</Mode>
3333
<Mode Name="samples">
@@ -42,6 +42,18 @@
4242
<WorkingDirectory Value="C:\jac\system\Atari800\Programming\Repositories\Mad-Pascal\samples\tests\tests-basic\"/>
4343
</local>
4444
</Mode>
45+
<Mode Name="mine">
46+
<local>
47+
<CommandLineParams Value="-iPath:C:\jac\system\Atari800\Programming\Repositories\Mad-Pascal\lib mine.pas"/>
48+
<WorkingDirectory Value="C:\jac\system\Atari800\Programming\Repositories\Mad-Pascal\samples\a8\games\"/>
49+
</local>
50+
</Mode>
51+
<Mode Name="hello">
52+
<local>
53+
<CommandLineParams Value="-iPath:C:\jac\system\Atari800\Programming\Repositories\Mad-Pascal\lib hello.pas"/>
54+
<WorkingDirectory Value="C:\jac\system\Atari800\Programming\Repositories\Mad-Pascal\samples\common\object\"/>
55+
</local>
56+
</Mode>
4557
</Modes>
4658
</RunParams>
4759
<Units>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
program array_bracket;
2+
3+
// Verification test for https://forums.atariage.com/topic/240919-mad-pascal/page/41/#findComment-5721582
4+
// array_bracket.pas (14,38) Error: Syntax error, '[' expected but ')' found
5+
6+
type
7+
TCHRIMAG = array[0..7] of 0..255;
8+
9+
var
10+
CHARSET: array[0..63] of TCHRIMAG;
11+
12+
procedure PRGRCHR(var A1: TCHRIMAG); external;
13+
14+
procedure PRINTCHR(ACHAR: Char);
15+
16+
begin
17+
PRGRCHR(CHARSET[Ord(ACHAR) - 32]);
18+
end;
19+
20+
begin
21+
PRINTCHR('A');
22+
end.

0 commit comments

Comments
 (0)