]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/twig.js
1 /*! `twig` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= (function () {
8 Author: Luke Holder <lukemh@gmail.com>
9 Description: Twig is a templating language for PHP
10 Website: https://twig.symfony.com
15 const regex
= hljs
.regex
;
16 const FUNCTION_NAMES
= [
54 "template_from_string",
81 "format_args_as_text",
86 "format_file_from_text",
152 "trans_default_domain",
159 TAG_NAMES
= TAG_NAMES
.concat(TAG_NAMES
.map(t
=> `end${t}`));
193 beginKeywords: FUNCTION_NAMES
.join(" "),
194 keywords: { name: FUNCTION_NAMES
},
200 match: /\|(?=[A-Za-z_]+:?)/,
201 beginScope: "punctuation",
205 match: /[A-Za-z_]+:?/,
211 const tagNamed
= (tagnames
, { relevance
}) => {
217 relevance: relevance
|| 2,
218 endScope: 'template-tag',
222 regex
.either(...tagnames
)
235 const CUSTOM_TAG_RE
= /[a-z_]+/;
236 const TAG
= tagNamed(TAG_NAMES
, { relevance: 2 });
237 const CUSTOM_TAG
= tagNamed([ CUSTOM_TAG_RE
], { relevance: 1 });
241 aliases: [ 'craftcms' ],
242 case_insensitive: true,
245 hljs
.COMMENT(/\{#/, /#\}/),
249 className: 'template-variable',
268 export default hljsGrammar
;