]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/haxe.js
1 /*! `haxe` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= (function () {
7 Description: Haxe is an open source toolkit based on a modern, high level, strictly typed programming language.
8 Author: Christopher Kaster <ikasoki@gmail.com> (Based on the actionscript.js language file by Alexander Myadzel)
9 Contributors: Kenton Hamaluik <kentonh@gmail.com>
10 Website: https://haxe.org
15 const IDENT_RE
= '[a-zA-Z_$][a-zA-Z0-9_$]*';
17 // C_NUMBER_RE with underscores and literal suffixes
18 const HAXE_NUMBER_RE
= /(-?)(\b0[xX][a-fA-F0-9_]+|(\b\d+(\.[\d_]*)?|\.[\d_]+)(([eE][-+]?\d+)|i32|u32|i64|f64)?)/;
20 const HAXE_BASIC_TYPES
= 'Int Float String Bool Dynamic Void Array ';
26 keyword: 'abstract break case cast catch continue default do dynamic else enum extern '
27 + 'final for function here if import in inline is macro never new override package private get set '
28 + 'public return static super switch this throw trace try typedef untyped using var while '
37 className: 'string', // interpolate-able strings
41 hljs
.BACKSLASH_ESCAPE
,
43 className: 'subst', // interpolation
48 className: 'subst', // interpolation
54 hljs
.QUOTE_STRING_MODE
,
55 hljs
.C_LINE_COMMENT_MODE
,
56 hljs
.C_BLOCK_COMMENT_MODE
,
59 begin: HAXE_NUMBER_RE
,
63 className: 'variable',
64 begin: "\\$" + IDENT_RE
,
67 className: 'meta', // compiler meta
73 className: 'meta', // compiler conditionals
76 keywords: { keyword: 'if else elseif end error' }
79 className: 'type', // function types
81 end: /[^A
-Za
-z0
-9_
\t\->]/,
87 className: 'type', // types
94 className: 'type', // instantiation
101 className: 'title.class', // enums
102 beginKeywords: 'enum',
104 contains: [ hljs
.TITLE_MODE
]
107 className: 'title.class', // abstracts
108 begin: '\\babstract\\b(?=\\s*' + hljs
.IDENT_RE
+ '\\s*\\()',
134 keywords: { keyword: 'abstract from to' }
137 className: 'title.class', // classes
138 begin: /\b(class|interface) +/,
141 keywords: 'class interface',
144 className: 'keyword',
145 begin: /\b(extends|implements) +/,
146 keywords: 'extends implements',
150 begin: hljs
.IDENT_RE
,
159 className: 'title.function',
160 beginKeywords: 'function',
164 contains: [ hljs
.TITLE_MODE
]
175 export default hljsGrammar
;