<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hello,<br><br></div>I am starting to use fpprofiler. Because I did not know what parameters should be sent to fpc, I decided to use fppinsert. At least one type of "instrumented" code fails to compile:<br></div>// some code { some comment } <br></div>is wrongly changed into <br>{ some code { some comment } }<br></div>which does not compile.<br><br></div>AFAICS the issue comes from the fact that PScanner only has the tkComment type, so that when fppinsert tries to rebuild the code, it has no way to know if it should use '//' or '{ }'.<br><br></div><div>Of course, I can't simply replace tkComment with 2 new distinct types, there is probably some other code somewhere, not even in the Lazarus repository, which uses the current set of token types.<br><br></div>I see at least 3 ways to solve my issue<br></div>1 - change fppinsert so that if it finds a bracket in the token, it should use '//' - I don't like much this solution<br></div>2 - use a flag in TPascalScanner (something like CommentType) allowing to know the type of comment if needed<br></div>3 - add 2 types tkCommentSlash and tkCommentBrackets into TToken plus an option to TPOptions so that the calling code could choose to use the simple tkComment or the more specific tkCommentSlash and tkCommentBrackets<br><br></div>I like the third method best, but I may be missing some drawbacks in these options, so what would be the preferred way to do it? Maybe a fourth idea?<br clear="all"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><br>-- <br><div class="gmail_signature">Frederic Da Vitoria<br>(davitof)<br><br>Membre de l'April - « promouvoir et défendre le logiciel libre » - <a href="http://www.april.org" target="_blank">http://www.april.org</a><br></div>
</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>