Page 1 of 1

PureBasic Syntax

Posted: 05 Aug 2023 15:36
by phollyer
I'm working on Syntax for pure basic, I've got Folding done, my problem is the coloring. How does the Key Words Grouping Name match to the coloring scheme?

[Keywords

Constants=(?!#PB_)#([a-zA-Z_0-9]+)$
Others=CallDebugger|DataSection|Debug|DebugLevel|DeclareCDLL|DeclareDLL|Dim|DisableDebugger|EnableDebugger|EndDataSection|EndEnumeration|EndInterface|EndProcedure|EndStructure|Enumeration|Global|IncludeBinary|IncludeFile|IncludePath|Interface|NewList|Protected|Procedure|ProcedureCDLL|ProcedureDLL|Protected|Shared|Static|Structure|XIncludeFile
Keywords=Break|Case|Continue|Else|ElseIf|End|EndIf|EndSelect|For|ForEach|Forever|Gosub|Goto|If|Next|OffsetOf|Repeat|Return|Select|SizeOf|Until|Wend|While
Functions={Big list of language Functions)
Methods=[a-zA-Z0-9_]*::[a-zA-Z0-9_]*
Attributes=(?<=\bProcedure )[a-zA-Z0-9_]*
Operators=and|to|not|or|
PBConstants=\b#PB_[a-zA-Z0-9_]*
========================================
Regex Explanation
========================================
Constants = all words beginning with "#" Excluding those starting with #PB_
PBConstants = All words beginning with #PB_
Methods = Word Before and After ::
Attributes = Word Following "Procedure " ~Poorly named these are ProcedureNames


How does the names used here in grouping words match back to Theme Coloring?

Pete

Re: PureBasic Syntax

Posted: 07 Aug 2023 08:16
by pjj
You have defined some keyword groups (Constants, Others, dStructure, etc.) and all of them should be now available for setting colors in the usual place, i.e. Environment > Themes > (pick your theme) > Customize... > [Syntax highlighting] > %your highlighter%, where you can set them for the chosen theme.