PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: FB Code parsing  (Read 4309 times)

sancho2

  • Little Newbie
  • *
  • Posts: 1
FB Code parsing
« 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:
Code: [Select]
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).
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9313
  • Windows 10
    • PlanetSquires Software
Re: FB Code parsing
« Reply #1 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++.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Josť Roca

  • Guru Member
  • *****
  • Posts: 3282
Re: FB Code parsing
« Reply #2 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.

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9313
  • Windows 10
    • PlanetSquires Software
Re: FB Code parsing
« Reply #3 on: May 17, 2016, 10:48:17 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.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Josť Roca

  • Guru Member
  • *****
  • Posts: 3282
Re: FB Code parsing
« Reply #4 on: May 17, 2016, 11:31:03 AM »

Scintilla supports utf-8, but not utf-16. Alternative? Maybe the rich edit control.

Josť Roca

  • Guru Member
  • *****
  • Posts: 3282
Re: FB Code parsing
« Reply #5 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.