[Lazarus] Some strange effects in the IDE

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Jul 21 20:15:50 CEST 2011


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?
BTW the unit compiles, i.e. contains no real syntax errors.


As another strange effect the first "while" above is not marked with a 
dot at runtime, so that it's impossible to set an breakpoint on that 
line. Other "while" statements (e.g. last line above) have such dots. 
This may be a problem with compiler optimization?

DoDi





More information about the Lazarus mailing list