simplified line nbr parser

This commit is contained in:
Basile Burg 2015-05-03 17:51:25 +02:00
parent ba739df7c2
commit d0ed450c53
1 changed files with 14 additions and 27 deletions

View File

@ -724,41 +724,28 @@ begin
while (true) do
begin
if i > length(aMessage) then exit;
if aMessage[i] = '.' then
if aMessage[i] = '(' then
begin
inc(i);
if i > length(aMessage) then exit;
if aMessage[i] = 'd' then
while( isNumber(aMessage[i]) or (aMessage[i] = ',') or (aMessage[i] = ':')) do
begin
ident += aMessage[i];
inc(i);
if i > length(aMessage) then exit;
if aMessage[i] = 'i' then
inc(i);
if i > length(aMessage) then exit;
if aMessage[i] = '(' then
end;
if aMessage[i] = ')' then
begin
j := Pos(',', ident);
if j = 0 then j := Pos(':', ident);
if j = 0 then
result.y := strToIntDef(ident, -1)
else
begin
inc(i);
if i > length(aMessage) then exit;
while( isNumber(aMessage[i]) or (aMessage[i] = ',') or (aMessage[i] = ':')) do
begin
ident += aMessage[i];
inc(i);
if i > length(aMessage) then exit;
end;
if aMessage[i] = ')' then
begin
j := Pos(',', ident);
if j = 0 then j := Pos(':', ident);
if j = 0 then
result.y := strToIntDef(ident, -1)
else
begin
result.y := strToIntDef(ident[1..j-1], -1);
result.x := strToIntDef(ident[j+1..length(ident)], -1);
end;
exit;
end;
result.y := strToIntDef(ident[1..j-1], -1);
result.x := strToIntDef(ident[j+1..length(ident)], -1);
end;
exit;
end;
end;
inc(i);