main
Last change
on this file since e48199a was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
979 bytes
|
Line | |
---|
1 | /*
|
---|
2 | Language: Dust
|
---|
3 | Requires: xml.js
|
---|
4 | Author: Michael Allen <michael.allen@benefitfocus.com>
|
---|
5 | Description: Matcher for dust.js templates.
|
---|
6 | Website: https://www.dustjs.com
|
---|
7 | Category: template
|
---|
8 | */
|
---|
9 |
|
---|
10 | /** @type LanguageFn */
|
---|
11 | function dust(hljs) {
|
---|
12 | const EXPRESSION_KEYWORDS = 'if eq ne lt lte gt gte select default math sep';
|
---|
13 | return {
|
---|
14 | name: 'Dust',
|
---|
15 | aliases: ['dst'],
|
---|
16 | case_insensitive: true,
|
---|
17 | subLanguage: 'xml',
|
---|
18 | contains: [
|
---|
19 | {
|
---|
20 | className: 'template-tag',
|
---|
21 | begin: /\{[#\/]/,
|
---|
22 | end: /\}/,
|
---|
23 | illegal: /;/,
|
---|
24 | contains: [{
|
---|
25 | className: 'name',
|
---|
26 | begin: /[a-zA-Z\.-]+/,
|
---|
27 | starts: {
|
---|
28 | endsWithParent: true,
|
---|
29 | relevance: 0,
|
---|
30 | contains: [hljs.QUOTE_STRING_MODE]
|
---|
31 | }
|
---|
32 | }]
|
---|
33 | },
|
---|
34 | {
|
---|
35 | className: 'template-variable',
|
---|
36 | begin: /\{/,
|
---|
37 | end: /\}/,
|
---|
38 | illegal: /;/,
|
---|
39 | keywords: EXPRESSION_KEYWORDS
|
---|
40 | }
|
---|
41 | ]
|
---|
42 | };
|
---|
43 | }
|
---|
44 |
|
---|
45 | module.exports = dust;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.