Subversion Repositories fastphp

Compare Revisions

Regard whitespace Rev 17 → Rev 18

/trunk/EditorMain.pas
539,6 → 539,7
begin
line := memo2.Lines.Strings[Memo2.CaretPos.Y];
 
{$REGION 'Possibility 1: filename.php:lineno'}
pfx := ExtractFileName(GetScrapFile)+':';
p := Pos(pfx, line);
if p <> 0 then
547,7 → 548,9
if not TryStrToInt(line, lineno) then exit;
GotoLineNo(lineno);
end;
{$ENDREGION}
 
{$REGION 'Possibility 2: on line xx'}
pfx := ' on line ';
p := Pos(pfx, line);
if p <> 0 then
556,6 → 559,7
if not TryStrToInt(line, lineno) then exit;
GotoLineNo(lineno);
end;
{$ENDREGION}
end;
 
procedure TForm1.Memo2KeyDown(Sender: TObject; var Key: Word;
569,13 → 573,14
p, a, b: integer;
num: integer;
insert_a, insert_b: string;
 
procedure _process(toFind: string);
begin
// TODO: make it more specific to PHP error messages. "on line" is too broad.
p := Pos(' on line ', cont);
p := Pos(toFind, cont);
while p >= 1 do
begin
a := p+1;
b := p+length(' on line ');
b := p+length(toFind);
num := 0;
while CharInSet(cont[b], ['0'..'9']) do
begin
591,9 → 596,19
 
p := b + Length(insert_a) + Length(insert_b);
 
p := PosEx(' on line ', cont, p+1);
p := PosEx(toFind, cont, p+1);
end;
end;
begin
{$REGION 'Possibility 1: filename.php:lineno'}
_process(ExtractFileName(GetScrapFile)+':');
{$ENDREGION}
 
{$REGION 'Possibility 2: on line xx'}
// TODO: make it more specific to PHP error messages. "on line" is too broad.
_process(' on line ');
{$ENDREGION}
 
result := cont;
end;