PlanetSquires Forums

Support Forums => WinFBE - Code Editor and Visual Designer => Topic started by: sancho2 on March 11, 2016, 10:12:43 PM

Title: FB Code parsing
Post by: sancho2 on March 11, 2016, 10:12:43 PM
Hello and thank you for letting me on your forum.
Have you completed your code parsing for this code editor? I am working on an addin for FBEdit and I need to parse code. I thought this would be fairly straight forward but it has turned into a bit of a devil. FB is very forgiving in what it lets a coder get away with. Consider this perfectly legal code snippet:
Dim As /'no way'/ Integer x = 12

x +_ This Is Not good
= 1

Print "this is crazy" /'don't code like this'/,x

sleep

FBEdit is pretty good at sorting this mess up. The print line does show all comment after the comment block /' char, but it still compiles. And it fixes after you add/del a line. So the parser is fooled until the entire document is rescanned (I'm guessing).
Title: Re: FB Code parsing
Post by: Paul Squires on March 14, 2016, 07:53:30 AM
I have not worked on the parser too much at this stage. I am using Scintilla for the code editing so the parser will most like have to built using C/C++.
Title: Re: FB Code parsing
Post by: José Roca on May 17, 2016, 09:55:59 AM
One problem with the Scintilla control is that it is not unicode aware. Works with utf-8.
Title: Re: FB Code parsing
Post by: Paul Squires on May 17, 2016, 10:48:17 AM
Quote from: Jose Roca on May 17, 2016, 09:55:59 AM
One problem with the Scintilla control is that it is not unicode aware. Works with utf-8.


I did not realize that. For some reason I had thought that it was Unicode aware. That is unfortunate. I wonder if there is a viable alternative.
Title: Re: FB Code parsing
Post by: José Roca on May 17, 2016, 11:31:03 AM
Scintilla supports utf-8, but not utf-16. Alternative? Maybe the rich edit control.
Title: Re: FB Code parsing
Post by: José Roca on May 17, 2016, 11:35:53 AM
These Linux guys don't pay the due attention to utf-16, probably because is the one used by Windows, its arch enemy. I have needed to write my own WSTR replacement because the FB one has not a parameter to specify the code page.