]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/wren.js
1 /*! `wren` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= (function () {
7 Description: Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in a familiar, modern syntax.
10 Maintainer: @joshgoebel
11 Website: https://wren.io/
14 /** @type LanguageFn */
16 const regex
= hljs
.regex
;
17 const IDENT_RE
= /[a-zA-Z]\w*/;
41 const LANGUAGE_VARS
= [
45 const CORE_CLASSES
= [
88 match: regex
.concat(/\b(?!(if|while|for|else|super)\b)/, IDENT_RE
, /(?=\s*[({])/),
89 className: "title.function"
91 const FUNCTION_DEFINITION
= {
94 regex
.concat(/\b(?!(if|while|for|else|super)\b)/, IDENT_RE
),
95 regex
.either(...OPERATORS
)
97 /(?=\s*\([^)]+\)\s*\{)/),
98 className: "title.function",
113 const CLASS_DEFINITION
= {
128 4: "title.class.inherited"
135 match: regex
.either(...OPERATORS
),
136 className: "operator"
139 const TRIPLE_STRING
= {
146 className: "property",
147 begin: regex
.concat(/\./, regex
.lookahead(IDENT_RE
)),
155 match: regex
.concat(/\b_/, IDENT_RE
),
160 const CLASS_REFERENCE
= {
162 match: /\b[A-Z]+[a-z]+([A-Z]+[a-z]+)*/,
163 scope: "title.class",
164 keywords: { _: CORE_CLASSES
}
167 // TODO: add custom number modes
168 const NUMBER
= hljs
.C_NUMBER_MODE
;
187 const COMMENT_DOCS
= hljs
.COMMENT(
217 scope: "char.escape",
219 { match: /\\\\|\\["0%abefnrtv]/ },
220 { match: /\\x[0-9A-F]{2}/ },
221 { match: /\\u[0-9A-F]{4}/ },
222 { match: /\\U[0-9A-F]{8}/ }
227 SUBST
.contains
.push(STRING
);
240 /[a-zA-Z_]\w*(?:[?!]|\b)/
242 className: "variable"
245 // TODO: reconsider this in the future
258 keywords: { literal: LITERALS
},
282 "variable.language": LANGUAGE_VARS
,
291 hljs
.C_LINE_COMMENT_MODE
,
292 hljs
.C_BLOCK_COMMENT_MODE
,
310 export default hljsGrammar
;