]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/purebasic.js
1 /*! `purebasic` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
8 Author: Tristano Ajmone <tajmone@gmail.com>
9 Description: Syntax highlighting for PureBASIC (v.5.00-5.60). No inline ASM highlighting. (v.1.2, May 2017)
10 Credits: I've taken inspiration from the PureBasic language file for GeSHi, created by Gustavo Julio Fiorenza (GuShH).
11 Website: https://www.purebasic.com
15 // Base deafult colors in PB IDE: background: #FFFFDF; foreground: #000000;
17 function purebasic(hljs
) {
18 const STRINGS
= { // PB IDE color: #0080FF (Azure Radiance)
24 const CONSTANTS
= { // PB IDE color: #924B72 (Cannon Pink)
25 // "#" + a letter or underscore + letters, digits or underscores + (optional) "$"
27 begin: '#[a-zA-Z_]\\w*\\$?'
36 keywords: // PB IDE color: #006666 (Blue Stone) + Bold
37 // Keywords from all version of PureBASIC 5.00 upward ...
38 'Align And Array As Break CallDebugger Case CompilerCase CompilerDefault '
39 + 'CompilerElse CompilerElseIf CompilerEndIf CompilerEndSelect CompilerError '
40 + 'CompilerIf CompilerSelect CompilerWarning Continue Data DataSection Debug '
41 + 'DebugLevel Declare DeclareC DeclareCDLL DeclareDLL DeclareModule Default '
42 + 'Define Dim DisableASM DisableDebugger DisableExplicit Else ElseIf EnableASM '
43 + 'EnableDebugger EnableExplicit End EndDataSection EndDeclareModule EndEnumeration '
44 + 'EndIf EndImport EndInterface EndMacro EndModule EndProcedure EndSelect '
45 + 'EndStructure EndStructureUnion EndWith Enumeration EnumerationBinary Extends '
46 + 'FakeReturn For ForEach ForEver Global Gosub Goto If Import ImportC '
47 + 'IncludeBinary IncludeFile IncludePath Interface List Macro MacroExpandedCount '
48 + 'Map Module NewList NewMap Next Not Or Procedure ProcedureC '
49 + 'ProcedureCDLL ProcedureDLL ProcedureReturn Protected Prototype PrototypeC ReDim '
50 + 'Read Repeat Restore Return Runtime Select Shared Static Step Structure '
51 + 'StructureUnion Swap Threaded To UndefineMacro Until Until UnuseModule '
52 + 'UseModule Wend While With XIncludeFile XOr',
54 // COMMENTS | PB IDE color: #00AAAA (Persian Green)
55 hljs
.COMMENT(';', '$', { relevance: 0 }),
57 { // PROCEDURES DEFINITIONS
58 className: 'function',
59 begin: '\\b(Procedure|Declare)(C|CDLL|DLL)?\\b',
64 { // PROCEDURE KEYWORDS | PB IDE color: #006666 (Blue Stone) + Bold
66 begin: '(Procedure|Declare)(C|CDLL|DLL)?',
69 { // PROCEDURE RETURN TYPE SETTING | PB IDE color: #000000 (Black)
74 hljs
.UNDERSCORE_TITLE_MODE
// PROCEDURE NAME | PB IDE color: #006666 (Blue Stone)
83 /* ==============================================================================
85 ==============================================================================
87 -- BUG-FIX: Some keywords were accidentally joyned together. Now fixed.
89 -- Updated to PureBASIC 5.60.
90 -- Keywords list now built by extracting them from the PureBASIC SDK's
91 "SyntaxHilighting.dll" (from each PureBASIC version). Tokens from each
92 version are added to the list, and renamed or removed tokens are kept
93 for the sake of covering all versions of the language from PureBASIC
94 v5.00 upward. (NOTE: currently, there are no renamed or deprecated
95 tokens in the keywords list). For more info, see:
96 -- http://www.purebasic.fr/english/viewtopic.php?&p=506269
97 -- https://github.com/tajmone/purebasic-archives/tree/master/syntax-highlighting/guidelines
100 -- Keywords list taken and adapted from GuShH's (Gustavo Julio Fiorenza)
101 PureBasic language file for GeSHi:
102 -- https://github.com/easybook/geshi/blob/master/geshi/purebasic.php
109 hljs
.registerLanguage('purebasic', hljsGrammar
);