]> luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/haml.js
Initial commit.
[flow-web.git] / static / highlight / es / languages / haml.js
1 /*! `haml` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar = (function () {
3 'use strict';
4
5 /*
6 Language: HAML
7 Requires: ruby.js
8 Author: Dan Allen <dan.j.allen@gmail.com>
9 Website: http://haml.info
10 Category: template
11 */
12
13 // TODO support filter tags like :javascript, support inline HTML
14 function haml(hljs) {
15 return {
16 name: 'HAML',
17 case_insensitive: true,
18 contains: [
19 {
20 className: 'meta',
21 begin: '^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$',
22 relevance: 10
23 },
24 // FIXME these comments should be allowed to span indented lines
25 hljs.COMMENT(
26 '^\\s*(!=#|=#|-#|/).*$',
27 null,
28 { relevance: 0 }
29 ),
30 {
31 begin: '^\\s*(-|=|!=)(?!#)',
32 end: /$/,
33 subLanguage: 'ruby',
34 excludeBegin: true,
35 excludeEnd: true
36 },
37 {
38 className: 'tag',
39 begin: '^\\s*%',
40 contains: [
41 {
42 className: 'selector-tag',
43 begin: '\\w+'
44 },
45 {
46 className: 'selector-id',
47 begin: '#[\\w-]+'
48 },
49 {
50 className: 'selector-class',
51 begin: '\\.[\\w-]+'
52 },
53 {
54 begin: /\{\s*/,
55 end: /\s*\}/,
56 contains: [
57 {
58 begin: ':\\w+\\s*=>',
59 end: ',\\s+',
60 returnBegin: true,
61 endsWithParent: true,
62 contains: [
63 {
64 className: 'attr',
65 begin: ':\\w+'
66 },
67 hljs.APOS_STRING_MODE,
68 hljs.QUOTE_STRING_MODE,
69 {
70 begin: '\\w+',
71 relevance: 0
72 }
73 ]
74 }
75 ]
76 },
77 {
78 begin: '\\(\\s*',
79 end: '\\s*\\)',
80 excludeEnd: true,
81 contains: [
82 {
83 begin: '\\w+\\s*=',
84 end: '\\s+',
85 returnBegin: true,
86 endsWithParent: true,
87 contains: [
88 {
89 className: 'attr',
90 begin: '\\w+',
91 relevance: 0
92 },
93 hljs.APOS_STRING_MODE,
94 hljs.QUOTE_STRING_MODE,
95 {
96 begin: '\\w+',
97 relevance: 0
98 }
99 ]
100 }
101 ]
102 }
103 ]
104 },
105 { begin: '^\\s*[=~]\\s*' },
106 {
107 begin: /#\{/,
108 end: /\}/,
109 subLanguage: 'ruby',
110 excludeBegin: true,
111 excludeEnd: true
112 }
113 ]
114 };
115 }
116
117 return haml;
118
119 })();
120 ;
121 export default hljsGrammar;