diff options
Diffstat (limited to 'source/assets/languages/prism-pascal.js')
| -rw-r--r-- | source/assets/languages/prism-pascal.js | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/source/assets/languages/prism-pascal.js b/source/assets/languages/prism-pascal.js new file mode 100644 index 0000000..bc7a283 --- /dev/null +++ b/source/assets/languages/prism-pascal.js | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | // Based on Free Pascal | ||
| 2 | |||
| 3 | /* TODO | ||
| 4 | Support inline asm ? | ||
| 5 | */ | ||
| 6 | |||
| 7 | Prism.languages.pascal = { | ||
| 8 | 'comment': [ | ||
| 9 | /\(\*[\s\S]+?\*\)/, | ||
| 10 | /\{[\s\S]+?\}/, | ||
| 11 | /\/\/.*/ | ||
| 12 | ], | ||
| 13 | 'string': { | ||
| 14 | pattern: /(?:'(?:''|[^'\r\n])*'|#[&$%]?[a-f\d]+)+|\^[a-z]/i, | ||
| 15 | greedy: true | ||
| 16 | }, | ||
| 17 | 'keyword': [ | ||
| 18 | { | ||
| 19 | // Turbo Pascal | ||
| 20 | pattern: /(^|[^&])\b(?:absolute|array|asm|begin|case|const|constructor|destructor|do|downto|else|end|file|for|function|goto|if|implementation|inherited|inline|interface|label|nil|object|of|operator|packed|procedure|program|record|reintroduce|repeat|self|set|string|then|to|type|unit|until|uses|var|while|with)\b/i, | ||
| 21 | lookbehind: true | ||
| 22 | }, | ||
| 23 | { | ||
| 24 | // Free Pascal | ||
| 25 | pattern: /(^|[^&])\b(?:dispose|exit|false|new|true)\b/i, | ||
| 26 | lookbehind: true | ||
| 27 | }, | ||
| 28 | { | ||
| 29 | // Object Pascal | ||
| 30 | pattern: /(^|[^&])\b(?:class|dispinterface|except|exports|finalization|finally|initialization|inline|library|on|out|packed|property|raise|resourcestring|threadvar|try)\b/i, | ||
| 31 | lookbehind: true | ||
| 32 | }, | ||
| 33 | { | ||
| 34 | // Modifiers | ||
| 35 | pattern: /(^|[^&])\b(?:absolute|abstract|alias|assembler|bitpacked|break|cdecl|continue|cppdecl|cvar|default|deprecated|dynamic|enumerator|experimental|export|external|far|far16|forward|generic|helper|implements|index|interrupt|iochecks|local|message|name|near|nodefault|noreturn|nostackframe|oldfpccall|otherwise|overload|override|pascal|platform|private|protected|public|published|read|register|reintroduce|result|safecall|saveregisters|softfloat|specialize|static|stdcall|stored|strict|unaligned|unimplemented|varargs|virtual|write)\b/i, | ||
| 36 | lookbehind: true | ||
| 37 | } | ||
| 38 | ], | ||
| 39 | 'number': [ | ||
| 40 | // Hexadecimal, octal and binary | ||
| 41 | /(?:[&%]\d+|\$[a-f\d]+)/i, | ||
| 42 | // Decimal | ||
| 43 | /\b\d+(?:\.\d+)?(?:e[+-]?\d+)?/i | ||
| 44 | ], | ||
| 45 | 'operator': [ | ||
| 46 | /\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=]/i, | ||
| 47 | { | ||
| 48 | pattern: /(^|[^&])\b(?:and|as|div|exclude|in|include|is|mod|not|or|shl|shr|xor)\b/, | ||
| 49 | lookbehind: true | ||
| 50 | } | ||
| 51 | ], | ||
| 52 | 'punctuation': /\(\.|\.\)|[()\[\]:;,.]/ | ||
| 53 | }; | ||
| 54 | |||
| 55 | Prism.languages.objectpascal = Prism.languages.pascal; \ No newline at end of file | ||
