PureBasic Syntax

Discuss syntax highlighting or submit new syntax files.
Post Reply
phollyer
Posts: 1
Joined: 05 Aug 2023 13:06

PureBasic Syntax

Post 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
User avatar
pjj
Posts: 2130
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: PureBasic Syntax

Post 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.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
Post Reply