Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 352 lines (290 sloc) 11.994 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
9646b5a @evanmiller Implement "iriencode" filter
evanmiller authored
42 Values
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
43 Variable
44 Filter
45
46 AutoEscapeBlock
47 AutoEscapeBraced
48 EndAutoEscapeBraced
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
49
50 BlockBlock
51 BlockBraced
52 EndBlockBraced
53
54 CommentBlock
55 CommentBraced
56 EndCommentBraced
57
b67188e @evanmiller Support for "cycle" tag. Patch from Hunter Morris.
evanmiller authored
58 CycleTag
59 CycleNames
60 CycleNamesCompat
61
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
62 ExtendsTag
63 IncludeTag
64 NowTag
65
50080db @asonge Adding firstof functionality
asonge authored
66 FirstofTag
67
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
68 FilterBlock
69 FilterBraced
70 EndFilterBraced
71 Filters
72
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
73 ForBlock
74 ForBraced
25abda5 @evanmiller Support for {% empty %} block in for loops.
evanmiller authored
75 EmptyBraced
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
76 EndForBraced
77 ForExpression
78 ForGroup
79
80 IfBlock
81 IfBraced
82 IfExpression
83 ElseBraced
84 EndIfBraced
15fa5ce @rsaccon added ifequal tag
rsaccon authored
85
86 IfEqualBlock
87 IfEqualBraced
88 IfEqualExpression
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored
89 EndIfEqualBraced
90
91 IfNotEqualBlock
92 IfNotEqualBraced
93 IfNotEqualExpression
94 EndIfNotEqualBraced
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
95
132ebf9 @rsaccon added load tag (not fully functional yet)
rsaccon authored
96 CustomTag
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored
97 Args
48fea22 Implement "trans" tag with support for .po files
Evan Miller authored
98
e26d23f @evanmiller New tag: spaceless
evanmiller authored
99 SpacelessBlock
100
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
101 SSITag
102
48fea22 Implement "trans" tag with support for .po files
Evan Miller authored
103 TransTag
104
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
105 TemplatetagTag
106 Templatetag
107
108 WidthRatioTag
109
110 WithBlock
111 WithBraced
112 EndWithBraced
113
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored
114 CallTag
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
115 CallWithTag
116
117 Unot.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
118
119 Terminals
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
120 and_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
121 autoescape_keyword
122 block_keyword
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored
123 call_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
124 close_tag
125 close_var
126 comment_keyword
b67188e @evanmiller Support for "cycle" tag. Patch from Hunter Morris.
evanmiller authored
127 cycle_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
128 else_keyword
25abda5 @evanmiller Support for {% empty %} block in for loops.
evanmiller authored
129 empty_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
130 endautoescape_keyword
131 endblock_keyword
132 endcomment_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
133 endfilter_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
134 endfor_keyword
135 endif_keyword
15fa5ce @rsaccon added ifequal tag
rsaccon authored
136 endifequal_keyword
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored
137 endifnotequal_keyword
e26d23f @evanmiller New tag: spaceless
evanmiller authored
138 endspaceless_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
139 endwith_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
140 extends_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
141 filter_keyword
50080db @asonge Adding firstof functionality
asonge authored
142 firstof_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
143 for_keyword
144 identifier
145 if_keyword
15fa5ce @rsaccon added ifequal tag
rsaccon authored
146 ifequal_keyword
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored
147 ifnotequal_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
148 in_keyword
149 include_keyword
1a719d9 @evanmiller Use a translation fun instead of translation dict.
evanmiller authored
150 noop_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
151 not_keyword
48b9b5f @gardenia Added "now" tag and associated associated dateformat module.
gardenia authored
152 now_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
153 number_literal
ab53409 @evanmiller Support "only" keyword with include
evanmiller authored
154 only_keyword
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
fa28530 @evanmiller Change "include" tag to follow Django behavior
evanmiller authored
158 parsed_keyword
e26d23f @evanmiller New tag: spaceless
evanmiller authored
159 spaceless_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
160 ssi_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
161 string_literal
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
162 string
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
163 templatetag_keyword
164 openblock_keyword
165 closeblock_keyword
166 openvariable_keyword
167 closevariable_keyword
168 openbrace_keyword
169 closebrace_keyword
170 opencomment_keyword
171 closecomment_keyword
48fea22 Implement "trans" tag with support for .po files
Evan Miller authored
172 trans_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
173 widthratio_keyword
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
174 with_keyword
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
175 ',' '|' '=' ':' '.'
e66e38a @evanmiller More operators.
evanmiller authored
176 '==' '!='
177 '>=' '<='
178 '>' '<'
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
179 '(' ')'.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
180
181 Rootsymbol
182 Elements.
183
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
184 %% Operator precedences for the E non terminal
185 Left 100 or_keyword.
186 Left 110 and_keyword.
e66e38a @evanmiller More operators.
evanmiller authored
187 Nonassoc 300 '==' '!=' '>=' '<=' '>' '<'.
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
188 Unary 600 Unot.
189
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
190 Elements -> '$empty' : [].
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
191 Elements -> Elements string : '$1' ++ ['$2'].
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
192 Elements -> Elements AutoEscapeBlock : '$1' ++ ['$2'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
193 Elements -> Elements BlockBlock : '$1' ++ ['$2'].
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
194 Elements -> Elements CallTag : '$1' ++ ['$2'].
195 Elements -> Elements CallWithTag : '$1' ++ ['$2'].
196 Elements -> Elements CommentBlock : '$1' ++ ['$2'].
197 Elements -> Elements CustomTag : '$1' ++ ['$2'].
198 Elements -> Elements CycleTag : '$1' ++ ['$2'].
199 Elements -> Elements ExtendsTag : '$1' ++ ['$2'].
200 Elements -> Elements FilterBlock : '$1' ++ ['$2'].
50080db @asonge Adding firstof functionality
asonge authored
201 Elements -> Elements FirstofTag : '$1' ++ ['$2'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
202 Elements -> Elements ForBlock : '$1' ++ ['$2'].
203 Elements -> Elements IfBlock : '$1' ++ ['$2'].
15fa5ce @rsaccon added ifequal tag
rsaccon authored
204 Elements -> Elements IfEqualBlock : '$1' ++ ['$2'].
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored
205 Elements -> Elements IfNotEqualBlock : '$1' ++ ['$2'].
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
206 Elements -> Elements IncludeTag : '$1' ++ ['$2'].
207 Elements -> Elements NowTag : '$1' ++ ['$2'].
e26d23f @evanmiller New tag: spaceless
evanmiller authored
208 Elements -> Elements SpacelessBlock : '$1' ++ ['$2'].
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
209 Elements -> Elements SSITag : '$1' ++ ['$2'].
210 Elements -> Elements TemplatetagTag : '$1' ++ ['$2'].
211 Elements -> Elements TransTag : '$1' ++ ['$2'].
212 Elements -> Elements ValueBraced : '$1' ++ ['$2'].
213 Elements -> Elements WidthRatioTag : '$1' ++ ['$2'].
214 Elements -> Elements WithBlock : '$1' ++ ['$2'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
215
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored
216 ValueBraced -> open_var Value close_var : '$2'.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
217
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
218 Value -> Value '|' Filter : {apply_filter, '$1', '$3'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored
219 Value -> Variable : '$1'.
220 Value -> Literal : '$1'.
221
9646b5a @evanmiller Implement "iriencode" filter
evanmiller authored
222 Values -> Value : ['$1'].
223 Values -> Values Value : '$1' ++ ['$2'].
224
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored
225 Variable -> identifier : {variable, '$1'}.
1a719d9 @evanmiller Use a translation fun instead of translation dict.
evanmiller authored
226 Variable -> Variable '.' identifier : {attribute, {'$3', '$1'}}.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
227
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
228 AutoEscapeBlock -> AutoEscapeBraced Elements EndAutoEscapeBraced : {autoescape, '$1', '$2'}.
229 AutoEscapeBraced -> open_tag autoescape_keyword identifier close_tag : '$3'.
230 EndAutoEscapeBraced -> open_tag endautoescape_keyword close_tag.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
231
232 BlockBlock -> BlockBraced Elements EndBlockBraced : {block, '$1', '$2'}.
233 BlockBraced -> open_tag block_keyword identifier close_tag : '$3'.
234 EndBlockBraced -> open_tag endblock_keyword close_tag.
235
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
236 ExtendsTag -> open_tag extends_keyword string_literal close_tag : {extends, '$3'}.
fa28530 @evanmiller Change "include" tag to follow Django behavior
evanmiller authored
237
238 IncludeTag -> open_tag include_keyword string_literal close_tag : {include, '$3', []}.
239 IncludeTag -> open_tag include_keyword string_literal with_keyword Args close_tag : {include, '$3', '$5'}.
ab53409 @evanmiller Support "only" keyword with include
evanmiller authored
240 IncludeTag -> open_tag include_keyword string_literal only_keyword close_tag : {include_only, '$3', []}.
241 IncludeTag -> open_tag include_keyword string_literal with_keyword Args only_keyword close_tag : {include_only, '$3', '$5'}.
fa28530 @evanmiller Change "include" tag to follow Django behavior
evanmiller authored
242
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
243 NowTag -> open_tag now_keyword string_literal close_tag : {date, now, '$3'}.
244
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
245 CommentBlock -> CommentBraced Elements EndCommentBraced : {comment, '$2'}.
246 CommentBraced -> open_tag comment_keyword close_tag.
247 EndCommentBraced -> open_tag endcomment_keyword close_tag.
248
b67188e @evanmiller Support for "cycle" tag. Patch from Hunter Morris.
evanmiller authored
249 CycleTag -> open_tag cycle_keyword CycleNamesCompat close_tag : {cycle_compat, '$3'}.
250 CycleTag -> open_tag cycle_keyword CycleNames close_tag : {cycle, '$3'}.
251
252 CycleNames -> Value : ['$1'].
253 CycleNames -> CycleNames Value : '$1' ++ ['$2'].
254
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
255 CycleNamesCompat -> identifier ',' : ['$1'].
256 CycleNamesCompat -> CycleNamesCompat identifier ',' : '$1' ++ ['$2'].
b67188e @evanmiller Support for "cycle" tag. Patch from Hunter Morris.
evanmiller authored
257 CycleNamesCompat -> CycleNamesCompat identifier : '$1' ++ ['$2'].
258
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
259 FilterBlock -> FilterBraced Elements EndFilterBraced : {filter, '$1', '$2'}.
260 FilterBraced -> open_tag filter_keyword Filters close_tag : '$3'.
261 EndFilterBraced -> open_tag endfilter_keyword close_tag.
262
263 Filters -> Filter : ['$1'].
264 Filters -> Filters '|' Filter : '$1' ++ ['$3'].
265
9646b5a @evanmiller Implement "iriencode" filter
evanmiller authored
266 FirstofTag -> open_tag firstof_keyword Values close_tag : {firstof, '$3'}.
50080db @asonge Adding firstof functionality
asonge authored
267
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
268 ForBlock -> ForBraced Elements EndForBraced : {for, '$1', '$2'}.
25abda5 @evanmiller Support for {% empty %} block in for loops.
evanmiller authored
269 ForBlock -> ForBraced Elements EmptyBraced Elements EndForBraced : {for, '$1', '$2', '$4'}.
270 EmptyBraced -> open_tag empty_keyword close_tag.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
271 ForBraced -> open_tag for_keyword ForExpression close_tag : '$3'.
272 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
273 ForExpression -> ForGroup in_keyword Variable : {'in', '$1', '$3'}.
677116d @evanmiller * Support for unpacking tuples in a for loop.
evanmiller authored
274 ForGroup -> identifier : ['$1'].
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
275 ForGroup -> ForGroup ',' identifier : '$1' ++ ['$3'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
276
277 IfBlock -> IfBraced Elements ElseBraced Elements EndIfBraced : {ifelse, '$1', '$2', '$4'}.
278 IfBlock -> IfBraced Elements EndIfBraced : {'if', '$1', '$2'}.
279 IfBraced -> open_tag if_keyword IfExpression close_tag : '$3'.
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
280 IfExpression -> Value in_keyword Value : {'expr', "in", '$1', '$3'}.
281 IfExpression -> Value not_keyword in_keyword Value : {'expr', "not", {'expr', "in", '$1', '$4'}}.
282 IfExpression -> Value '==' Value : {'expr', "eq", '$1', '$3'}.
e66e38a @evanmiller More operators.
evanmiller authored
283 IfExpression -> Value '!=' Value : {'expr', "ne", '$1', '$3'}.
284 IfExpression -> Value '>=' Value : {'expr', "ge", '$1', '$3'}.
285 IfExpression -> Value '<=' Value : {'expr', "le", '$1', '$3'}.
286 IfExpression -> Value '>' Value : {'expr', "gt", '$1', '$3'}.
287 IfExpression -> Value '<' Value : {'expr', "lt", '$1', '$3'}.
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
288 IfExpression -> '(' IfExpression ')' : '$2'.
289 IfExpression -> Unot : '$1'.
290 IfExpression -> IfExpression or_keyword IfExpression : {'expr', "or", '$1', '$3'}.
291 IfExpression -> IfExpression and_keyword IfExpression : {'expr', "and", '$1', '$3'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored
292 IfExpression -> Value : '$1'.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
293
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored
294 Unot -> not_keyword IfExpression : {expr, "not", '$2'}.
295
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
296 ElseBraced -> open_tag else_keyword close_tag.
297 EndIfBraced -> open_tag endif_keyword close_tag.
298
15fa5ce @rsaccon added ifequal tag
rsaccon authored
299 IfEqualBlock -> IfEqualBraced Elements ElseBraced Elements EndIfEqualBraced : {ifequalelse, '$1', '$2', '$4'}.
300 IfEqualBlock -> IfEqualBraced Elements EndIfEqualBraced : {ifequal, '$1', '$2'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored
301 IfEqualBraced -> open_tag ifequal_keyword IfEqualExpression Value close_tag : ['$3', '$4'].
302 IfEqualExpression -> Value : '$1'.
15fa5ce @rsaccon added ifequal tag
rsaccon authored
303 EndIfEqualBraced -> open_tag endifequal_keyword close_tag.
304
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored
305 IfNotEqualBlock -> IfNotEqualBraced Elements ElseBraced Elements EndIfNotEqualBraced : {ifnotequalelse, '$1', '$2', '$4'}.
306 IfNotEqualBlock -> IfNotEqualBraced Elements EndIfNotEqualBraced : {ifnotequal, '$1', '$2'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored
307 IfNotEqualBraced -> open_tag ifnotequal_keyword IfNotEqualExpression Value close_tag : ['$3', '$4'].
308 IfNotEqualExpression -> Value : '$1'.
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored
309 EndIfNotEqualBraced -> open_tag endifnotequal_keyword close_tag.
310
e26d23f @evanmiller New tag: spaceless
evanmiller authored
311 SpacelessBlock -> open_tag spaceless_keyword close_tag Elements open_tag endspaceless_keyword close_tag : {spaceless, '$4'}.
312
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
313 SSITag -> open_tag ssi_keyword Value close_tag : {ssi, '$3'}.
fa28530 @evanmiller Change "include" tag to follow Django behavior
evanmiller authored
314 SSITag -> open_tag ssi_keyword string_literal parsed_keyword close_tag : {ssi_parsed, '$3'}.
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored
315
316 TemplatetagTag -> open_tag templatetag_keyword Templatetag close_tag : {templatetag, '$3'}.
317
318 Templatetag -> openblock_keyword : '$1'.
319 Templatetag -> closeblock_keyword : '$1'.
320 Templatetag -> openvariable_keyword : '$1'.
321 Templatetag -> closevariable_keyword : '$1'.
322 Templatetag -> openbrace_keyword : '$1'.
323 Templatetag -> closebrace_keyword : '$1'.
324 Templatetag -> opencomment_keyword : '$1'.
325 Templatetag -> closecomment_keyword : '$1'.
326
327 TransTag -> open_tag trans_keyword string_literal close_tag : {trans, '$3'}.
328 TransTag -> open_tag trans_keyword Variable close_tag : {trans, '$3'}.
329 TransTag -> open_tag trans_keyword string_literal noop_keyword close_tag : '$3'.
330 TransTag -> open_tag trans_keyword Variable noop_keyword close_tag : '$3'.
331
332 WidthRatioTag -> open_tag widthratio_keyword Value Value number_literal close_tag : {widthratio, '$3', '$4', '$5'}.
333
334 WithBlock -> WithBraced Elements EndWithBraced : {with, '$1', '$2'}.
335 WithBraced -> open_tag with_keyword Args close_tag : '$3'.
336 EndWithBraced -> open_tag endwith_keyword close_tag.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
337
338 Filter -> identifier : ['$1'].
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
339 Filter -> identifier ':' Literal : ['$1', '$3'].
ae6bf4b @evanmiller Integrate new filters and tests from dgulino
evanmiller authored
340 Filter -> identifier ':' Variable : ['$1', '$3'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored
341
342 Literal -> string_literal : '$1'.
677116d @evanmiller * Support for unpacking tuples in a for loop.
evanmiller authored
343 Literal -> number_literal : '$1'.
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored
344
345 CustomTag -> open_tag identifier Args close_tag : {tag, '$2', '$3'}.
346
347 Args -> '$empty' : [].
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored
348 Args -> Args identifier '=' Value : '$1' ++ [{'$2', '$4'}].
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored
349
350 CallTag -> open_tag call_keyword identifier close_tag : {call, '$3'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored
351 CallWithTag -> open_tag call_keyword identifier with_keyword Value close_tag : {call, '$3', '$5'}.
Something went wrong with that request. Please try again.