source: node_modules/refractor/lang/peoplecode.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.7 KB
Line 
1'use strict'
2
3module.exports = peoplecode
4peoplecode.displayName = 'peoplecode'
5peoplecode.aliases = ['pcode']
6function peoplecode(Prism) {
7 Prism.languages.peoplecode = {
8 comment: RegExp(
9 [
10 // C-style multiline comments
11 /\/\*[\s\S]*?\*\//.source, // REM comments
12 /\bREM[^;]*;/.source, // Nested <* *> comments
13 /<\*(?:[^<*]|\*(?!>)|<(?!\*)|<\*(?:(?!\*>)[\s\S])*\*>)*\*>/.source, // /+ +/ comments
14 /\/\+[\s\S]*?\+\//.source
15 ].join('|')
16 ),
17 string: {
18 pattern: /'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,
19 greedy: true
20 },
21 variable: /%\w+/,
22 'function-definition': {
23 pattern: /((?:^|[^\w-])(?:function|method)\s+)\w+/i,
24 lookbehind: true,
25 alias: 'function'
26 },
27 'class-name': {
28 pattern:
29 /((?:^|[^-\w])(?:as|catch|class|component|create|extends|global|implements|instance|local|of|property|returns)\s+)\w+(?::\w+)*/i,
30 lookbehind: true,
31 inside: {
32 punctuation: /:/
33 }
34 },
35 keyword:
36 /\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,
37 'operator-keyword': {
38 pattern: /\b(?:and|not|or)\b/i,
39 alias: 'operator'
40 },
41 function: /[_a-z]\w*(?=\s*\()/i,
42 boolean: /\b(?:false|true)\b/i,
43 number: /\b\d+(?:\.\d+)?\b/,
44 operator: /<>|[<>]=?|!=|\*\*|[-+*/|=@]/,
45 punctuation: /[:.;,()[\]]/
46 }
47 Prism.languages.pcode = Prism.languages.peoplecode
48}
Note: See TracBrowser for help on using the repository browser.