]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/dart.js
1 /*! `dart` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
9 Author: Maxim Dikun <dikmax@gmail.com>
10 Description: Dart a modern, object-oriented language developed by Google. For more information see https://www.dartlang.org/
11 Website: https://dart.dev
15 /** @type LanguageFn */
19 variants: [ { begin: '\\$[A-Za-z0-9_]+' } ]
22 const BRACED_SUBST
= {
30 keywords: 'true false null this is new super'
37 { match: /\b[0-9][0-9_]*(\.[0-9][0-9_]*)?([eE][+-]?[0-9][0-9_]*)?\b/ },
38 { match: /\b0[xX][0-9A-Fa-f][0-9A-Fa-f_]*\b/ }
67 hljs
.BACKSLASH_ESCAPE
,
76 hljs
.BACKSLASH_ESCAPE
,
86 hljs
.BACKSLASH_ESCAPE
,
96 hljs
.BACKSLASH_ESCAPE
,
103 BRACED_SUBST
.contains
= [
108 const BUILT_IN_TYPES
= [
138 const NULLABLE_BUILT_IN_TYPES
= BUILT_IN_TYPES
.map((e
) => `${e}?`);
140 const BASIC_KEYWORDS
= [
210 keyword: BASIC_KEYWORDS
,
213 .concat(NULLABLE_BUILT_IN_TYPES
)
226 $pattern: /[A-Za-z][A-Za-z0-9_]*\??/
238 subLanguage: 'markdown',
246 subLanguage: 'markdown',
253 hljs
.C_LINE_COMMENT_MODE
,
254 hljs
.C_BLOCK_COMMENT_MODE
,
257 beginKeywords: 'class interface',
261 { beginKeywords: 'extends implements' },
262 hljs
.UNDERSCORE_TITLE_MODE
270 { begin: '=>' // No markup, just a relevance booster
280 hljs
.registerLanguage('dart', hljsGrammar
);