[Lazarus] Groudwork for Undo in Form Designer

Hans-Peter Diettrich DrDiettrich1 at aol.com
Sun Jan 10 14:53:34 CET 2010

dmitry boyarintsev schrieb:

>> At least the error message could mention the actual number of entries, as
>> found in source code. This doesn't require any change to the language or
>> compiler, only an change to the error message generation.
> lol, something like this?!

yes, something alike.

IMO it's a stupid idea to mix up syntax and semantics. Both the array 
dimension expression (in the declaration part) and the number of 
supplied entries (in the definition part) can be parsed and determined 
independently, based only on syntax. Then a semantical check can be 
appended, whether both amounts are different, and finally it's 
sufficient to show in the error message:
   ... expected $1 values, found $2.

This procedure also would eliminate the need for any error recovery, 
required otherwise to skip over unexpected additional entries in the 
actual source code.

I didn't want to go into implementation details here, since it's an FPC 
issue, not a Lazarus one.


More information about the Lazarus mailing list