Skip to content

Commit fe61db4

Browse files
authored
Merge pull request ajaxorg#4432 from dg/pull-latte
added language Latte
2 parents c59b39f + ba0c391 commit fe61db4

5 files changed

Lines changed: 612 additions & 1 deletion

File tree

demo/kitchen-sink/docs/latte.latte

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>{$title}</title>
5+
{*
6+
comment
7+
*}
8+
</head>
9+
<body>
10+
<h1 n:inner-if=1 title=1>My Webpage</h1>
11+
12+
<ul n:if="count($navigation) > 0" id="navigation">
13+
{foreach [a, b, 'x', 10] as $item}
14+
<li><a href="{$item}">{test($item->caption)}</a></li>
15+
{/foreach}
16+
</ul>
17+
18+
{$variable}
19+
{=$variable}
20+
{XXXX::func($variable /* comment */)|filter}
21+
{$variable?->obj|filter:10, abc, 'x$var', "x$var"|filter2}
22+
23+
{if} ... {/if true}
24+
25+
<script>
26+
var a = {$a}, b = {'a': 1}, c = {'a': 1};
27+
if (true) {
28+
alert();
29+
}
30+
</script>
31+
32+
<style>
33+
body { color: {$color} }
34+
</style>
35+
</body>
36+
</html>

lib/ace/ext/modelist.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ var supportedModes = {
119119
Julia: ["jl"],
120120
Kotlin: ["kt|kts"],
121121
LaTeX: ["tex|latex|ltx|bib"],
122+
Latte: ["latte"],
122123
LESS: ["less"],
123124
Liquid: ["liquid"],
124125
Lisp: ["lisp"],
@@ -195,7 +196,7 @@ var supportedModes = {
195196
Textile: ["textile"],
196197
Toml: ["toml"],
197198
TSX: ["tsx"],
198-
Twig: ["latte|twig|swig"],
199+
Twig: ["twig|swig"],
199200
Typescript: ["ts|typescript|str"],
200201
Vala: ["vala"],
201202
VBScript: ["vbs|vb"],
Lines changed: 309 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,309 @@
1+
[[
2+
"start",
3+
["xml-pe.doctype.xml","<!"],
4+
["xml-pe.doctype.xml","doctype"],
5+
["text.whitespace.xml"," "],
6+
["xml-pe.xml","html"],
7+
["xml-pe.doctype.xml",">"]
8+
],[
9+
"start",
10+
["meta.tag.punctuation.tag-open.xml","<"],
11+
["meta.tag.tag-name.xml","html"],
12+
["meta.tag.punctuation.tag-close.xml",">"]
13+
],[
14+
"start",
15+
["text.xml"," "],
16+
["meta.tag.punctuation.tag-open.xml","<"],
17+
["meta.tag.tag-name.xml","head"],
18+
["meta.tag.punctuation.tag-close.xml",">"]
19+
],[
20+
"start",
21+
["text.xml"," "],
22+
["meta.tag.punctuation.tag-open.xml","<"],
23+
["meta.tag.tag-name.xml","title"],
24+
["meta.tag.punctuation.tag-close.xml",">"],
25+
["meta.tag.punctuation.tag-open.latte","{"],
26+
["variable","$title"],
27+
["meta.tag.punctuation.tag-close.latte","}"],
28+
["meta.tag.punctuation.end-tag-open.xml","</"],
29+
["meta.tag.tag-name.xml","title"],
30+
["meta.tag.punctuation.tag-close.xml",">"]
31+
],[
32+
"comment.start.latte",
33+
["text.xml"," "],
34+
["comment.start.latte","{*"],
35+
["comment"," "]
36+
],[
37+
"comment.start.latte",
38+
["comment"," \tcomment"]
39+
],[
40+
"start",
41+
["comment.end.latte"," *}"]
42+
],[
43+
"start",
44+
["text.xml"," "],
45+
["meta.tag.punctuation.end-tag-open.xml","</"],
46+
["meta.tag.tag-name.xml","head"],
47+
["meta.tag.punctuation.tag-close.xml",">"]
48+
],[
49+
"start",
50+
["text.xml"," "],
51+
["meta.tag.punctuation.tag-open.xml","<"],
52+
["meta.tag.tag-name.xml","body"],
53+
["meta.tag.punctuation.tag-close.xml",">"]
54+
],[
55+
"start",
56+
["text.xml"," \t"],
57+
["meta.tag.punctuation.tag-open.xml","<"],
58+
["meta.tag.tag-name.xml","h1"],
59+
["text.tag-whitespace.xml"," "],
60+
["meta.attribute.latte","n:inner-if"],
61+
["keyword.operator.attribute-equals.xml","="],
62+
["constant.numeric","0"],
63+
["meta.tag.punctuation.tag-close.xml",">"],
64+
["entity.other.attribute-name.xml","My"],
65+
["text.tag-whitespace.xml"," "],
66+
["entity.other.attribute-name.xml","Webpage"],
67+
["text","</"],
68+
["entity.other.attribute-name.xml","h1"],
69+
["meta.tag.punctuation.tag-close.xml",">"]
70+
],[
71+
"start"
72+
],[
73+
"start",
74+
["text.xml"," "],
75+
["meta.tag.punctuation.tag-open.xml","<"],
76+
["meta.tag.tag-name.xml","ul"],
77+
["text.tag-whitespace.xml"," "],
78+
["meta.attribute.latte","n:if"],
79+
["keyword.operator.attribute-equals.xml","="],
80+
["string.attribute-value.xml","\""],
81+
["string.unquoted","count"],
82+
["paren.lparen","("],
83+
["variable","$navigation"],
84+
["paren.rparen",")"],
85+
["keyword.operator"," > "],
86+
["constant.numeric","0"],
87+
["string.attribute-value.xml","\""],
88+
["text.tag-whitespace.xml"," "],
89+
["entity.other.attribute-name.xml","id"],
90+
["keyword.operator.attribute-equals.xml","="],
91+
["string.attribute-value.xml","\"navigation\""],
92+
["meta.tag.punctuation.tag-close.xml",">"]
93+
],[
94+
"start",
95+
["text.xml"," "],
96+
["meta.tag.punctuation.tag-open.latte","{"],
97+
["meta.tag.latte","foreach"],
98+
["keyword.operator"," "],
99+
["paren.lparen","["],
100+
["string.unquoted","a"],
101+
["keyword.operator",", "],
102+
["string.unquoted","b"],
103+
["keyword.operator",", "],
104+
["string.start","'"],
105+
["string","x"],
106+
["string.end","'"],
107+
["keyword.operator",", "],
108+
["constant.numeric","10"],
109+
["paren.rparen","]"],
110+
["keyword.operator"," "],
111+
["keyword.control","as"],
112+
["keyword.operator"," "],
113+
["variable","$item"],
114+
["meta.tag.punctuation.tag-close.latte","}"]
115+
],[
116+
"start",
117+
["text.xml"," "],
118+
["meta.tag.punctuation.tag-open.xml","<"],
119+
["meta.tag.tag-name.xml","li"],
120+
["meta.tag.punctuation.tag-close.xml",">"],
121+
["meta.tag.punctuation.tag-open.xml","<"],
122+
["meta.tag.anchor.tag-name.xml","a"],
123+
["text.tag-whitespace.xml"," "],
124+
["entity.other.attribute-name.xml","href"],
125+
["keyword.operator.attribute-equals.xml","="],
126+
["string.attribute-value.xml","\""],
127+
["meta.tag.punctuation.tag-open.latte","{"],
128+
["variable","$item"],
129+
["meta.tag.punctuation.tag-close.latte","}"],
130+
["string.attribute-value.xml","\""],
131+
["meta.tag.punctuation.tag-close.xml",">"],
132+
["meta.tag.punctuation.tag-open.latte","{"],
133+
["meta.tag.latte","test"],
134+
["paren.lparen","("],
135+
["variable","$item"],
136+
["keyword.operator","->"],
137+
["string.unquoted","caption"],
138+
["paren.rparen",")"],
139+
["meta.tag.punctuation.tag-close.latte","}"],
140+
["meta.tag.punctuation.end-tag-open.xml","</"],
141+
["meta.tag.anchor.tag-name.xml","a"],
142+
["meta.tag.punctuation.tag-close.xml",">"],
143+
["meta.tag.punctuation.end-tag-open.xml","</"],
144+
["meta.tag.tag-name.xml","li"],
145+
["meta.tag.punctuation.tag-close.xml",">"]
146+
],[
147+
"start",
148+
["text.xml"," "],
149+
["meta.tag.punctuation.tag-open.latte","{/"],
150+
["meta.tag.latte","foreach"],
151+
["meta.tag.punctuation.tag-close.latte","}"]
152+
],[
153+
"start",
154+
["text.xml"," "],
155+
["meta.tag.punctuation.end-tag-open.xml","</"],
156+
["meta.tag.tag-name.xml","ul"],
157+
["meta.tag.punctuation.tag-close.xml",">"]
158+
],[
159+
"start"
160+
],[
161+
"start",
162+
["text.xml"," "],
163+
["meta.tag.punctuation.tag-open.latte","{"],
164+
["variable","$variable"],
165+
["meta.tag.punctuation.tag-close.latte","}"]
166+
],[
167+
"start",
168+
["text.xml"," "],
169+
["meta.tag.punctuation.tag-open.latte","{"],
170+
["meta.tag.latte","="],
171+
["variable","$variable"],
172+
["meta.tag.punctuation.tag-close.latte","}"]
173+
],[
174+
"start",
175+
["text.xml"," "],
176+
["meta.tag.punctuation.tag-open.latte","{"],
177+
["variable","$variable"],
178+
["keyword.operator","|"],
179+
["string.unquoted","filter"],
180+
["meta.tag.punctuation.tag-close.latte","}"]
181+
],[
182+
"start",
183+
["text.xml"," "],
184+
["meta.tag.punctuation.tag-open.latte","{"],
185+
["variable","$variable"],
186+
["keyword.operator","|"],
187+
["string.unquoted","filter"],
188+
["keyword.operator",":"],
189+
["constant.numeric","10"],
190+
["keyword.operator",","],
191+
["constant.numeric","20"],
192+
["keyword.operator","|"],
193+
["string.unquoted","filter2"],
194+
["meta.tag.punctuation.tag-close.latte","}"]
195+
],[
196+
"start"
197+
],[
198+
"js-start",
199+
["text.xml"," "],
200+
["meta.tag.punctuation.tag-open.xml","<"],
201+
["meta.tag.script.tag-name.xml","script"],
202+
["meta.tag.punctuation.tag-close.xml",">"]
203+
],[
204+
"js-start",
205+
["text","\t "],
206+
["storage.type","var"],
207+
["text"," "],
208+
["identifier","a"],
209+
["text"," "],
210+
["keyword.operator","="],
211+
["text"," "],
212+
["meta.tag.punctuation.tag-open.latte","{"],
213+
["variable","$a"],
214+
["meta.tag.punctuation.tag-close.latte","}"],
215+
["punctuation.operator",","],
216+
["text"," "],
217+
["identifier","b"],
218+
["text"," "],
219+
["keyword.operator","="],
220+
["text"," "],
221+
["paren.lparen","{"],
222+
["string","'a'"],
223+
["punctuation.operator",":"],
224+
["text"," "],
225+
["constant.numeric","1"],
226+
["paren.rparen","}"],
227+
["punctuation.operator",","],
228+
["text"," "],
229+
["identifier","c"],
230+
["text"," "],
231+
["keyword.operator","="],
232+
["text"," "],
233+
["paren.lparen","{"],
234+
["string","'a'"],
235+
["punctuation.operator",":"],
236+
["text"," "],
237+
["constant.numeric","1"],
238+
["paren.rparen","}"],
239+
["punctuation.operator",";"]
240+
],[
241+
"js-start",
242+
["text","\t "],
243+
["keyword","if"],
244+
["text"," "],
245+
["paren.lparen","("],
246+
["constant.language.boolean","true"],
247+
["paren.rparen",")"],
248+
["text"," "],
249+
["paren.lparen","{"]
250+
],[
251+
"js-start",
252+
["text","\t \t"],
253+
["support.function","alert"],
254+
["paren.lparen","("],
255+
["paren.rparen",")"],
256+
["punctuation.operator",";"]
257+
],[
258+
"js-no_regex",
259+
["text","\t "],
260+
["paren.rparen","}"]
261+
],[
262+
"start",
263+
["text"," "],
264+
["meta.tag.punctuation.end-tag-open.xml","</"],
265+
["meta.tag.script.tag-name.xml","script"],
266+
["meta.tag.punctuation.tag-close.xml",">"]
267+
],[
268+
"start"
269+
],[
270+
"css-start",
271+
["text.xml"," "],
272+
["meta.tag.punctuation.tag-open.xml","<"],
273+
["meta.tag.style.tag-name.xml","style"],
274+
["meta.tag.punctuation.tag-close.xml",">"]
275+
],[
276+
"css-start",
277+
["text"," \t"],
278+
["constant","body"],
279+
["text"," "],
280+
["paren.lparen","{"],
281+
["text"," "],
282+
["support.type","color"],
283+
["punctuation.operator",":"],
284+
["text"," "],
285+
["meta.tag.punctuation.tag-open.latte","{"],
286+
["variable","$color"],
287+
["meta.tag.punctuation.tag-close.latte","}"],
288+
["text"," "],
289+
["paren.rparen","}"]
290+
],[
291+
"start",
292+
["text"," "],
293+
["meta.tag.punctuation.end-tag-open.xml","</"],
294+
["meta.tag.style.tag-name.xml","style"],
295+
["meta.tag.punctuation.tag-close.xml",">"]
296+
],[
297+
"start",
298+
["text.xml"," "],
299+
["meta.tag.punctuation.end-tag-open.xml","</"],
300+
["meta.tag.tag-name.xml","body"],
301+
["meta.tag.punctuation.tag-close.xml",">"]
302+
],[
303+
"start",
304+
["meta.tag.punctuation.end-tag-open.xml","</"],
305+
["meta.tag.tag-name.xml","html"],
306+
["meta.tag.punctuation.tag-close.xml",">"]
307+
],[
308+
"start"
309+
]]

0 commit comments

Comments
 (0)