Page 3 of 20
Re: GoScintilla - 1.0 beta 4 (PB 4.4 only)
Posted: Wed Dec 02, 2009 11:58 am
by eddy
a little suggestion (see above) : Append Text / Prepend Text
Added functions : GOSCI_DecFoldLevel(id) and GOSCI_IncFoldLevel(id) to be used within a user-defined line styling function only.
Thx
The custom styling function works great

. I made a custom PB styler based on Syntilla Regex.
The code is simplier but it runs probably a little bit slower.
Re: GoScintilla - 1.0 beta 4 (PB 4.4 only)
Posted: Wed Dec 02, 2009 12:01 pm
by srod
Yes I considered using Scintilla's regex's but decided that it would probably be too slow.

Re: GoScintilla - 1.0 beta 4 (PB 4.4 only)
Posted: Wed Dec 02, 2009 7:52 pm
by Mistrel
I thought regular expressions were supposed to be fast?

Re: GoScintilla - 1.0 beta 4 (PB 4.4 only)
Posted: Wed Dec 02, 2009 8:17 pm
by eddy
Mistrel wrote:I thought regular expressions were supposed to be fast?

REGEXs are optimized
but my lexer algorythm is not.
The difference will be visible after loading a large file
Re: GoScintilla - 1.0 beta 4 (PB 4.4 only)
Posted: Thu Dec 03, 2009 8:25 pm
by eddy
many regexs
Code: Select all
CreateStylingRules("PB")
AddStylingRule(#STYLE_DEFAULT, "[ \t]+")
If AddStylingRule(#STYLES_COMMENTS, "[;][^\r\n]*")
AddStylingFolder(1, ";{[^\r\n]*")
AddStylingFolder(0, ";}[^\r\n]*")
EndIf
AddStylingRule(#STYLES_NUMBERS, "[\d][\d.]*")
AddStylingRule(#STYLES_NUMBERS, "[.][\d]+")
AddStylingRule(#STYLES_NUMBERS, "['][^']*[']?")
AddStylingRule(#STYLES_NUMBERS, "[$][\dA-F]*")
AddStylingRule(#STYLES_NUMBERS, "[%][0-1]+")
AddStylingRule(#STYLES_CONSTANTS, "[#][\w\d]*[$]?")
If AddStylingRule(#STYLES_STRUCTURES, "[\\][\s]*[\w\d]+[$]?")
AddStylingLeftPart("[\\][\s]*", #STYLES_SEPARATORS)
EndIf
If AddStylingRule(#STYLES_STRUCTURES, "[.][\s]*[\w][\w\d]*")
AddStylingLeftPart("[.][\s]*", #STYLES_SEPARATORS)
AddStylingException(0, "[abcdfilqsuw]", #STYLES_NORMAL)
EndIf
If AddStylingRule(#STYLES_POINTERS, "([@][*]?|[*])([\w][\w\d]*[$]?)?");
AddStylingException(-1, "[\[{(,:\-=+*<>/%&|]*[\s]*")
EndIf
AddStylingRule(#STYLES_OPERATORS, "[\-=+*<>/%&|][\s]*")
AddStylingRule(#STYLES_SEPARATORS, "[(),:.\[\]{}\\]+[\s]*")
If AddStylingRule(#STYLE_DEFAULT, "[\w][\w\d]*[$]?")
AddStylingException(1, "[\s]*([.][\s]*[\w]+[\s]*)?[(]", #STYLES_FUNCTIONS)
AddStylingException(0, "(?i)(debug|procedurereturn|procedure[$]?|endprocedure|end|endif|if|dim|protected|endmacro|macro)", #STYLES_KEYWORDS)
AddStylingFolder(1,"(?i)(procedure[$]?|macro)")
AddStylingFolder(0,"(?i)(endprocedure|endmacro)")
EndIf
AddStylingRule(#STYLES_STRINGS, "[\x22][^\x22]*[\x22]?")
AddStylingRule(#STYLES_NORMAL, "[^ \t(),:.\[\]{}\\\-=+*<>/%&|#\x22']+")
Re: GoScintilla - 1.0 beta 2 (PB 4.4 only)
Posted: Mon Dec 07, 2009 4:07 pm
by eddy
Regex has a good performance.
But the main problem is its complexity (for a beginner)
ts-soft wrote:
2. case correction
I found a way to do it but there's a remaining problem (cursor jump)
Re: GoScintilla - 1.0 beta 4 (PB 4.4 only)
Posted: Tue Dec 08, 2009 2:46 am
by eddy
GoScintilla with Regex styling engine :
http://www.datafilehost.com/download-109801d9.html
- folding
- autocase
- complete sample of PB styling
- many regex
It's a mod of GoScintilla beta4:
- added : GOSCI_GetCharAdded()
- modified : GOSCI_ScintillaCallBackXXX()

Re: GoScintilla - 1.0 beta 4 (PB 4.4 only)
Posted: Tue Dec 08, 2009 1:16 pm
by srod
Eddy, please start a new thread for your new version of GoScintilla. I shall be sticking with my version at the moment because it suits my purposes and may add your modifications at some later time, when I have time to take a look. I have no internet connection at this time (am having to borrow one) and will be without internet for some time now by the looks of it.
Re: GoScintilla - 1.0 beta 4 (PB 4.4 only)
Posted: Tue Dec 08, 2009 1:39 pm
by eddy
srod wrote:Eddy, please start a new thread for your new version of GoScintilla. I shall be sticking with my version at the moment because it suits my purposes and may add your modifications at some later time, when I have time to take a look. I have no internet connection at this time (am having to borrow one) and will be without internet for some time now by the looks of it.
I see. Ok
Re: GoScintilla - 1.0 beta 4 (PB 4.4 only)
Posted: Tue Dec 08, 2009 1:58 pm
by srod
Now that I have had a look Eddy, your ammendments really do belong in a different library than GoScintilla as it is so heavily dependent on RegExs etc. to the extent that you are using your own Lexer etc. It all looks very sophisticated (I know very little about RegEx's!

)
What I would suggest is that rather than try and work this into GoScintilla that you instead create a kind of 'add-on' which will need its own documentation. Throwing this in with GoScintilla makes things very confusing as it is not immediately clear which bits belong to which etc. and nor is it clear how exactly we use your code?
Consider an 'add-on' module which can be bolted into GoScintilla as a separate entity. Provide some docs and some commented demos and I think it will be a great addition. Personally, I shall stick with not using RegEx's because I don't like 'em very much; I cannot imagine that they are very fast. Between us, we'd give people the choice of which kind of Lexer to use etc.
What do you think?
Re: GoScintilla - 1.0 beta 4 (PB 4.4 only)
Posted: Tue Dec 08, 2009 7:50 pm
by eddy
You're right.
Regex is powerful but its syntax is awful sometimes
So I'll be probably start a sub-version fork.
Re: GoScintilla - 1.0 beta 4 (PB 4.4 only)
Posted: Sat Dec 26, 2009 9:17 pm
by ts-soft
Bugreport on Linux
After changing all #White, #Red and so on to real colors comes a Error in GoScintilla.pbi
at line 1251 - 'Character$' length to Trim() has to be one.
?
Tested on ubuntu x86 and x64 with the same result.
greetings
Thomas
Re: GoScintilla - 1.0 beta 4 (PB 4.4 only)
Posted: Sun Dec 27, 2009 12:50 pm
by srod
Sorry Thomas but I do not understand that error?
Re: GoScintilla - 1.0 beta 4 (PB 4.4 only)
Posted: Sun Dec 27, 2009 4:43 pm
by ts-soft
srod wrote:Sorry Thomas but I do not understand that error?
alike, i think this is a bug on the linux-version but can only reproduce with your large code
as workaround i have removed this line.
greetings
Thomas
Re: GoScintilla - 1.0 beta 4 (PB 4.4 only)
Posted: Wed Jan 06, 2010 4:10 pm
by Justin
This tool is really great, thanks srod for posting it.
I had to modify it with my own hash table instead of the PB Map functions, they are useless to me since they are not dynamic. Same as lists.
Now my question, in the BlockCommentStyler example how to recognice single line comments also? in the form:
// commented line
i'm a bit lost. thanks.