]> luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/oxygene.js
Initial commit.
[flow-web.git] / static / highlight / languages / oxygene.js
1 /*! `oxygene` grammar compiled for Highlight.js 11.11.1 */
2 (function(){
3 var hljsGrammar = (function () {
4 'use strict';
5
6 /*
7 Language: Oxygene
8 Author: Carlo Kok <ck@remobjects.com>
9 Description: Oxygene is built on the foundation of Object Pascal, revamped and extended to be a modern language for the twenty-first century.
10 Website: https://www.elementscompiler.com/elements/default.aspx
11 Category: build-system
12 */
13
14 function oxygene(hljs) {
15 const OXYGENE_KEYWORDS = {
16 $pattern: /\.?\w+/,
17 keyword:
18 'abstract add and array as asc aspect assembly async begin break block by case class concat const copy constructor continue '
19 + 'create default delegate desc distinct div do downto dynamic each else empty end ensure enum equals event except exit extension external false '
20 + 'final finalize finalizer finally flags for forward from function future global group has if implementation implements implies in index inherited '
21 + 'inline interface into invariants is iterator join locked locking loop matching method mod module namespace nested new nil not notify nullable of '
22 + 'old on operator or order out override parallel params partial pinned private procedure property protected public queryable raise read readonly '
23 + 'record reintroduce remove repeat require result reverse sealed select self sequence set shl shr skip static step soft take then to true try tuple '
24 + 'type union unit unsafe until uses using var virtual raises volatile where while with write xor yield await mapped deprecated stdcall cdecl pascal '
25 + 'register safecall overload library platform reference packed strict published autoreleasepool selector strong weak unretained'
26 };
27 const CURLY_COMMENT = hljs.COMMENT(
28 /\{/,
29 /\}/,
30 { relevance: 0 }
31 );
32 const PAREN_COMMENT = hljs.COMMENT(
33 '\\(\\*',
34 '\\*\\)',
35 { relevance: 10 }
36 );
37 const STRING = {
38 className: 'string',
39 begin: '\'',
40 end: '\'',
41 contains: [ { begin: '\'\'' } ]
42 };
43 const CHAR_STRING = {
44 className: 'string',
45 begin: '(#\\d+)+'
46 };
47 const FUNCTION = {
48 beginKeywords: 'function constructor destructor procedure method',
49 end: '[:;]',
50 keywords: 'function constructor|10 destructor|10 procedure|10 method|10',
51 contains: [
52 hljs.inherit(hljs.TITLE_MODE, { scope: "title.function" }),
53 {
54 className: 'params',
55 begin: '\\(',
56 end: '\\)',
57 keywords: OXYGENE_KEYWORDS,
58 contains: [
59 STRING,
60 CHAR_STRING
61 ]
62 },
63 CURLY_COMMENT,
64 PAREN_COMMENT
65 ]
66 };
67
68 const SEMICOLON = {
69 scope: "punctuation",
70 match: /;/,
71 relevance: 0
72 };
73
74 return {
75 name: 'Oxygene',
76 case_insensitive: true,
77 keywords: OXYGENE_KEYWORDS,
78 illegal: '("|\\$[G-Zg-z]|\\/\\*|</|=>|->)',
79 contains: [
80 CURLY_COMMENT,
81 PAREN_COMMENT,
82 hljs.C_LINE_COMMENT_MODE,
83 STRING,
84 CHAR_STRING,
85 hljs.NUMBER_MODE,
86 FUNCTION,
87 SEMICOLON
88 ]
89 };
90 }
91
92 return oxygene;
93
94 })();
95
96 hljs.registerLanguage('oxygene', hljsGrammar);
97 })();