purebasic.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. module.exports = // Base deafult colors in PB IDE: background: #FFFFDF; foreground: #000000;
  2. function(hljs) {
  3. var STRINGS = { // PB IDE color: #0080FF (Azure Radiance)
  4. className: 'string',
  5. begin: '(~)?"', end: '"',
  6. illegal: '\\n'
  7. };
  8. var CONSTANTS = { // PB IDE color: #924B72 (Cannon Pink)
  9. // "#" + a letter or underscore + letters, digits or underscores + (optional) "$"
  10. className: 'symbol',
  11. begin: '#[a-zA-Z_]\\w*\\$?'
  12. };
  13. return {
  14. aliases: ['pb', 'pbi'],
  15. keywords: // PB IDE color: #006666 (Blue Stone) + Bold
  16. // The following keywords list was taken and adapted from GuShH's PureBasic language file for GeSHi...
  17. 'And As Break CallDebugger Case CompilerCase CompilerDefault CompilerElse CompilerEndIf CompilerEndSelect ' +
  18. 'CompilerError CompilerIf CompilerSelect Continue Data DataSection EndDataSection Debug DebugLevel ' +
  19. 'Default Define Dim DisableASM DisableDebugger DisableExplicit Else ElseIf EnableASM ' +
  20. 'EnableDebugger EnableExplicit End EndEnumeration EndIf EndImport EndInterface EndMacro EndProcedure ' +
  21. 'EndSelect EndStructure EndStructureUnion EndWith Enumeration Extends FakeReturn For Next ForEach ' +
  22. 'ForEver Global Gosub Goto If Import ImportC IncludeBinary IncludeFile IncludePath Interface Macro ' +
  23. 'NewList Not Or ProcedureReturn Protected Prototype ' +
  24. 'PrototypeC Read ReDim Repeat Until Restore Return Select Shared Static Step Structure StructureUnion ' +
  25. 'Swap To Wend While With XIncludeFile XOr ' +
  26. 'Procedure ProcedureC ProcedureCDLL ProcedureDLL Declare DeclareC DeclareCDLL DeclareDLL',
  27. contains: [
  28. // COMMENTS | PB IDE color: #00AAAA (Persian Green)
  29. hljs.COMMENT(';', '$', {relevance: 0}),
  30. { // PROCEDURES DEFINITIONS
  31. className: 'function',
  32. begin: '\\b(Procedure|Declare)(C|CDLL|DLL)?\\b',
  33. end: '\\(',
  34. excludeEnd: true,
  35. returnBegin: true,
  36. contains: [
  37. { // PROCEDURE KEYWORDS | PB IDE color: #006666 (Blue Stone) + Bold
  38. className: 'keyword',
  39. begin: '(Procedure|Declare)(C|CDLL|DLL)?',
  40. excludeEnd: true
  41. },
  42. { // PROCEDURE RETURN TYPE SETTING | PB IDE color: #000000 (Black)
  43. className: 'type',
  44. begin: '\\.\\w*'
  45. // end: ' ',
  46. },
  47. hljs.UNDERSCORE_TITLE_MODE // PROCEDURE NAME | PB IDE color: #006666 (Blue Stone)
  48. ]
  49. },
  50. STRINGS,
  51. CONSTANTS
  52. ]
  53. };
  54. };