Code highlighting for RJ TextEd (?)

For everything that's not in any way related to PureBasic. General chat etc...
AZJIO
Addict
Addict
Posts: 2191
Joined: Sun May 14, 2017 1:48 am

Code highlighting for RJ TextEd (?)

Post by AZJIO »

Has anyone tried to create code highlighting for this editor?

https://www.rj-texted.se/

At the moment I am using this PureBasic.syx file (%AppData%\Roaming\RJ TextEd\Syntax\User defined\PureBasic.syx)

Code: Select all

;{}

[StandardExtensions]
default=.pb|.pbi|.pbf

[Keywords]
#ConstantsN=#\w+
#ConstantsStr=#\w+\$
#Keywords=\b(End(?:If|DataSection|Structure|StructureUnion|Procedure|Macro|Select|Enumeration|Import|Interface|With|DeclareModule|Module)?|Until|Wend|Next|Data(?:Section)?|Procedure(?:[CDL$]{0,5}?|Return)|Compiler(?:If|Select|EndIf|EndSelect|Case|Default|Else|Error)|Macro|Repeat|While|Select|Enumeration|ImportC?|Structure(?:Union)?|Interface|With|For(?:Each|Ever)?|Declare[CDL$]{0,5}?|Extends|Fakereturn|Step|Not|And|Or|True|False|Global|Protected|Shared|Static|Threaded|Break|Continue|To|Gosub|Case|Default|Goto|Swap|Define|(?:Re)?Dim|(?:New)?(?:List|Map)|(?:Def|Proto|Pseudo)type|X?IncludeFile|Include(?:Path|Binary)|Read|Restore|Debug(?:Level)?|(?:Call|Disable|Enable)Debugger|Enable(?:Explicit|ASM)|Disable(?:Explicit|ASM)|(?:Else)?(?:If)?|(?:Declare)?Module|Runtime)\b
#Procedure=\b[a-zA-Z]\w*[$a-zA-Z\d](?=\s*\()
#FuncAPI=\b\w+_(?=\h*\()
#Methods=\b\w+::\w+\b
#Point=[*@]\w+
#StructItem=(?<![.:])\\\w+
#Var=\b\w+\$
#Var2=(?<![\n\t])\b\w+(?=\.[sfdqbliwcapu])\b
#Var3=(?<![.\w])\b([a-zA-Z]\w*)(?=\h*[,\)=])
#StructDec=\.\w{2,}
#Type=\.[sfdqbliwcapu]\b
#HexNum=(?<!\w)\$[\dA-Fa-f]+
#Operators=[\&\(\)\*\/\\\:\+\<\=\>\,\.\?\[\]\^\-]+


[Options]
LineCommentA=;
Char='
String="
Symbols=-+<>!~%^&|={[()]}:.,;
Numbers=0123456789
AutoCloseBraceStart=("'
AutoCloseBraceEnd=)"'
AllowNestedComments=0
StringOnLine=0
AllowEscapeOutsideString=0
Case=0
CaseTags=0
HighlightUrl=0
AutoCompleteTags=0
AddProjectClassesToCompletion=0
OnlyHighlightInBlock=0
AutoCompleteSort=0
AllowHighlightBetweenTags=0

[FoldOptions]
Case=0
FoldLineComments=0
FoldOnIndention=0
List_Exclude=


[Fold]
1_Id=^Procedure
1_Begin=
1_End=^EndProcedure
1_Level=
1_ListItem=ceFunction
1_Name=Function
2_Id=^If
2_Begin=
2_End=^EndIf
2_Level=
2_ListItem=ceFunction
2_Name=If
3_Id=^ForEach
3_Begin=
3_End=^Next
3_Level=
3_ListItem=ceFunction
3_Name=ForEach
4_Id=^For
4_Begin=
4_End=^Next
4_Level=
4_ListItem=ceFunction
4_Name=For
5_Id=^While
5_Begin=
5_End=^Wend
5_Level=
5_ListItem=ceFunction
5_Name=While
You may also need the following file: %AppData%\Roaming\RJ TextEd\Syntax color themes\PureBasic.xml

Code: Select all

<ColorTheme author="AZJIO" description="PureBasic" modified="19.09.2024 06:47:00">
  <Default color="11184810" backgroundcolor="4144959" bold="false" italic="false" underline="false"/>
  <Selection color="24576" backgroundcolor="15261920"/>
  <HTMLTagHighlight color1="16759260" color2="13434828"/>
  <XMLTagHighlight color1="16764057" color2="13434828"/>
  <ConstantsN color="14260446" backgroundcolor="16777215" bold="false" italic="false" underline="false"/>
  <Var color="16754436" backgroundcolor="16777215" bold="false" italic="false" underline="false"/>
  <Point color="15978352" backgroundcolor="16777215" bold="false" italic="false" underline="false"/>
  <ControlCharacters color="8421504" backgroundcolor="11184810"/>
  <LineHighlight color="11184810" backgroundcolor="15793151"/>
  <BraceHighlight color="8388608" backgroundcolor="11184810" bold="true" italic="false" underline="false"/>
  <FoldHighlight color="11184810" backgroundcolor="16314852"/>
  <SyncEdit color="0" backgroundcolor="11184810"/>
  <Character color="13408665" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <String color="13408665" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <Symbol color="255" backgroundcolor="11184810" bold="true" italic="false" underline="false"/>
  <SymbolA color="0" backgroundcolor="16777215" bold="false" italic="false" underline="false"/>
  <SymbolB color="0" backgroundcolor="16777215" bold="false" italic="false" underline="false"/>
  <SymbolC color="0" backgroundcolor="16777215" bold="false" italic="false" underline="false"/>
  <Comment color="7450225" backgroundcolor="11184810" bold="false" italic="true" underline="false"/>
  <LineComment color="7450225" backgroundcolor="11184810" bold="false" italic="true" underline="false"/>
  <Number color="15453084" backgroundcolor="11184810" bold="true" italic="true" underline="false"/>
  <Hexadecimal color="11010220" backgroundcolor="11184810" bold="true" italic="false" underline="false"/>
  <Text color="10066329" backgroundcolor="11184810" bold="true" italic="false" underline="false"/>
  <URL color="16737843" backgroundcolor="11184810" bold="false" italic="false" underline="true"/>
  <Attribute color="6250445" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <AttributeValue color="33023" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <ASPTag color="33023" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <PHPTag color="33023" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <Keyword0 color="33023" backgroundcolor="11184810" bold="true" italic="false" underline="false"/>
  <Keyword1 color="8388608" backgroundcolor="11184810" bold="true" italic="true" underline="false"/>
  <Keyword2 color="33023" backgroundcolor="11184810" bold="true" italic="false" underline="false"/>
  <Keyword3 color="16744448" backgroundcolor="11184810" bold="false" italic="true" underline="false"/>
  <Keyword4 color="15401195" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <Keyword5 color="15401195" backgroundcolor="11184810" bold="false" italic="true" underline="false"/>
  <Keyword6 color="7405479" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <Keyword7 color="8421504" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <Keyword8 color="0" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <Keyword9 color="15401195" backgroundcolor="11184810" bold="true" italic="true" underline="false"/>
  <Keyword10 color="33023" backgroundcolor="11184810" bold="true" italic="true" underline="false"/>
  <Block0 color="33023" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <Block1 color="32768" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <Block2 color="8388736" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <Block3 color="16711935" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <Block4 color="26367" backgroundcolor="11184810" bold="false" italic="false" underline="false"/>
  <LeftMarginColor text="0" background="15790320" gradient="true" bookmark="16768200" changed="65535" changed-saved="65280"/>
  <LeftMarginLine style="1" color="8421504" icon="0"/>
  <RightMarginLine style="1" color="12632256"/>
</ColorTheme>
In the main menu select: "Environment -> Themes -> Customize..."
There will be the text “All languages” (on the second tab), you need to select PureBasic. Here you can change the color. On the left in the toolbar you need to select the PureBasic syntax.

Despite the fact that I used the one from the link, regular expressions do not work there, only enumerations using the "|" delimiter.

Screenshot
I wouldn’t want to list 3000 functions; it’s much easier to use a regular expression for text ending with a bracket.

%AppData%\Roaming\RJ TextEd\TextEd.ini
add

Code: Select all

[FileExt]
.........
.pb=PureBasic
.pbi=PureBasic

.........

[PureBasic]
Ext=.pb|.pbi
File=PureBasic.syx
ThemeColorStyle=1
Theme=Theme_Default
Keys=3
Tags=0
Blocks=0

[PureBasic Gutter]
ThemeColorStyle=1

[PureBasic FontAndTabs]
ThemeColorStyle=1
Last edited by AZJIO on Wed Sep 25, 2024 7:13 pm, edited 4 times in total.
User avatar
Piero
Addict
Addict
Posts: 923
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Code highlighting for RJ TextEd (?)

Post by Piero »

Does this work for functions? If so, should be more efficient…

Code: Select all

(R(GB(A)?|i(ght|bbonEffect(Color|Width))|Set|o(tate(Material|BillboardGroup|Sprite|Node|C(oordinates|amera)|Entity(Bone)?|Light)|otXMLNode|und(Box)?|ll)|unProgram|Trim|e(s(toreVectorState|ize(Gadget(3D)?|Movie|Billboard|Camera|Image|JSONElements|ParticleEmitter|Window(3D)?)|olveXML(NodeName|AttributeName)|ume(Movie|Sound|Thread|AudioCD)|et(GradientColors|Ma(terial|p)|Coordinates|P(ath|rofiler)|List))|n(derWorld|ameF(ile|TPFile))|ceive(HTTP(Memory|File)|NetworkData|FTPFile)|d|place(RegularExpression|String)|verseString|freshDialog|l(oadMaterial|easeMouse)|ad(Byte|S(tring(Format)?|erialPortData)|C(haracter|GI|onsoleData)|Integer|D(ouble|ata)|UnicodeCharacter|Pr(ogram(String|Data|Error)|eference(String|Integer|Double|Quad|Float|Long))|Quad|F(ile|loat)|Word|Long|AsciiCharacter)|g(isterFontFile|ularExpression(Group(Position|Length)?|Match(String|Position|Length)|NamedGroup(Position|Length)?|Error))|move(Gadget(Column|Item(3D)?)|XMLAttribute|Ma(terialLayer|ilRecipient)|Billboard|S(ysTrayIcon|tring)|ImageFrame|JSON(Member|Element)|Preference(Group|Key)|EnvironmentVariable|KeyboardShortcut|WindowTimer)|AllocateMemory)|a(y(C(ollide|ast)|Pick)|ndom(ize(List|Array)|Seed|Data)?|iseError|dian|wKey))|G(e(nericJoint|t(Runtime(String|Integer|Double)|Gadget(State(3D)?|Color|Text(3D)?|Item(State(3D)?|Color|Text(3D)?|Data(3D)?|Attribute)|Data(3D)?|Font|Attribute(3D)?)|X(ML(Standalone|Node(Name|Text|Offset)|Encoding|Attribute))?|M(usic(Row|Position)|e(shData|nu(TitleText|Item(State|Text)))|a(terial(Color|Attribute)|il(Body|Attribute)))|S(cript(Material|Texture|ParticleEmitter)|ound(Position|Frequency)|erialPortStatus)|H(omeDirectory|TTPHeader)|Y|NodeAnimation(Time|KeyFrame(Roll|X|Y(aw)?|Time|Z|Pitch)|Weight|Length)|C(urrentDirectory|li(pboard(Text|Image)|ent(IP|Port)))|T(oolBarButtonState|e(rrainTile(HeightAtPoint|LayerBlend)|mporaryDirectory))|ImageFrame(Delay)?|Z|Origin(X|Y)|Database(Blob|String|Double|Quad|Float|Long)|U(serDirectory|RLPart)|J(SON(Member|Boolean|String|Integer|Double|Element|Quad|Float)|ointAttribute)|PathPart|E(n(tity(Collision(Group|Mask)|A(nimation(Time|Weight|Length)|ttribute))|vironmentVariable)|xtensionPart)|VehicleAttribute|F(ile(Date|Part|Attributes)|unction(Entry)?|TPDirectory)|W(indow(State|Color|Title(3D)?|Data))?|LightColor|Active(Gadget(3D)?|Window(3D)?)))|adget(X(3D)?|Height(3D)?|Y(3D)?|T(ype(3D)?|oolTip(3D)?)|I(temID|D(3D)?)|Width(3D)?)|r(een|a(dientColor|b(Sprite|Image|DrawingImage))))|XML(Status|Node(Type|Path|From(ID|Path))|ChildCount|Error(Position|Line)?|Attribute(Name|Value))|M(i(nute|d)|o(nth|d|use(RayCast|X|Button|Y|Delta(X|Y)|Pick|Wheel|Locate)|v(ie(S(tatus|eek)|Height|Info|Width|Length|Audio)|e(XMLNode|Memory|Billboard(Group)?|Node|Camera|Text3D|Pa(thCursor|rticleEmitter)|E(ntity(Bone)?|lement)|Light)))|usicVolume|e(s(sageRequester|h(Radius|I(ndex(Count)?|D)|Pose(Name|Count)|Vertex(Normal|Co(unt|lor)|T(extureCoordinate|angent)|Position)?|Face))|nu(Bar|Height|Title|I(tem|D))|rgeLists|moryS(t(atus|ringLength)|ize))|DIGadget|a(t(chRegularExpression|erial(BlendingMode|Sh(ininess|adingMode)|CullingMode|TextureAliases|ID|F(ilteringMode|og)))|i(nXMLNode|lProgress)|p(Size|Key)|keIPAddress))|B(i(n(d(GadgetEvent|MenuEvent|Event))?|llboard(Group(X|Material|Y|Common(Direction|UpVector)|ID|Z)|X|Height|Y|Z|Width|Locate))|o(dyPick|x(edGradient)?)|u(tton(Gadget(3D)?|ImageGadget)|ild(Mesh(ShadowVolume|Tangents|LOD)|StaticGeometry|Terrain))|eginVectorLayer|lue|a(se64(Decoder(Buffer)?|Encoder(Buffer)?)|ckColor))|S(ho(w(GUI|MemoryViewer|Callstack|DebugOutput|Profiler|VariableViewer|Watchlist|LibraryViewer|AssemblyViewer)|rtcutGadget)|ysTrayIconToolTip|c(intilla(Gadget|SendMessage)|ale(Material|Node|Coordinates|Text3D|Entity)|r(oll(Material|BarGadget(3D)?|AreaGadget(3D)?)|een(Mode(RefreshRate|Height|Depth|Width)|Height|ID|Output|Depth|Width)))|t(ickyWindow|op(M(ovie|usic)|Sound(3D)?|NodeAnimation|Drawing|Pr(inting|ofiler)|EntityAnimation|VectorDrawing|AudioCD)|a(tusBar(Height|Text|I(D|mage)|Progress)|rt(NodeAnimation|Drawing|Pr(inting|ofiler)|EntityAnimation|VectorDrawing|Fingerprint|AESCipher))|r(ing(Gadget(3D)?|ByteLength|Fi(ngerprint|eld))|okePath|D|U|F)?)|i(n(H)?|gn(alSemaphore)?)|o(und(Range3D|Status|Cone3D|ID3D|Pan|Volume(3D)?|L(istenerLocate|ength))|rt(Structured(List|Array)|List|Array))|u(n|bMeshCount)|p(inGadget(3D)?|otLightRange|li(ne(X|Y|Z|Point(X|Y|Z))|t(terGadget|List))|ace|rite(BlendingMode|Height|Collision|ID|Output|Depth|PixelCollision|Quality|Width))|e(nd(Mail|Network(String|Data)|FTPFile)|cond(WorldCollisionEntity)?|t(R(untime(String|Integer|Double)|enderQueue)|G(UITheme3D|adget(State(3D)?|Color|Text(3D)?|Item(State(3D)?|Color|Text(3D)?|Image|Data(3D)?|Attribute)|Data(3D)?|Font|Attribute(3D)?))|XML(Standalone|Node(Name|Text|Offset)|Encoding|Attribute)|M(usicPosition|e(sh(Material|Data)|nu(TitleText|Item(State|Text)))|a(terial(Color|Attribute)|il(Body|Attribute)))|S(ound(Position|Frequency)|erialPortStatus)|NodeAnimation(Time|KeyFrame(Rotation|Scale|Position)|Weight|Length)|C(urrentDirectory|lipboard(Text|Image))|upTerrains|T(oolBarButtonState|errainTile(HeightAtPoint|LayerBlend))|ImageFrame(Delay)?|Ori(entation|gin)|D(atabase(Blob|String|Null|Double|Quad|Float|Long)|r(opCallback|agCallback))|URLPart|J(SON(Boolean|String|Null|Integer|Object|Double|Quad|Float|Array)|ointAttribute)|En(tity(Material|CollisionFilter|A(nimation(Time|Weight|Length)|ttribute))|vironmentVariable)|VehicleAttribute|F(ile(Date|Attributes)|TPDirectory|rameRate)|Window(State|C(olor|allback)|Title(3D)?|Data)|LightColor|Active(Gadget(3D)?|Window(3D)?))|lect(edF(ilePattern|ont(S(tyle|ize)|Name|Color))|Element)|r(ialPort(Timeouts|ID|Error)|verID))|vgVectorOutput|k(y(Box|Dome)|ewCoordinates)|qr|w(itchCamera|apElements)|liderJoint|ave(RenderTexture|XML|Mesh|Sprite|Terrain|Image|DebugOutput|JSON|VectorState|FileRequester)|martWindowRefresh)|H(yperLinkGadget|i(ngeJoint(MotorTarget)?|de(Gadget(3D)?|Menu|BillboardGroup|ParticleEmitter|E(ntity|ffect)|Window(3D)?|Light))|o(stName|ur)|TTP(Request(Memory)?|Memory|Info|Pro(gress|xy))|ex)|Y(ear|aw)|N(o(de(Roll|X|Y(aw)?|ID|Z|Pitch|FixedYawAxis|LookAt|AnimationStatus)|rmal(X|izeMesh|Y|Z))|e(twork(ServerEvent|ClientEvent)|w(PrinterPage|VectorPage)|xt(RegularExpressionMatch|XML(Node|Attribute)|MapElement|S(creenMode|electedFilename)|I(nstruction|PAddress)|D(irectoryEntry|atabase(Row|Driver))|JSONMember|P(ackEntry|reference(Group|Key))|E(nvironmentVariable|lement)|FTPDirectoryEntry|WorldCollision|LibraryFunction))|aN)|C(h(ildXMLNode|eck(BoxGadget(3D)?|ObjectVisibility|DatabaseNull|F(ilename|TPConnection))|ange(Gamma|SysTrayIcon|CurrentElement|ListIconGadgetDisplay)|r)|GI(Buffer|Cookie(Name|Value)|Parameter(Name|Type|Data(Size)?|Value)|Variable)|irc(ularGradient|le)|o(s(H)?|n(sole(C(olor|ursor)|Title|Error|Locate)|nectionID|tainerGadget(3D)?|icalGradient|eTwistJoint|vert(Coordinate(X|Y)|WorldToLocalPosition|LocalToWorldPosition))|coaMessage|unt(RegularExpressionGroups|GadgetItems(3D)?|MaterialLayers|Billboards|S(tring|plinePoints)|C(GI(Cookies|Parameters)|PUs)|ProgramParameters|Li(st|braryFunctions))|py(XMLNode|M(e(sh|mory(String)?)|a(terial|p))|Sprite|Texture|Image|D(irectory|ebugOutput)|Entity|File|Li(st|ght)|Array)|lorRequester|m(p(os(itorEffectParameter|e(XML|JSON))|ute(Spline|rName)|areMemory(String)?|ressMemory)|boBoxGadget(3D)?))|ustom(Gradient|DashPath|FilterCallback)|PUName|l(ip(Sprite|Output|Path)|ose(GadgetList(3D)?|S(creen|ubMenu|erialPort)|Help|Network(Server|Connection)|C(onsole|ryptRandom)|D(ebugOutput|atabase)|P(a(ck|th)|r(ogram|eferences))|F(ile|TP)|Window(3D)?|Library)|ear(GadgetItem(s(3D)?|List)|Map|Billboards|S(creen|pline)|C(onsole|lipboard)|DebugOutput|JSON(Members|Elements)|List))|a(nvas(Gadget|Output|VectorOutput)|tch(XML|Music|S(ound|prite)|Image|JSON)|l(endarGadget|l(CFunction(Fast)?|Function(Fast)?))|mera(R(oll|e(nderMode|flection)|ange)|X|BackColor|Y(aw)?|CustomParameter|ID|Z|Direction(X|Y|Z)?|P(itch|rojection(X|Mode|Y))|View(X|Height|Y|Width)|F(ixedYawAxis|ollow|OV)|LookAt))|r(yptRandom(Data)?|eate(R(ibbonEffect|e(nderTexture|gularExpression))|GadgetList|XML(Node)?|M(utex|e(sh|nu)|a(terial|il))|BillboardGroup|S(tat(icGeometry|usBar)|p(here|line|rite)|emaphore)|N(ode(Animation(KeyFrame)?)?|etworkServer)|C(ylinder|o(ne|mpositorEffect)|ube(MapTexture)?|a(psule|mera))|T(hread|o(olBar|rus)|ube|e(rrain(Body)?|xt(ure|3D)))|I(coSphere|mage(Menu)?)|D(i(alog|rectory)|ataMesh)|JSON|P(opup(Menu|ImageMenu)|lane|a(ck|rticleEmitter)|references)|Entity(Body)?|Ve(hicle(Body)?|rtex(Track|PoseKeyFrame|Animation))|F(ile|TPDirectory)|Water|L(i(ne3D|ght)|ensFlareEffect))))|T(hread(ID|Priority)|oolBar(ButtonText|S(tandardButton|eparator)|Height|ToolTip|I(D|mageButton))|e(rrain(RenderMode|MousePick|Height|Tile(Size|HeightAtPosition|Point(X|Y)|LayerMapSize)|Locate)|xt(Gadget(3D)?|Height|ure(Height|ID|Output|Width)|3D(C(olor|aption)|ID|Alignment)|Width))|an(H)?|r(y(Semaphore|LockMutex)|im|uncateFile|eeGadget|a(ns(parentSpriteColor|form(Mesh|Sprite)|lateCoordinates)|ckBarGadget)))|I(s(R(untime|egularExpression)|Gadget(3D)?|XML|M(ovie|usic|e(sh|nu)|a(terial|il))|BillboardGroup|S(ysTrayIcon|creenActive|tat(icGeometry|usBar)|ound(3D)?|prite|erialPort)|N(ode|aN)|Camera|T(hread|oolBar|ext(ure|3D))|I(n(side(Stroke|Path)|finity)|mage)|D(i(alog|rectory)|atabase)|J(SON|oint)|P(a(thEmpty|rticleEmitter)|rogram)|E(ntity|ffect)|F(tp|i(ngerprint|le)|ont)|Window(3D)?|Li(ght|brary))|n(s(truction(String|Address)|ert(XML(Map|Structure|List|Array)|String|JSON(Map|Structure|List|Array)|Element))|t(Q)?|it(Mo(use|vie)|S(cintilla|ound|prite)|Network|CGI|Joystick|Engine3D|Keyboard|FastCGI|AudioCD)|put(Requester|Event3D)?|key|finity)|P(String|Address(Gadget|Field))|mage(Gadget(3D)?|Height|ID|Output|Depth|VectorOutput|F(ormat|rameCount)|Width))|ZoomSprite|O(nError(Goto|Call|Default|Exit)|SVersion|utput(Height|Depth|Width)|p(tionGadget(3D)?|en(G(adgetList(3D)?|LGadget)|XMLDialog|S(creen|ubMenu|erialPort)|Help|NetworkConnection|C(onsole|ryptRandom)|Database(Requester)?|P(ack|references)|F(ile(Requester)?|TP)|Window(3D|edScreen)?|Library)))|D(i(s(play(Sprite|TransparentSprite|PopupMenu)|able(Gadget(3D)?|M(enuItem|aterialLighting)|ToolBarButton|ParticleEmitter|EntityBody|Window(3D)?|LightShadows))|alog(Gadget|ID|Error|Window)|rectoryEntry(Size|Name|Type|Date|Attributes))|o(tPath|ubleClickTime)|e(sktop(Resolution(X|Y)|X|Mouse(X|Y)|Scaled(X|Y)|Height|Y|Name|Depth|Unscaled(X|Y)|Frequency|Width)|tach(RibbonEffect|NodeObject|EntityObject)|f(ineTerrainTile|aultPrinter)|l(ete(XMLNode|MapElement|Directory|Element|F(ile|TP(Directory|File)))|ay)|gree|bugger(Error|Warning))|ESFingerprint|a(shPath|y(Of(Year|Week))?|t(e(Gadget)?|abase(Column(s|Size|Name|Type|Index)|ID|Driver(Name|Description)|Update|Error|Query)))|ra(w(RotatedText|ing(Mode|Buffer(Pi(tch|xelFormat))?|Font)|Text|Image|Vector(Text|Image|Paragraph)|AlphaImage)|g(Text|Image|OSFormats|Private|Files)))|U(se(G(IFImageDecoder|adgetList)|M(ySQLDatabase|D5Fingerprint)|BriefLZPacker|S(HA(1Fingerprint|2Fingerprint|3Fingerprint)|QLiteDatabase)|CRC32Fingerprint|T(GAImageDecoder|IFFImageDecoder|arPacker)|ZipPacker|O(GGSoundDecoder|DBCDatabase)|J(CALG1Packer|PEG(2000Image(Decoder|Encoder)|Image(Decoder|Encoder)))|P(ostgreSQLDatabase|NGImage(Decoder|Encoder))|rName|FLACSoundDecoder|LZMAPacker|AudioCD)|RL(Decoder|Encoder)|n(c(ompress(Memory|Pack(Memory|File))|lipOutput)|escapeString|lockMutex|bind(GadgetEvent|MenuEvent|Event))|Case|TF8|pdate(RenderTexture|Mesh(BoundingBox)?|SplinePoint|Terrain(TileLayerBlend)?|EntityAnimation|VertexPoseReference))|J(SON(Member(Value|Key)|Type|ObjectSize|Error(Message|Position|Line)|Value|ArraySize)|oystick(Button|Name|Axis(X|Y|Z)))|P(i(ck(X|Y|Z)|tch)|o(stEvent|int(Joint|Pick)?|p(MapPosition|ListPosition)|ke(B|S|C|I|D|U|Q|F|W|L|A)|w)|dfVectorOutput|u(sh(MapPosition|ListPosition)|rifierGranularity)|eek(B|S|C|I|D|U|Q|F|W|L|A)|l(ot|ay(M(ovie|usic)|Sound(3D)?|AudioCD))|a(nelGadget(3D)?|ckEntry(Size|Name|Type)|th(Requester|Bounds(X|Height|Y|Width)|Segments|Cursor(X|Y)|Point(X|Y|Angle)|Length)|use(Movie|Sound|Thread|AudioCD)|r(se(XML|3DScripts|Date|JSON)|ticle(Material|S(caleRate|ize|peedFactor)|Color(Range|Fader)|TimeToLive|Emi(ssionRate|tter(X|Y|ID|Z|Direction|Angle))|Velocity|A(ngle|cceleration))|entXMLNode))|r(int(Requester|N|er(Output|Page(Height|Width)|VectorOutput))?|ogr(essBarGadget(3D)?|am(Running|ID|Parameter|ExitCode|Filename))|e(vious(XMLNode|DatabaseRow|Element)|ference(Group(Name)?|Comment|Key(Name|Value)))))|E(scapeString|n(codeImage|tity(R(oll|enderMode)|X|Bo(ne(Roll|X|Y(aw)?|Z|Pitch)|undingBox)|Y(aw)?|C(ollide|u(stomParameter|beMapTexture))|ID|Z|Direction(X|Y|Z)?|P(itch|arentNode)|Velocity|FixedYawAxis|L(inearFactor|ookAt)|An(imation(BlendMode|Status)|gularFactor))|dVectorLayer|vironmentVariable(Name|Value)|able(G(adgetDrop|raphicalConsole)|ManualEntityBoneControl|HingeJointAngularMotor|W(indowDrop|orld(Collisions|Physics)))|gine3DStatus)|of|ditorGadget(3D)?|jectAudioCD|vent(Gadget(3D)?|Menu|Server|Client|T(ype(3D)?|imer)|D(ata|rop(X|Buffer|Size|Y|T(ype|ext)|Image|Private|Files|Action))|wParam|lParam|Window(3D)?)?|l(lip(se|ticalGradient)|apsedMilliseconds)|rror(Register|Message|Code|TargetAddress|File|Line|Address)|x(tract(RegularExpression|XML(Map|Structure|List|Array)|JSON(Map|Structure|List|Array))|p(ort(XML(Size)?|JSON(Size)?)|lorer(ComboGadget|TreeGadget|ListGadget))?|amine(RegularExpression|XMLAttributes|Mouse|ScreenModes|IPAddresses|D(irectory|esktops|atabaseDrivers)|J(SONMembers|oystick)|P(ack|reference(Groups|Keys))|EnvironmentVariables|Keyboard|FTPDirectory|WorldCollisions|LibraryFunctions|Assembly)))|V(e(ctor(Resolution(X|Y)|Source(GradientColor|C(ircularGradient|olor)|Image|LinearGradient)|Text(Height|Width)|Output(Height|Width)|Unit|ParagraphHeight|Font)|rtexPoseReferenceCount)|al(D|F)?)|K(ill(Thread|Program)|eyboard(Released|Mode|Inkey|Pushed))|F(i(n(ish(Mesh|HTTP|Cipher|D(irectory|atabaseQuery)|F(ingerprint|TPDirectory|astCGIRequest))|d(MapElement|String)|gerprint)|l(e(BuffersSize|S(ize|eek)|ID|Fingerprint)|l(Memory|Path|VectorOutput|Area))|rst(DatabaseRow|Element|WorldCollisionEntity))|o(nt(Requester|ID)|rmat(XML|Number|Date)|g)|TP(DirectoryEntry(Raw|Size|Name|Type|Date|Attributes)|Progress)|etch(Orientation|EntityMaterial)|l(ip(Buffers|Coordinates(X|Y))|ush(PreferenceBuffers|FileBuffers))|r(ontColor|ee(RegularExpression|Gadget(3D)?|XML|M(ovie|u(sic|tex)|e(sh|nu|mory)|a(terial|il|p))|BillboardGroup|S(t(at(icGeometry|usBar)|ructure)|ound(3D)?|p(line|rite)|emaphore)|Node(Animation)?|Camera|T(oolBar|e(rrain(Body)?|xt(ure|3D)))|I(P|mage)|Dialog|J(SON|oint)|ParticleEmitter|E(ntity(Body|Joints)?|ffect)|Font|Water|Li(st|ght)|Array)|ameGadget(3D)?))|W(indow(X(3D)?|Mouse(X|Y)|Bounds|Height(3D)?|Y(3D)?|ID(3D)?|Output|Event(3D)?|VectorOutput|Width(3D)?)|orld(Gravity|Shadows|Collision(Normal|Contact|AppliedImpulse)|Debug)|ebGadget(Path)?|a(ter(Height|Color)|it(Semaphore|Thread|Program|FastCGIRequest|WindowEvent))|rite(Byte|S(tring(N|Format)?|erialPort(String|Data))|C(haracter|GI(String(N)?|Header|Data|File)|onsoleData)|Integer|D(ouble|ata)|UnicodeCharacter|Pr(ogram(String(N)?|Data)|eference(String|Integer|Double|Quad|Float|Long))|Quad|Float|Word|Long|AsciiCharacter))|L(i(st(Size|I(ndex|conGadget)|ViewGadget(3D)?)|ne(XY|arGradient)?|ght(Roll|X|Y(aw)?|ID|Z|Direction(X|Y|Z)?|Pitch|LookAt|Attenuation)|brary(ID|Function(Name|Address)))|Set|o(c(kMutex)?|f|ad(XML|M(ovie|usic|esh)|S(ound(3D)?|prite)|Texture|Image|JSON|Font|World)|g(10)?)|Case|Trim|e(n(sFlareEffectColor)?|ft)|astElement)|A(sc(ii)?|ntialiasingMode|ttach(RibbonEffect|NodeObject|EntityObject)|Sin(H)?|dd(Gadget(Column|Item(3D)?)|M(eshManualLOD|a(terialLayer|il(Recipient|Attachment(Data)?)|pElement))|Billboard|S(ysTrayIcon|tat(icGeometryEntity|usBarField)|ub(Mesh|Entity)|plinePoint)|NodeAnimationTime|CipherBuffer|TerrainTexture|ImageFrame|3DArchive|Date|JSON(Member|Element)|Pa(ck(Memory|File)|th(Box|Segments|C(ircle|urve)|Text|Ellipse|Line|Arc))|E(ntityAnimationTime|lement)|Ve(hicleWheel|rtexPoseReference)|KeyboardShortcut|FingerprintBuffer|WindowTimer)|Cos(H)?|udioCD(Status|Name|Track(s|Seconds|Length)|Length)|Tan(H|2)?|pply(Entity(Torque(Impulse)?|Impulse|Force)|Vehicle(Brake|Steering|Force))|vailable(SerialPort(Input|Output)|ProgramOutput)|ffectedDatabaseRows|ES(Decoder|Encoder)|l(pha(Blend)?|locate(Memory|Structure))|rraySize|mbientColor|b(s|ort(HTTP|FTPFile))))
User avatar
Piero
Addict
Addict
Posts: 923
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Code highlighting for RJ TextEd (?)

Post by Piero »

AZJIO wrote: Thu Sep 19, 2024 8:28 amregular expressions do not work there
Seems you need to use #
https://www.rj-texted.se/Help/topics/keywords.htm
AZJIO
Addict
Addict
Posts: 2191
Joined: Sun May 14, 2017 1:48 am

Re: Code highlighting for RJ TextEd (?)

Post by AZJIO »

Piero wrote: Wed Sep 25, 2024 4:26 pm
AZJIO wrote: Thu Sep 19, 2024 8:28 amregular expressions do not work there
Seems you need to use #
https://www.rj-texted.se/Help/topics/keywords.htm
Thanks, it works.
I updated the code highlighting list by adding regular expressions
User avatar
Piero
Addict
Addict
Posts: 923
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Code highlighting for RJ TextEd (?)

Post by Piero »

AZJIO wrote: Wed Sep 25, 2024 4:35 pmThanks
You are VERY welcome (you know I'm your Fan)
The above "function list to regexp" was done using Ruby, and is taken from TextMate (this is a subtle way to suggest you to GET A MAC :mrgreen: )

Code: Select all

#!/usr/bin/env ruby18
#
#  list_to_regexp.rb
#  Created by Allan Odgaard on 2005-11-28.
#
#  Takes list of matches on successive lines and outputs
#  a compact regexp which will match any of the elements
#  in the list
#

def process_list (list)

  buckets = { }
  optional = false

  list.each do |str|
    if str.empty? then
      optional = true
    else
      ch = str.shift
      buckets[ch] = (buckets[ch] or []).push(str)
    end
  end

  unless buckets.empty? then
    ptrns = buckets.collect do |key, value|
      [key].pack('C') + process_list(value).to_s
    end

    if optional == true then
      "(" + ptrns.join("|") + ")?"
    elsif ptrns.length > 1 then
      "(" + ptrns.join("|") + ")"
    else
      ptrns
    end
  end

end

print process_list(STDIN.collect { |line| line.chomp.unpack('C*') })
Post Reply