ike wrote:Here is code in IUP that is doing folding in FREEBASIC
This module is for PureBasic, BlitzBasic and FreeBasic
line 126 is freebasic
IUP developer is nice guy, so if we find what is wrong he will fix it for sure!
That is for folding, and coloring,
but for code completion is different. That part should be done in FREEBASIC and it is not difficult because it is not full parsing BUT some kind of LINE SCANING
I looked at the folding a bit and folding is set to fold on indentation regardless of the text typed.
As an example I used the following text in the demo I posted in the tips&tricks section
Code: Select all
this is not freebasic
it is just text
and some more indentation
but if folds
end the outer block of non-freebasic
I get a folding sign at 'this is not freebasic' and at 'it is just text'. This works for any type of text entered.
Which is kind of interesting as it encourages a programmer to use lots of indentation (makes code look prettier).
As to the IUP developer and fixing things: I don't think he will fix problems with scintilla. He
is using scintilla 'as is' (of course there is some iup wrapper code so scintilla can be accessed
from IUP). Having to update the scintilla code at every new release of iup is something the iup developer will not do.
No doubt the iup developer will update the scintilla version used by iup as new releases of scintilla become
available. But you can't expect him to apply changes to every new release of scintilla just to correct
I am unsure as to what should be changed and where. Syntax colouring and folding are one thing but I'd say
code completion etc... are even more important.
And for code completion etc... you need a symbol table. Generating that symbol table is not that easy.
FreeBASIC and C share a problem that makes symbol table generation a bit involved: the possible use
of macros. An identifier can be any of a number of things: the name of a macro, the name of a type or the
name of a variable (or a keyword or....).
After macro expansion it is possible to get symbolic information (needed for code completion etc...)
but not before. Anything less than a fairly full blown FreeBASIC parser simply will not do when it comes to
symbol table generation.
Which is where the fbc comes into play. When it comes to extracting symbolic information from source code
the fbc is or should be a very usable tool. It is better to reuse an existing parser than to try and write your own