]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/delphi.js
1 /*! `delphi` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
8 Website: https://www.embarcadero.com/products/delphi
12 /** @type LanguageFn */
13 function delphi(hljs
) {
143 const COMMENT_MODES
= [
144 hljs
.C_LINE_COMMENT_MODE
,
145 hljs
.COMMENT(/\{/, /\}/, { relevance: 0 }),
146 hljs
.COMMENT(/\(\*/, /\*\)/, { relevance: 10 })
165 contains: [ { begin: /''/ } ]
170 // Source: https://www.freepascal.org/docs-html/ref/refse6.html
173 // Regular numbers, e.g., 123, 123.456.
174 match: /\b\d[\d_]*(\.\d[\d_]*)?/ },
176 // Hexadecimal notation, e.g., $7F.
177 match: /\$[\dA-Fa-f_]+/ },
179 // Hexadecimal literal with no digits
183 // Octal notation, e.g., &42.
184 match: /&[0-7][0-7_]*/ },
186 // Binary notation, e.g., %1010.
189 // Binary literal with no digits
194 const CHAR_STRING
= {
197 { match: /#\d[\d_]*/ },
198 { match: /#\$[\dA-Fa-f][\dA-Fa-f_]*/ },
199 { match: /#&[0-7][0-7_]*/ },
200 { match: /#%[01][01_]*/ }
204 begin: hljs
.IDENT_RE
+ '\\s*=\\s*class\\s*\\(',
206 contains: [ hljs
.TITLE_MODE
]
209 className: 'function',
210 beginKeywords: 'function constructor destructor procedure',
212 keywords: 'function constructor|10 destructor|10 procedure|10',
224 ].concat(COMMENT_MODES
)
227 ].concat(COMMENT_MODES
)
237 case_insensitive: true,
239 illegal: /"|\$[G-Zg-z]|\/\*|<\/|\|/,
247 ].concat(COMMENT_MODES
)
255 hljs
.registerLanguage('delphi', hljsGrammar
);