prism-peoplecode.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. Prism.languages.peoplecode = {
  2. 'comment': RegExp([
  3. // C-style multiline comments
  4. /\/\*[\s\S]*?\*\//.source,
  5. // REM comments
  6. /\bREM[^;]*;/.source,
  7. // Nested <* *> comments
  8. /<\*(?:[^<*]|\*(?!>)|<(?!\*)|<\*(?:(?!\*>)[\s\S])*\*>)*\*>/.source,
  9. // /+ +/ comments
  10. /\/\+[\s\S]*?\+\//.source,
  11. ].join('|')),
  12. 'string': {
  13. pattern: /'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,
  14. greedy: true
  15. },
  16. 'variable': /%\w+/,
  17. 'function-definition': {
  18. pattern: /((?:^|[^\w-])(?:function|method)\s+)\w+/i,
  19. lookbehind: true,
  20. alias: 'function'
  21. },
  22. 'class-name': {
  23. pattern: /((?:^|[^-\w])(?:as|catch|class|component|create|extends|global|implements|instance|local|of|property|returns)\s+)\w+(?::\w+)*/i,
  24. lookbehind: true,
  25. inside: {
  26. 'punctuation': /:/
  27. }
  28. },
  29. 'keyword': /\b(?:abstract|alias|as|catch|class|component|constant|create|declare|else|end-(?:class|evaluate|for|function|get|if|method|set|try|while)|evaluate|extends|for|function|get|global|if|implements|import|instance|library|local|method|null|of|out|peopleCode|private|program|property|protected|readonly|ref|repeat|returns?|set|step|then|throw|to|try|until|value|when(?:-other)?|while)\b/i,
  30. 'operator-keyword': {
  31. pattern: /\b(?:and|not|or)\b/i,
  32. alias: 'operator'
  33. },
  34. 'function': /[_a-z]\w*(?=\s*\()/i,
  35. 'boolean': /\b(?:false|true)\b/i,
  36. 'number': /\b\d+(?:\.\d+)?\b/,
  37. 'operator': /<>|[<>]=?|!=|\*\*|[-+*/|=@]/,
  38. 'punctuation': /[:.;,()[\]]/
  39. };
  40. Prism.languages.pcode = Prism.languages.peoplecode;