Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 345 lines (286 sloc) 11.604 kb
f84b2a8 @rsaccon initial commit
rsaccon authored
1 %%%-------------------------------------------------------------------
2 %%% File: erlydtl_parser.erl
3 %%% @author Roberto Saccon <rsaccon@gmail.com> [http://rsaccon.com]
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
4 %%% @author Evan Miller <emmiller@gmail.com>
5 %%% @copyright 2008 Roberto Saccon, Evan Miller
f84b2a8 @rsaccon initial commit
rsaccon authored
6 %%% @doc Template language grammar
7 %%% @reference See <a href="http://erlydtl.googlecode.com" target="_top">http://erlydtl.googlecode.com</a> for more information
8 %%% @end
9 %%%
10 %%% The MIT License
11 %%%
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
12 %%% Copyright (c) 2007 Roberto Saccon, Evan Miller
f84b2a8 @rsaccon initial commit
rsaccon authored
13 %%%
14 %%% Permission is hereby granted, free of charge, to any person obtaining a copy
15 %%% of this software and associated documentation files (the "Software"), to deal
16 %%% in the Software without restriction, including without limitation the rights
17 %%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18 %%% copies of the Software, and to permit persons to whom the Software is
19 %%% furnished to do so, subject to the following conditions:
20 %%%
21 %%% The above copyright notice and this permission notice shall be included in
22 %%% all copies or substantial portions of the Software.
23 %%%
24 %%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 %%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 %%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 %%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 %%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29 %%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30 %%% THE SOFTWARE.
31 %%%
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
32 %%% @since 2007-11-11 by Roberto Saccon, Evan Miller
f84b2a8 @rsaccon initial commit
rsaccon authored
33 %%%-------------------------------------------------------------------
34
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
35 Nonterminals
f84b2a8 @rsaccon initial commit
rsaccon authored
36 Elements
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
37 Literal
38
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored
39 ValueBraced
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
40
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
41 Value
42 Variable
43 Filter
44
45 AutoEscapeBlock
46 AutoEscapeBraced
47 EndAutoEscapeBraced
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
48
49 BlockBlock
50 BlockBraced
51 EndBlockBraced
52
53 CommentBlock
54 CommentBraced
55 EndCommentBraced
56
b67188e @evanmiller Support for "cycle" tag. Patch from Hunter Morris.
evanmiller authored
57 CycleTag
58 CycleNames
59 CycleNamesCompat
60
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
61 ExtendsTag
62 IncludeTag
63 NowTag
64
50080db @asonge Adding firstof functionality
asonge authored
65 FirstofTag
66 FirstofList
67 FirstofValues
68
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
69 FilterBlock
70 FilterBraced
71 EndFilterBraced
72 Filters
73
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
74 ForBlock
75 ForBraced
25abda5 @evanmiller Support for {% empty %} block in for loops.
evanmiller authored
76 EmptyBraced
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
77 EndForBraced
78 ForExpression
79 ForGroup
80
81 IfBlock
82 IfBraced
83 IfExpression
84 ElseBraced
85 EndIfBraced
15fa5ce @rsaccon added ifequal tag
rsaccon authored
86
87 IfEqualBlock
88 IfEqualBraced
89 IfEqualExpression
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored
90 EndIfEqualBraced
91
92 IfNotEqualBlock
93 IfNotEqualBraced
94 IfNotEqualExpression
95 EndIfNotEqualBraced
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
96
132ebf9 @rsaccon added load tag (not fully functional yet)
rsaccon authored
97 CustomTag
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored
98 Args
48fea22 Implement "trans" tag with support for .po files
Evan Miller authored
99
e26d23f @evanmiller New tag: spaceless
evanmiller authored
100 SpacelessBlock
101
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
102 SSITag
103
48fea22 Implement "trans" tag with support for .po files
Evan Miller authored
104 TransTag
105
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
106 TemplatetagTag
107 Templatetag
108
109 WidthRatioTag
110
111 WithBlock
112 WithBraced
113 EndWithBraced
114
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored
115 CallTag
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
116 CallWithTag
117
118 Unot.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
119
120 Terminals
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
121 and_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
122 autoescape_keyword
123 block_keyword
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored
124 call_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
125 close_tag
126 close_var
127 comment_keyword
b67188e @evanmiller Support for "cycle" tag. Patch from Hunter Morris.
evanmiller authored
128 cycle_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
129 else_keyword
25abda5 @evanmiller Support for {% empty %} block in for loops.
evanmiller authored
130 empty_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
131 endautoescape_keyword
132 endblock_keyword
133 endcomment_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
134 endfilter_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
135 endfor_keyword
136 endif_keyword
15fa5ce @rsaccon added ifequal tag
rsaccon authored
137 endifequal_keyword
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored
138 endifnotequal_keyword
e26d23f @evanmiller New tag: spaceless
evanmiller authored
139 endspaceless_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
140 endwith_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
141 extends_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
142 filter_keyword
50080db @asonge Adding firstof functionality
asonge authored
143 firstof_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
144 for_keyword
145 identifier
146 if_keyword
15fa5ce @rsaccon added ifequal tag
rsaccon authored
147 ifequal_keyword
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored
148 ifnotequal_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
149 in_keyword
150 include_keyword
1a719d9 @evanmiller Use a translation fun instead of translation dict.
evanmiller authored
151 noop_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
152 not_keyword
48b9b5f @gardenia Added "now" tag and associated associated dateformat module.
gardenia authored
153 now_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
154 number_literal
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
155 or_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
156 open_tag
157 open_var
e26d23f @evanmiller New tag: spaceless
evanmiller authored
158 spaceless_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
159 ssi_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
160 string_literal
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
161 string
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
162 templatetag_keyword
163 openblock_keyword
164 closeblock_keyword
165 openvariable_keyword
166 closevariable_keyword
167 openbrace_keyword
168 closebrace_keyword
169 opencomment_keyword
170 closecomment_keyword
48fea22 Implement "trans" tag with support for .po files
Evan Miller authored
171 trans_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
172 widthratio_keyword
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
173 with_keyword
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
174 ',' '|' '=' ':' '.'
e66e38a @evanmiller More operators.
evanmiller authored
175 '==' '!='
176 '>=' '<='
177 '>' '<'
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
178 '(' ')'.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
179
180 Rootsymbol
181 Elements.
182
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
183 %% Operator precedences for the E non terminal
184 Left 100 or_keyword.
185 Left 110 and_keyword.
e66e38a @evanmiller More operators.
evanmiller authored
186 Nonassoc 300 '==' '!=' '>=' '<=' '>' '<'.
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
187 Unary 600 Unot.
188
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
189 Elements -> '$empty' : [].
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
190 Elements -> Elements string : '$1' ++ ['$2'].
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
191 Elements -> Elements AutoEscapeBlock : '$1' ++ ['$2'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
192 Elements -> Elements BlockBlock : '$1' ++ ['$2'].
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
193 Elements -> Elements CallTag : '$1' ++ ['$2'].
194 Elements -> Elements CallWithTag : '$1' ++ ['$2'].
195 Elements -> Elements CommentBlock : '$1' ++ ['$2'].
196 Elements -> Elements CustomTag : '$1' ++ ['$2'].
197 Elements -> Elements CycleTag : '$1' ++ ['$2'].
198 Elements -> Elements ExtendsTag : '$1' ++ ['$2'].
199 Elements -> Elements FilterBlock : '$1' ++ ['$2'].
50080db @asonge Adding firstof functionality
asonge authored
200 Elements -> Elements FirstofTag : '$1' ++ ['$2'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
201 Elements -> Elements ForBlock : '$1' ++ ['$2'].
202 Elements -> Elements IfBlock : '$1' ++ ['$2'].
15fa5ce @rsaccon added ifequal tag
rsaccon authored
203 Elements -> Elements IfEqualBlock : '$1' ++ ['$2'].
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored
204 Elements -> Elements IfNotEqualBlock : '$1' ++ ['$2'].
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
205 Elements -> Elements IncludeTag : '$1' ++ ['$2'].
206 Elements -> Elements NowTag : '$1' ++ ['$2'].
e26d23f @evanmiller New tag: spaceless
evanmiller authored
207 Elements -> Elements SpacelessBlock : '$1' ++ ['$2'].
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
208 Elements -> Elements SSITag : '$1' ++ ['$2'].
209 Elements -> Elements TemplatetagTag : '$1' ++ ['$2'].
210 Elements -> Elements TransTag : '$1' ++ ['$2'].
211 Elements -> Elements ValueBraced : '$1' ++ ['$2'].
212 Elements -> Elements WidthRatioTag : '$1' ++ ['$2'].
213 Elements -> Elements WithBlock : '$1' ++ ['$2'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
214
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored
215 ValueBraced -> open_var Value close_var : '$2'.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
216
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
217 Value -> Value '|' Filter : {apply_filter, '$1', '$3'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored
218 Value -> Variable : '$1'.
219 Value -> Literal : '$1'.
220
221 Variable -> identifier : {variable, '$1'}.
1a719d9 @evanmiller Use a translation fun instead of translation dict.
evanmiller authored
222 Variable -> Variable '.' identifier : {attribute, {'$3', '$1'}}.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
223
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
224 AutoEscapeBlock -> AutoEscapeBraced Elements EndAutoEscapeBraced : {autoescape, '$1', '$2'}.
225 AutoEscapeBraced -> open_tag autoescape_keyword identifier close_tag : '$3'.
226 EndAutoEscapeBraced -> open_tag endautoescape_keyword close_tag.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
227
228 BlockBlock -> BlockBraced Elements EndBlockBraced : {block, '$1', '$2'}.
229 BlockBraced -> open_tag block_keyword identifier close_tag : '$3'.
230 EndBlockBraced -> open_tag endblock_keyword close_tag.
231
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
232 ExtendsTag -> open_tag extends_keyword string_literal close_tag : {extends, '$3'}.
233 IncludeTag -> open_tag include_keyword string_literal close_tag : {include, '$3'}.
234 NowTag -> open_tag now_keyword string_literal close_tag : {date, now, '$3'}.
235
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
236 CommentBlock -> CommentBraced Elements EndCommentBraced : {comment, '$2'}.
237 CommentBraced -> open_tag comment_keyword close_tag.
238 EndCommentBraced -> open_tag endcomment_keyword close_tag.
239
b67188e @evanmiller Support for "cycle" tag. Patch from Hunter Morris.
evanmiller authored
240 CycleTag -> open_tag cycle_keyword CycleNamesCompat close_tag : {cycle_compat, '$3'}.
241 CycleTag -> open_tag cycle_keyword CycleNames close_tag : {cycle, '$3'}.
242
243 CycleNames -> Value : ['$1'].
244 CycleNames -> CycleNames Value : '$1' ++ ['$2'].
245
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
246 CycleNamesCompat -> identifier ',' : ['$1'].
247 CycleNamesCompat -> CycleNamesCompat identifier ',' : '$1' ++ ['$2'].
b67188e @evanmiller Support for "cycle" tag. Patch from Hunter Morris.
evanmiller authored
248 CycleNamesCompat -> CycleNamesCompat identifier : '$1' ++ ['$2'].
249
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
250 FilterBlock -> FilterBraced Elements EndFilterBraced : {filter, '$1', '$2'}.
251 FilterBraced -> open_tag filter_keyword Filters close_tag : '$3'.
252 EndFilterBraced -> open_tag endfilter_keyword close_tag.
253
254 Filters -> Filter : ['$1'].
255 Filters -> Filters '|' Filter : '$1' ++ ['$3'].
256
50080db @asonge Adding firstof functionality
asonge authored
257 FirstofTag -> open_tag firstof_keyword FirstofList close_tag : '$3'.
011833a @asonge Fixed firstof functionality, an i bug fixed simultaneously
asonge authored
258 FirstofList -> FirstofValues : {firstof, '$1'}.
50080db @asonge Adding firstof functionality
asonge authored
259 FirstofValues -> FirstofValues Value : ['$2'|'$1'].
260 FirstofValues -> Value : ['$1'].
261
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
262 ForBlock -> ForBraced Elements EndForBraced : {for, '$1', '$2'}.
25abda5 @evanmiller Support for {% empty %} block in for loops.
evanmiller authored
263 ForBlock -> ForBraced Elements EmptyBraced Elements EndForBraced : {for, '$1', '$2', '$4'}.
264 EmptyBraced -> open_tag empty_keyword close_tag.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
265 ForBraced -> open_tag for_keyword ForExpression close_tag : '$3'.
266 EndForBraced -> open_tag endfor_keyword close_tag.
79c30e5 @evanmiller 1. Support variable names in for expressions (e.g., for x in foo.bar)
evanmiller authored
267 ForExpression -> ForGroup in_keyword Variable : {'in', '$1', '$3'}.
677116d @evanmiller * Support for unpacking tuples in a for loop.
evanmiller authored
268 ForGroup -> identifier : ['$1'].
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
269 ForGroup -> ForGroup ',' identifier : '$1' ++ ['$3'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
270
271 IfBlock -> IfBraced Elements ElseBraced Elements EndIfBraced : {ifelse, '$1', '$2', '$4'}.
272 IfBlock -> IfBraced Elements EndIfBraced : {'if', '$1', '$2'}.
273 IfBraced -> open_tag if_keyword IfExpression close_tag : '$3'.
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
274 IfExpression -> Value in_keyword Value : {'expr', "in", '$1', '$3'}.
275 IfExpression -> Value not_keyword in_keyword Value : {'expr', "not", {'expr', "in", '$1', '$4'}}.
276 IfExpression -> Value '==' Value : {'expr', "eq", '$1', '$3'}.
e66e38a @evanmiller More operators.
evanmiller authored
277 IfExpression -> Value '!=' Value : {'expr', "ne", '$1', '$3'}.
278 IfExpression -> Value '>=' Value : {'expr', "ge", '$1', '$3'}.
279 IfExpression -> Value '<=' Value : {'expr', "le", '$1', '$3'}.
280 IfExpression -> Value '>' Value : {'expr', "gt", '$1', '$3'}.
281 IfExpression -> Value '<' Value : {'expr', "lt", '$1', '$3'}.
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
282 IfExpression -> '(' IfExpression ')' : '$2'.
283 IfExpression -> Unot : '$1'.
284 IfExpression -> IfExpression or_keyword IfExpression : {'expr', "or", '$1', '$3'}.
285 IfExpression -> IfExpression and_keyword IfExpression : {'expr', "and", '$1', '$3'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored
286 IfExpression -> Value : '$1'.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
287
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
288 Unot -> not_keyword IfExpression : {expr, "not", '$2'}.
289
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
290 ElseBraced -> open_tag else_keyword close_tag.
291 EndIfBraced -> open_tag endif_keyword close_tag.
292
15fa5ce @rsaccon added ifequal tag
rsaccon authored
293 IfEqualBlock -> IfEqualBraced Elements ElseBraced Elements EndIfEqualBraced : {ifequalelse, '$1', '$2', '$4'}.
294 IfEqualBlock -> IfEqualBraced Elements EndIfEqualBraced : {ifequal, '$1', '$2'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored
295 IfEqualBraced -> open_tag ifequal_keyword IfEqualExpression Value close_tag : ['$3', '$4'].
296 IfEqualExpression -> Value : '$1'.
15fa5ce @rsaccon added ifequal tag
rsaccon authored
297 EndIfEqualBraced -> open_tag endifequal_keyword close_tag.
298
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored
299 IfNotEqualBlock -> IfNotEqualBraced Elements ElseBraced Elements EndIfNotEqualBraced : {ifnotequalelse, '$1', '$2', '$4'}.
300 IfNotEqualBlock -> IfNotEqualBraced Elements EndIfNotEqualBraced : {ifnotequal, '$1', '$2'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored
301 IfNotEqualBraced -> open_tag ifnotequal_keyword IfNotEqualExpression Value close_tag : ['$3', '$4'].
302 IfNotEqualExpression -> Value : '$1'.
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored
303 EndIfNotEqualBraced -> open_tag endifnotequal_keyword close_tag.
304
e26d23f @evanmiller New tag: spaceless
evanmiller authored
305 SpacelessBlock -> open_tag spaceless_keyword close_tag Elements open_tag endspaceless_keyword close_tag : {spaceless, '$4'}.
306
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
307 SSITag -> open_tag ssi_keyword Value close_tag : {ssi, '$3'}.
308
309 TemplatetagTag -> open_tag templatetag_keyword Templatetag close_tag : {templatetag, '$3'}.
310
311 Templatetag -> openblock_keyword : '$1'.
312 Templatetag -> closeblock_keyword : '$1'.
313 Templatetag -> openvariable_keyword : '$1'.
314 Templatetag -> closevariable_keyword : '$1'.
315 Templatetag -> openbrace_keyword : '$1'.
316 Templatetag -> closebrace_keyword : '$1'.
317 Templatetag -> opencomment_keyword : '$1'.
318 Templatetag -> closecomment_keyword : '$1'.
319
320 TransTag -> open_tag trans_keyword string_literal close_tag : {trans, '$3'}.
321 TransTag -> open_tag trans_keyword Variable close_tag : {trans, '$3'}.
322 TransTag -> open_tag trans_keyword string_literal noop_keyword close_tag : '$3'.
323 TransTag -> open_tag trans_keyword Variable noop_keyword close_tag : '$3'.
324
325 WidthRatioTag -> open_tag widthratio_keyword Value Value number_literal close_tag : {widthratio, '$3', '$4', '$5'}.
326
327 WithBlock -> WithBraced Elements EndWithBraced : {with, '$1', '$2'}.
328 WithBraced -> open_tag with_keyword Args close_tag : '$3'.
329 EndWithBraced -> open_tag endwith_keyword close_tag.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
330
331 Filter -> identifier : ['$1'].
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
332 Filter -> identifier ':' Literal : ['$1', '$3'].
ae6bf4b @evanmiller Integrate new filters and tests from dgulino
evanmiller authored
333 Filter -> identifier ':' Variable : ['$1', '$3'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
334
335 Literal -> string_literal : '$1'.
677116d @evanmiller * Support for unpacking tuples in a for loop.
evanmiller authored
336 Literal -> number_literal : '$1'.
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored
337
338 CustomTag -> open_tag identifier Args close_tag : {tag, '$2', '$3'}.
339
340 Args -> '$empty' : [].
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
341 Args -> Args identifier '=' Value : '$1' ++ [{'$2', '$4'}].
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored
342
343 CallTag -> open_tag call_keyword identifier close_tag : {call, '$3'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored
344 CallWithTag -> open_tag call_keyword identifier with_keyword Value close_tag : {call, '$3', '$5'}.
Something went wrong with that request. Please try again.