Codetools : CTRL-Space and generics with multiple type parameters = problems. lazarus / 9-Editor ---------------------------------------------------------------------- Cyrax · 2013-01-09 12:37 Example: Code: [Select]Type   generic taa = class   end; If I do CTRL-Space somewhere on same unit or different unit which uses unit where example generic is defined, IDE will give this error message: Code: [Select]unit1.pas(31,17) Error: > expected, but ; found This bug is reported http://bugs.freepascal.org/view.php?id=23537. See note 0064744 for more information. So I'm asking that where I should start looking for fixing this bug? I have already browsed/stepped through CodeTools-package source code and I didn't find anything which are related to parsing pascal code. Can somebody give a hand? ---------------------------------------------------------------------- Cyrax · 2013-01-09 15:20 Patch to this bug is released by me : http://bugs.freepascal.org/view.php?id=23617 ---------------------------------------------------------------------- JuhaManninen · 2013-01-09 15:22 Quote from: Cyrax on January 09, 2013, 01:37:51 pmSo I'm asking that where I should start looking for fixing this bug? I have already browsed/stepped through CodeTools-package source code and I didn't find anything which are related to parsing pascal code. CodeTools package is mostly about parsing pascal code. You could look at the simple example projects for codetools. Then you could look how it is used in other parts of Lazarus code. For example the Delphi converter uses parts of it, and obviously the source editor. I know it is complex and difficult to understand first, and difficult to debug because it uses pointers (PChar) for the source buffer. It is a special parser in a way that it does not build a parse tree of the actual source code, it only does it for type, variable and function definitions. The source code is then parsed "on the fly" when needed. That's why it works well in source editor, better than for example the Delphi's equivalent parser. It tolerates broken code up to some point. It is not ideal for the Delphi converter though because the converter should analyze the code to make some advanced conversions. For example I had to create a (primitive) parser myself to replace function calls during the conversion. It uses the limited info stored by codetools and continues from that. It may be a good example for you. Juha ---------------------------------------------------------------------- JuhaManninen · 2013-01-09 18:05 Quote from: Cyrax on January 09, 2013, 04:20:37 pmPatch to this bug is released by me : http://bugs.freepascal.org/view.php?id=23617 You found it quickly. Impressive. BTW, the line can be written like this: Code: [Select]  if CurPos.Flag in [cafComma, cafSemicolon, cafColon] then begin Regards, Juha