Fix file names
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
unit AG.PascalTokeniser;
|
unit AG.PascalTokenizer;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@@ -116,12 +116,12 @@ begin
|
|||||||
x := 1+Fix;
|
x := 1+Fix;
|
||||||
while s[y]='' do
|
while s[y]='' do
|
||||||
begin
|
begin
|
||||||
if y + 1 = s.Count then
|
if y + 1 = s.Count then
|
||||||
begin
|
begin
|
||||||
ended := True;
|
ended := True;
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
inc(y);
|
inc(y);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
Exit(True);
|
Exit(True);
|
||||||
@@ -191,106 +191,106 @@ begin
|
|||||||
begin
|
begin
|
||||||
if now_sym = '/' then
|
if now_sym = '/' then
|
||||||
begin
|
begin
|
||||||
if next_sym = '/' then
|
if next_sym = '/' then
|
||||||
begin
|
begin
|
||||||
for i:=x to l+Fix do
|
for i:=x to l+Fix do
|
||||||
ss:=ss+line[i];
|
ss:=ss+line[i];
|
||||||
x := l+Fix;
|
x := l+Fix;
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else if now_sym = '{' then
|
else if now_sym = '{' then
|
||||||
begin
|
begin
|
||||||
ml := '}';
|
ml := '}';
|
||||||
ss := now_sym;
|
ss := now_sym;
|
||||||
last_i0 := y;
|
last_i0 := y;
|
||||||
end
|
end
|
||||||
else if now_sym = '(' then
|
else if now_sym = '(' then
|
||||||
begin
|
begin
|
||||||
if next_sym = '*' then
|
if next_sym = '*' then
|
||||||
begin
|
begin
|
||||||
ml := ')';
|
ml := ')';
|
||||||
inc(x);
|
inc(x);
|
||||||
last_i0 := y;
|
last_i0 := y;
|
||||||
ss := now_sym + next_sym;
|
ss := now_sym + next_sym;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
ss := '(';
|
ss := '(';
|
||||||
inc(x);
|
inc(x);
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if SYMS1.Contains(now_sym) then
|
if SYMS1.Contains(now_sym) then
|
||||||
begin
|
begin
|
||||||
ss := now_sym;
|
ss := now_sym;
|
||||||
inc(x);
|
inc(x);
|
||||||
if SYMS2.Contains(now_sym + next_sym) then
|
if SYMS2.Contains(now_sym + next_sym) then
|
||||||
begin
|
begin
|
||||||
inc(x);
|
inc(x);
|
||||||
ss := ss + next_sym;
|
ss := ss + next_sym;
|
||||||
end;
|
end;
|
||||||
break;
|
break;
|
||||||
end
|
end
|
||||||
else if now_sym = #39 then
|
else if now_sym = #39 then
|
||||||
begin
|
begin
|
||||||
ss := #39;
|
ss := #39;
|
||||||
inc(x);
|
inc(x);
|
||||||
if next_sym <> '' then
|
if next_sym <> '' then
|
||||||
begin
|
begin
|
||||||
ss := ss + next_sym;
|
ss := ss + next_sym;
|
||||||
while line[x] <> #39 do
|
while line[x] <> #39 do
|
||||||
begin
|
begin
|
||||||
inc(x);
|
inc(x);
|
||||||
if not _is_readable() then
|
if not _is_readable() then
|
||||||
begin
|
begin
|
||||||
dec(x);
|
dec(x);
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
ss := ss + line[x];
|
ss := ss + line[x];
|
||||||
end;
|
end;
|
||||||
inc(x);
|
inc(x);
|
||||||
end;
|
end;
|
||||||
break;
|
break;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
while not NO_NAME_SYMS.Contains(line[x]) do
|
while not NO_NAME_SYMS.Contains(line[x]) do
|
||||||
begin
|
begin
|
||||||
ss := ss + line[x];
|
ss := ss + line[x];
|
||||||
inc(x);
|
inc(x);
|
||||||
if not _is_readable() then
|
if not _is_readable() then
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
while last_i0 <> y do
|
while last_i0 <> y do
|
||||||
begin
|
begin
|
||||||
ss := ss + #10;
|
ss := ss + #10;
|
||||||
inc(last_i0);
|
inc(last_i0);
|
||||||
end;
|
end;
|
||||||
if ss[length(ss) + fix] = #10 then
|
if ss[length(ss) + fix] = #10 then
|
||||||
begin
|
begin
|
||||||
ss[length(ss) + fix] := now_sym;
|
ss[length(ss) + fix] := now_sym;
|
||||||
ss := ss + #10;
|
ss := ss + #10;
|
||||||
end;
|
end;
|
||||||
if now_sym = ml then
|
if now_sym = ml then
|
||||||
if ml = '}' then
|
if ml = '}' then
|
||||||
begin
|
begin
|
||||||
inc(x);
|
inc(x);
|
||||||
break;
|
break;
|
||||||
end
|
end
|
||||||
else if (x <> 0) and (line[x - 1] = '*') then
|
else if (x <> 0) and (line[x - 1] = '*') then
|
||||||
begin
|
begin
|
||||||
inc(x);
|
inc(x);
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
_next_readable();
|
_next_readable();
|
||||||
end;
|
end;
|
||||||
@@ -5,7 +5,7 @@ uses
|
|||||||
DUnitX.TestFramework,
|
DUnitX.TestFramework,
|
||||||
System.Classes,
|
System.Classes,
|
||||||
WinAPI.Windows,
|
WinAPI.Windows,
|
||||||
AG.PascalTokeniser;
|
AG.PascalTokenizer;
|
||||||
|
|
||||||
type
|
type
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ uses
|
|||||||
DUnitX.Loggers.Xml.NUnit,
|
DUnitX.Loggers.Xml.NUnit,
|
||||||
DUnitX.TestFramework,
|
DUnitX.TestFramework,
|
||||||
MainTest in 'MainTest.pas',
|
MainTest in 'MainTest.pas',
|
||||||
AG.PascalTokeniser in '..\AG.PascalTokeniser.pas';
|
AG.PascalTokenizer in '..\AG.PascalTokenizer.pas';
|
||||||
|
|
||||||
var
|
var
|
||||||
runner : ITestRunner;
|
runner : ITestRunner;
|
||||||
|
|||||||
Reference in New Issue
Block a user