[Lazarus] Some strange effects in the IDE
Mattias Gaertner
nc-gaertnma at netcologne.de
Thu Jul 21 19:25:35 CEST 2011
On Thu, 21 Jul 2011 19:15:50 +0100
Hans-Peter Diettrich <DrDiettrich1 at aol.com> wrote:
> The code tools seem to have problems in parsing "case" statements, and
> with debugging "while" statements. See this code snippet:
>
> //determine XML lines to copy
> while PFirst < XLast do begin
> //copy until PFirst
> while XFirst < PFirst do begin
> dst.Add(Strings[XFirst]); inc(XFirst);
> end;
> //merge patch
> dst.Add(DiffFile.Strings[DFirst]); inc(DFirst); //copy diff range
> header
> case DiffSec.c of
> 'a',
> 'c',
> 'd': //delete P (insert Diff lines before P?)
> begin // <---------------- this is line 134 --------------
> while DFirst <= DLast do begin
> ...
>
> When navigating in this file (e.g. CTRL-SHIFT up/dn), the cursor is
> positioned at the marked line, at the "in" of "begin". The error message is:
> uxml.pas(134,10) Error: identifier expected, but in found
> (complete file uploaded with Mantis #19783)
>
> Does the parser have problems with character literals (and other
> expressions) as case labels?
The codetools itself uses a lot of them.
Can you reproduce it? For example edit something in front, so that the
parser reparses the code in question.
I think I saw something fishy with undo that sometimes the source
editor does not commit the changes to the codetools. Maybe this is the
case here.
> BTW the unit compiles, i.e. contains no real syntax errors.
>[...]
Mattias
More information about the Lazarus
mailing list