Skip to content

Commit

Permalink
Purebasic: Added support for pointer to string operator (#3362)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeX0R101 committed Mar 2, 2022
1 parent b53832c commit 499b1fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/prism-purebasic.js
Expand Up @@ -12,7 +12,7 @@ Prism.languages.purebasic = Prism.languages.extend('clike', {
'keyword': /\b(?:align|and|as|break|calldebugger|case|compilercase|compilerdefault|compilerelse|compilerelseif|compilerendif|compilerendselect|compilererror|compilerif|compilerselect|continue|data|datasection|debug|debuglevel|declare|declarec|declarecdll|declaredll|declaremodule|default|define|dim|disableasm|disabledebugger|disableexplicit|else|elseif|enableasm|enabledebugger|enableexplicit|end|enddatasection|enddeclaremodule|endenumeration|endif|endimport|endinterface|endmacro|endmodule|endprocedure|endselect|endstructure|endstructureunion|endwith|enumeration|extends|fakereturn|for|foreach|forever|global|gosub|goto|if|import|importc|includebinary|includefile|includepath|interface|macro|module|newlist|newmap|next|not|or|procedure|procedurec|procedurecdll|proceduredll|procedurereturn|protected|prototype|prototypec|read|redim|repeat|restore|return|runtime|select|shared|static|step|structure|structureunion|swap|threaded|to|until|wend|while|with|xincludefile|xor)\b/i,
'function': /\b\w+(?:\.\w+)?\s*(?=\()/,
'number': /(?:\$[\da-f]+|\b-?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)\b/i,
'operator': /(?:@\*?|\?|\*)\w+|-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*/@]/
'operator': /(?:@\*?|\?|\*)\w+\$?|-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*/@]/
});

Prism.languages.insertBefore('purebasic', 'keyword', {
Expand Down
2 changes: 1 addition & 1 deletion components/prism-purebasic.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion tests/languages/purebasic/operator_feature.test
@@ -1,13 +1,15 @@
< <=
> >=
+ - *
@ab$

----------------------------------------------------

[
["operator", "<"], ["operator", "<="],
["operator", ">"], ["operator", ">="],
["operator", "+"], ["operator", "-"], ["operator", "*"]
["operator", "+"], ["operator", "-"], ["operator", "*"],
["operator", "@ab$"]
]

----------------------------------------------------
Expand Down

0 comments on commit 499b1fa

Please sign in to comment.