Skip to content
Newer
Older
100644 399 lines (331 sloc) 13.7 KB
9213d0f @kaos add customized yeccpre.hrl file.
kaos authored Jun 15, 2013
1 %%% -*- mode: erlang -*- ------------------------------------------------------------------
f84b2a8 @rsaccon initial commit
rsaccon authored Nov 18, 2007
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 Jan 11, 2008
4 %%% @author Evan Miller <emmiller@gmail.com>
5 %%% @copyright 2008 Roberto Saccon, Evan Miller
f84b2a8 @rsaccon initial commit
rsaccon authored Nov 18, 2007
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 Jan 11, 2008
12 %%% Copyright (c) 2007 Roberto Saccon, Evan Miller
f84b2a8 @rsaccon initial commit
rsaccon authored Nov 18, 2007
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 Jan 11, 2008
32 %%% @since 2007-11-11 by Roberto Saccon, Evan Miller
f84b2a8 @rsaccon initial commit
rsaccon authored Nov 18, 2007
33 %%%-------------------------------------------------------------------
34
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
35 Nonterminals
f84b2a8 @rsaccon initial commit
rsaccon authored Nov 18, 2007
36 Elements
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
37 Literal
38
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored Feb 14, 2008
39 ValueBraced
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
40
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
41 Value
9646b5a @evanmiller Implement "iriencode" filter
evanmiller authored Mar 19, 2011
42 Values
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
43 Variable
44 Filter
45
46 AutoEscapeBlock
47 AutoEscapeBraced
48 EndAutoEscapeBraced
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
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 Jun 28, 2008
58 CycleTag
59 CycleNames
60 CycleNamesCompat
61
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
62 ExtendsTag
63 IncludeTag
64 NowTag
65
50080db @asonge Adding firstof functionality
asonge authored Jan 3, 2010
66 FirstofTag
67
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
68 FilterBlock
69 FilterBraced
70 EndFilterBraced
71 Filters
72
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
73 ForBlock
74 ForBraced
25abda5 @evanmiller Support for {% empty %} block in for loops.
evanmiller authored May 22, 2010
75 EmptyBraced
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
76 EndForBraced
77 ForExpression
78 ForGroup
79
80 IfBlock
81 IfBraced
9f074aa @psyeugenic Add support for {% elif Expr %} syntax
psyeugenic authored Jul 20, 2012
82 ElifBlock
83 ElifBraced
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
84 IfExpression
85 ElseBraced
86 EndIfBraced
15fa5ce @rsaccon added ifequal tag
rsaccon authored Jan 21, 2008
87
1b16fa0 Support for {% ifchanged %} tag
Evan Miller authored Feb 19, 2012
88 IfChangedBlock
89 IfChangedBraced
90 EndIfChangedBraced
91
15fa5ce @rsaccon added ifequal tag
rsaccon authored Jan 21, 2008
92 IfEqualBlock
93 IfEqualBraced
94 IfEqualExpression
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored Jan 21, 2008
95 EndIfEqualBraced
96
97 IfNotEqualBlock
98 IfNotEqualBraced
99 IfNotEqualExpression
100 EndIfNotEqualBraced
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
101
132ebf9 @rsaccon added load tag (not fully functional yet)
rsaccon authored Jan 29, 2008
102 CustomTag
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored Jan 31, 2008
103 Args
48fea22 Implement "trans" tag with support for .po files
Evan Miller authored Apr 28, 2010
104
c624a50 Support for {% regroup %} tag.
Evan Miller authored Feb 19, 2012
105 RegroupBlock
106 RegroupBraced
107 EndRegroupBraced
108
e26d23f @evanmiller New tag: spaceless
evanmiller authored Mar 19, 2011
109 SpacelessBlock
110
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
111 SSITag
112
694fc92 Preliminary blocktrans support
Evan Miller authored Jun 24, 2011
113 BlockTransBlock
48fea22 Implement "trans" tag with support for .po files
Evan Miller authored Apr 28, 2010
114 TransTag
115
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
116 TemplatetagTag
117 Templatetag
118
119 WidthRatioTag
120
121 WithBlock
122 WithBraced
123 EndWithBraced
124
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored Jan 31, 2008
125 CallTag
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored May 21, 2010
126 CallWithTag
127
128 Unot.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
129
130 Terminals
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored May 21, 2010
131 and_keyword
c624a50 Support for {% regroup %} tag.
Evan Miller authored Feb 19, 2012
132 as_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
133 autoescape_keyword
134 block_keyword
694fc92 Preliminary blocktrans support
Evan Miller authored Jun 24, 2011
135 blocktrans_keyword
c624a50 Support for {% regroup %} tag.
Evan Miller authored Feb 19, 2012
136 by_keyword
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored Jan 31, 2008
137 call_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
138 close_tag
139 close_var
140 comment_keyword
b67188e @evanmiller Support for "cycle" tag. Patch from Hunter Morris.
evanmiller authored Jun 28, 2008
141 cycle_keyword
9f074aa @psyeugenic Add support for {% elif Expr %} syntax
psyeugenic authored Jul 19, 2012
142 elif_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
143 else_keyword
25abda5 @evanmiller Support for {% empty %} block in for loops.
evanmiller authored May 22, 2010
144 empty_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
145 endautoescape_keyword
146 endblock_keyword
694fc92 Preliminary blocktrans support
Evan Miller authored Jun 24, 2011
147 endblocktrans_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
148 endcomment_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
149 endfilter_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
150 endfor_keyword
151 endif_keyword
1b16fa0 Support for {% ifchanged %} tag
Evan Miller authored Feb 19, 2012
152 endifchanged_keyword
15fa5ce @rsaccon added ifequal tag
rsaccon authored Jan 21, 2008
153 endifequal_keyword
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored Jan 21, 2008
154 endifnotequal_keyword
c624a50 Support for {% regroup %} tag.
Evan Miller authored Feb 19, 2012
155 endregroup_keyword
e26d23f @evanmiller New tag: spaceless
evanmiller authored Mar 19, 2011
156 endspaceless_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
157 endwith_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
158 extends_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
159 filter_keyword
50080db @asonge Adding firstof functionality
asonge authored Jan 3, 2010
160 firstof_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
161 for_keyword
162 identifier
163 if_keyword
1b16fa0 Support for {% ifchanged %} tag
Evan Miller authored Feb 19, 2012
164 ifchanged_keyword
15fa5ce @rsaccon added ifequal tag
rsaccon authored Jan 21, 2008
165 ifequal_keyword
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored Jan 21, 2008
166 ifnotequal_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
167 in_keyword
168 include_keyword
1a719d9 @evanmiller Use a translation fun instead of translation dict.
evanmiller authored May 27, 2010
169 noop_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
170 not_keyword
48b9b5f @gardenia Added "now" tag and associated associated dateformat module.
gardenia authored Mar 4, 2008
171 now_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
172 number_literal
ab53409 @evanmiller Support "only" keyword with include
evanmiller authored Mar 20, 2011
173 only_keyword
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored May 21, 2010
174 or_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
175 open_tag
176 open_var
fa28530 @evanmiller Change "include" tag to follow Django behavior
evanmiller authored Mar 19, 2011
177 parsed_keyword
c624a50 Support for {% regroup %} tag.
Evan Miller authored Feb 19, 2012
178 regroup_keyword
898fbae @evanmiller Support {% for .. in .. reversed %} syntax
evanmiller authored Apr 4, 2013
179 reversed_keyword
e26d23f @evanmiller New tag: spaceless
evanmiller authored Mar 19, 2011
180 spaceless_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
181 ssi_keyword
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
182 string_literal
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored May 22, 2010
183 string
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
184 templatetag_keyword
694fc92 Preliminary blocktrans support
Evan Miller authored Jun 24, 2011
185 openblock_keyword
186 closeblock_keyword
187 openvariable_keyword
188 closevariable_keyword
189 openbrace_keyword
190 closebrace_keyword
191 opencomment_keyword
192 closecomment_keyword
48fea22 Implement "trans" tag with support for .po files
Evan Miller authored Apr 28, 2010
193 trans_keyword
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
194 widthratio_keyword
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored May 21, 2010
195 with_keyword
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored May 22, 2010
196 ',' '|' '=' ':' '.'
e66e38a @evanmiller More operators.
evanmiller authored May 22, 2010
197 '==' '!='
198 '>=' '<='
199 '>' '<'
694fc92 Preliminary blocktrans support
Evan Miller authored Jun 24, 2011
200 '(' ')'
201 '_'.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
202
203 Rootsymbol
204 Elements.
205
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored May 21, 2010
206 %% Operator precedences for the E non terminal
207 Left 100 or_keyword.
208 Left 110 and_keyword.
e66e38a @evanmiller More operators.
evanmiller authored May 22, 2010
209 Nonassoc 300 '==' '!=' '>=' '<=' '>' '<'.
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored May 21, 2010
210 Unary 600 Unot.
211
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
212 Elements -> '$empty' : [].
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored May 22, 2010
213 Elements -> Elements string : '$1' ++ ['$2'].
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
214 Elements -> Elements AutoEscapeBlock : '$1' ++ ['$2'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
215 Elements -> Elements BlockBlock : '$1' ++ ['$2'].
694fc92 Preliminary blocktrans support
Evan Miller authored Jun 24, 2011
216 Elements -> Elements BlockTransBlock : '$1' ++ ['$2'].
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
217 Elements -> Elements CallTag : '$1' ++ ['$2'].
218 Elements -> Elements CallWithTag : '$1' ++ ['$2'].
219 Elements -> Elements CommentBlock : '$1' ++ ['$2'].
220 Elements -> Elements CustomTag : '$1' ++ ['$2'].
221 Elements -> Elements CycleTag : '$1' ++ ['$2'].
222 Elements -> Elements ExtendsTag : '$1' ++ ['$2'].
223 Elements -> Elements FilterBlock : '$1' ++ ['$2'].
50080db @asonge Adding firstof functionality
asonge authored Jan 3, 2010
224 Elements -> Elements FirstofTag : '$1' ++ ['$2'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
225 Elements -> Elements ForBlock : '$1' ++ ['$2'].
226 Elements -> Elements IfBlock : '$1' ++ ['$2'].
15fa5ce @rsaccon added ifequal tag
rsaccon authored Jan 21, 2008
227 Elements -> Elements IfEqualBlock : '$1' ++ ['$2'].
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored Jan 21, 2008
228 Elements -> Elements IfNotEqualBlock : '$1' ++ ['$2'].
1b16fa0 Support for {% ifchanged %} tag
Evan Miller authored Feb 19, 2012
229 Elements -> Elements IfChangedBlock : '$1' ++ ['$2'].
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
230 Elements -> Elements IncludeTag : '$1' ++ ['$2'].
231 Elements -> Elements NowTag : '$1' ++ ['$2'].
c624a50 Support for {% regroup %} tag.
Evan Miller authored Feb 19, 2012
232 Elements -> Elements RegroupBlock : '$1' ++ ['$2'].
e26d23f @evanmiller New tag: spaceless
evanmiller authored Mar 19, 2011
233 Elements -> Elements SpacelessBlock : '$1' ++ ['$2'].
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
234 Elements -> Elements SSITag : '$1' ++ ['$2'].
235 Elements -> Elements TemplatetagTag : '$1' ++ ['$2'].
236 Elements -> Elements TransTag : '$1' ++ ['$2'].
237 Elements -> Elements ValueBraced : '$1' ++ ['$2'].
238 Elements -> Elements WidthRatioTag : '$1' ++ ['$2'].
239 Elements -> Elements WithBlock : '$1' ++ ['$2'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
240
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored Feb 14, 2008
241 ValueBraced -> open_var Value close_var : '$2'.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
242
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored May 22, 2010
243 Value -> Value '|' Filter : {apply_filter, '$1', '$3'}.
8411bac @evanmiller More flexible "_" function
evanmiller authored Jun 27, 2012
244 Value -> '_' '(' Value ')' : {trans, '$3'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored Feb 14, 2008
245 Value -> Variable : '$1'.
246 Value -> Literal : '$1'.
247
9646b5a @evanmiller Implement "iriencode" filter
evanmiller authored Mar 19, 2011
248 Values -> Value : ['$1'].
249 Values -> Values Value : '$1' ++ ['$2'].
250
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored Feb 14, 2008
251 Variable -> identifier : {variable, '$1'}.
1a719d9 @evanmiller Use a translation fun instead of translation dict.
evanmiller authored May 27, 2010
252 Variable -> Variable '.' identifier : {attribute, {'$3', '$1'}}.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
253
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
254 AutoEscapeBlock -> AutoEscapeBraced Elements EndAutoEscapeBraced : {autoescape, '$1', '$2'}.
255 AutoEscapeBraced -> open_tag autoescape_keyword identifier close_tag : '$3'.
256 EndAutoEscapeBraced -> open_tag endautoescape_keyword close_tag.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
257
258 BlockBlock -> BlockBraced Elements EndBlockBraced : {block, '$1', '$2'}.
259 BlockBraced -> open_tag block_keyword identifier close_tag : '$3'.
260 EndBlockBraced -> open_tag endblock_keyword close_tag.
261
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
262 ExtendsTag -> open_tag extends_keyword string_literal close_tag : {extends, '$3'}.
fa28530 @evanmiller Change "include" tag to follow Django behavior
evanmiller authored Mar 19, 2011
263
264 IncludeTag -> open_tag include_keyword string_literal close_tag : {include, '$3', []}.
265 IncludeTag -> open_tag include_keyword string_literal with_keyword Args close_tag : {include, '$3', '$5'}.
ab53409 @evanmiller Support "only" keyword with include
evanmiller authored Mar 20, 2011
266 IncludeTag -> open_tag include_keyword string_literal only_keyword close_tag : {include_only, '$3', []}.
267 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 Mar 19, 2011
268
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
269 NowTag -> open_tag now_keyword string_literal close_tag : {date, now, '$3'}.
270
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
271 CommentBlock -> CommentBraced Elements EndCommentBraced : {comment, '$2'}.
272 CommentBraced -> open_tag comment_keyword close_tag.
273 EndCommentBraced -> open_tag endcomment_keyword close_tag.
274
b67188e @evanmiller Support for "cycle" tag. Patch from Hunter Morris.
evanmiller authored Jun 28, 2008
275 CycleTag -> open_tag cycle_keyword CycleNamesCompat close_tag : {cycle_compat, '$3'}.
276 CycleTag -> open_tag cycle_keyword CycleNames close_tag : {cycle, '$3'}.
277
278 CycleNames -> Value : ['$1'].
279 CycleNames -> CycleNames Value : '$1' ++ ['$2'].
280
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored May 22, 2010
281 CycleNamesCompat -> identifier ',' : ['$1'].
282 CycleNamesCompat -> CycleNamesCompat identifier ',' : '$1' ++ ['$2'].
b67188e @evanmiller Support for "cycle" tag. Patch from Hunter Morris.
evanmiller authored Jun 28, 2008
283 CycleNamesCompat -> CycleNamesCompat identifier : '$1' ++ ['$2'].
284
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
285 FilterBlock -> FilterBraced Elements EndFilterBraced : {filter, '$1', '$2'}.
286 FilterBraced -> open_tag filter_keyword Filters close_tag : '$3'.
287 EndFilterBraced -> open_tag endfilter_keyword close_tag.
288
289 Filters -> Filter : ['$1'].
290 Filters -> Filters '|' Filter : '$1' ++ ['$3'].
291
9646b5a @evanmiller Implement "iriencode" filter
evanmiller authored Mar 19, 2011
292 FirstofTag -> open_tag firstof_keyword Values close_tag : {firstof, '$3'}.
50080db @asonge Adding firstof functionality
asonge authored Jan 3, 2010
293
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
294 ForBlock -> ForBraced Elements EndForBraced : {for, '$1', '$2'}.
25abda5 @evanmiller Support for {% empty %} block in for loops.
evanmiller authored May 22, 2010
295 ForBlock -> ForBraced Elements EmptyBraced Elements EndForBraced : {for, '$1', '$2', '$4'}.
296 EmptyBraced -> open_tag empty_keyword close_tag.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
297 ForBraced -> open_tag for_keyword ForExpression close_tag : '$3'.
298 EndForBraced -> open_tag endfor_keyword close_tag.
898fbae @evanmiller Support {% for .. in .. reversed %} syntax
evanmiller authored Apr 4, 2013
299 ForExpression -> ForGroup in_keyword Variable : {'in', '$1', '$3', false}.
300 ForExpression -> ForGroup in_keyword Variable reversed_keyword : {'in', '$1', '$3', true}.
677116d @evanmiller * Support for unpacking tuples in a for loop.
evanmiller authored Jan 22, 2008
301 ForGroup -> identifier : ['$1'].
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored May 22, 2010
302 ForGroup -> ForGroup ',' identifier : '$1' ++ ['$3'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
303
9f074aa @psyeugenic Add support for {% elif Expr %} syntax
psyeugenic authored Jul 19, 2012
304 IfBlock -> IfBraced Elements ElseBraced Elements EndIfBraced : {'ifelse', '$1', '$2', '$4'}.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
305 IfBlock -> IfBraced Elements EndIfBraced : {'if', '$1', '$2'}.
9f074aa @psyeugenic Add support for {% elif Expr %} syntax
psyeugenic authored Jul 19, 2012
306 IfBlock -> IfBraced Elements ElifBlock : {'if', '$1', '$2', ['$3']}.
307 ElifBlock -> ElifBraced Elements ElseBraced Elements EndIfBraced : {'ifelse', '$1', '$2', '$4'}.
308 ElifBlock -> ElifBraced Elements EndIfBraced : {'if', '$1', '$2'}.
309 ElifBlock -> ElifBraced Elements ElifBlock : {'if', '$1', '$2', ['$3']}.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
310 IfBraced -> open_tag if_keyword IfExpression close_tag : '$3'.
9f074aa @psyeugenic Add support for {% elif Expr %} syntax
psyeugenic authored Jul 19, 2012
311 ElifBraced -> open_tag elif_keyword IfExpression close_tag : '$3'.
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored May 21, 2010
312 IfExpression -> Value in_keyword Value : {'expr', "in", '$1', '$3'}.
313 IfExpression -> Value not_keyword in_keyword Value : {'expr', "not", {'expr', "in", '$1', '$4'}}.
314 IfExpression -> Value '==' Value : {'expr', "eq", '$1', '$3'}.
e66e38a @evanmiller More operators.
evanmiller authored May 22, 2010
315 IfExpression -> Value '!=' Value : {'expr', "ne", '$1', '$3'}.
316 IfExpression -> Value '>=' Value : {'expr', "ge", '$1', '$3'}.
317 IfExpression -> Value '<=' Value : {'expr', "le", '$1', '$3'}.
318 IfExpression -> Value '>' Value : {'expr', "gt", '$1', '$3'}.
319 IfExpression -> Value '<' Value : {'expr', "lt", '$1', '$3'}.
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored May 21, 2010
320 IfExpression -> '(' IfExpression ')' : '$2'.
321 IfExpression -> Unot : '$1'.
322 IfExpression -> IfExpression or_keyword IfExpression : {'expr', "or", '$1', '$3'}.
323 IfExpression -> IfExpression and_keyword IfExpression : {'expr', "and", '$1', '$3'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored Feb 14, 2008
324 IfExpression -> Value : '$1'.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
325
b96dd0b @evanmiller Zotonic: Basic boolean operators in "if" clause
evanmiller authored May 21, 2010
326 Unot -> not_keyword IfExpression : {expr, "not", '$2'}.
327
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
328 ElseBraced -> open_tag else_keyword close_tag.
329 EndIfBraced -> open_tag endif_keyword close_tag.
330
11b4380 @thge Support {% ifchanged Expression(s) %} like Django does
thge authored May 4, 2012
331 IfChangedBlock -> IfChangedBraced Elements ElseBraced Elements EndIfChangedBraced : {ifchangedelse, '$1', '$2', '$4'}.
332 IfChangedBlock -> IfChangedBraced Elements EndIfChangedBraced : {ifchanged, '$1', '$2'}.
1b16fa0 Support for {% ifchanged %} tag
Evan Miller authored Feb 19, 2012
333 IfChangedBraced -> open_tag ifchanged_keyword close_tag.
165b1bf Support arbitrary number of arguments to ifchanged
Evan Miller authored May 11, 2012
334 IfChangedBraced -> open_tag ifchanged_keyword Values close_tag : '$3'.
1b16fa0 Support for {% ifchanged %} tag
Evan Miller authored Feb 19, 2012
335 EndIfChangedBraced -> open_tag endifchanged_keyword close_tag.
336
15fa5ce @rsaccon added ifequal tag
rsaccon authored Jan 21, 2008
337 IfEqualBlock -> IfEqualBraced Elements ElseBraced Elements EndIfEqualBraced : {ifequalelse, '$1', '$2', '$4'}.
338 IfEqualBlock -> IfEqualBraced Elements EndIfEqualBraced : {ifequal, '$1', '$2'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored Feb 14, 2008
339 IfEqualBraced -> open_tag ifequal_keyword IfEqualExpression Value close_tag : ['$3', '$4'].
340 IfEqualExpression -> Value : '$1'.
15fa5ce @rsaccon added ifequal tag
rsaccon authored Jan 21, 2008
341 EndIfEqualBraced -> open_tag endifequal_keyword close_tag.
342
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored Jan 21, 2008
343 IfNotEqualBlock -> IfNotEqualBraced Elements ElseBraced Elements EndIfNotEqualBraced : {ifnotequalelse, '$1', '$2', '$4'}.
344 IfNotEqualBlock -> IfNotEqualBraced Elements EndIfNotEqualBraced : {ifnotequal, '$1', '$2'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored Feb 14, 2008
345 IfNotEqualBraced -> open_tag ifnotequal_keyword IfNotEqualExpression Value close_tag : ['$3', '$4'].
346 IfNotEqualExpression -> Value : '$1'.
7ebb7dd @rsaccon added ifnotequal tag
rsaccon authored Jan 21, 2008
347 EndIfNotEqualBraced -> open_tag endifnotequal_keyword close_tag.
348
c624a50 Support for {% regroup %} tag.
Evan Miller authored Feb 19, 2012
349 RegroupBlock -> RegroupBraced Elements EndRegroupBraced : {regroup, '$1', '$2'}.
e157b4d @garazdawi Extend the regroup syntax to support nested keys
garazdawi authored May 18, 2012
350 RegroupBraced -> open_tag regroup_keyword Value by_keyword Value as_keyword identifier close_tag : {'$3', '$5', '$7'}.
c624a50 Support for {% regroup %} tag.
Evan Miller authored Feb 19, 2012
351 EndRegroupBraced -> open_tag endregroup_keyword close_tag.
352
e26d23f @evanmiller New tag: spaceless
evanmiller authored Mar 19, 2011
353 SpacelessBlock -> open_tag spaceless_keyword close_tag Elements open_tag endspaceless_keyword close_tag : {spaceless, '$4'}.
354
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
355 SSITag -> open_tag ssi_keyword Value close_tag : {ssi, '$3'}.
fa28530 @evanmiller Change "include" tag to follow Django behavior
evanmiller authored Mar 19, 2011
356 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 Mar 19, 2011
357
dc377d7 {% blocktrans %} no longer uses identifiers
Evan Miller authored Feb 18, 2012
358 BlockTransBlock -> open_tag blocktrans_keyword close_tag Elements open_tag endblocktrans_keyword close_tag : {blocktrans, [], '$4'}.
359 BlockTransBlock -> open_tag blocktrans_keyword with_keyword Args close_tag Elements open_tag endblocktrans_keyword close_tag : {blocktrans, '$4', '$6'}.
694fc92 Preliminary blocktrans support
Evan Miller authored Jun 24, 2011
360
7bd6d35 @evanmiller New tags: ssi, filter, templatetag, and widthratio
evanmiller authored Mar 19, 2011
361 TemplatetagTag -> open_tag templatetag_keyword Templatetag close_tag : {templatetag, '$3'}.
362
363 Templatetag -> openblock_keyword : '$1'.
364 Templatetag -> closeblock_keyword : '$1'.
365 Templatetag -> openvariable_keyword : '$1'.
366 Templatetag -> closevariable_keyword : '$1'.
367 Templatetag -> openbrace_keyword : '$1'.
368 Templatetag -> closebrace_keyword : '$1'.
369 Templatetag -> opencomment_keyword : '$1'.
370 Templatetag -> closecomment_keyword : '$1'.
371
372 TransTag -> open_tag trans_keyword string_literal close_tag : {trans, '$3'}.
373 TransTag -> open_tag trans_keyword Variable close_tag : {trans, '$3'}.
374 TransTag -> open_tag trans_keyword string_literal noop_keyword close_tag : '$3'.
375 TransTag -> open_tag trans_keyword Variable noop_keyword close_tag : '$3'.
376
377 WidthRatioTag -> open_tag widthratio_keyword Value Value number_literal close_tag : {widthratio, '$3', '$4', '$5'}.
378
379 WithBlock -> WithBraced Elements EndWithBraced : {with, '$1', '$2'}.
380 WithBraced -> open_tag with_keyword Args close_tag : '$3'.
381 EndWithBraced -> open_tag endwith_keyword close_tag.
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
382
383 Filter -> identifier : ['$1'].
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored May 22, 2010
384 Filter -> identifier ':' Literal : ['$1', '$3'].
ae6bf4b @evanmiller Integrate new filters and tests from dgulino
evanmiller authored Mar 18, 2011
385 Filter -> identifier ':' Variable : ['$1', '$3'].
873b0ef @rsaccon monster commit: integrated Evan's changes (much improved everything)
rsaccon authored Jan 11, 2008
386
387 Literal -> string_literal : '$1'.
677116d @evanmiller * Support for unpacking tuples in a for loop.
evanmiller authored Jan 22, 2008
388 Literal -> number_literal : '$1'.
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored Jan 31, 2008
389
390 CustomTag -> open_tag identifier Args close_tag : {tag, '$2', '$3'}.
391
392 Args -> '$empty' : [].
4fb4176 @evanmiller Slightly nicer error messages.
evanmiller authored May 22, 2010
393 Args -> Args identifier '=' Value : '$1' ++ [{'$2', '$4'}].
e1c0e96 @rsaccon added call custom tag (based on patch from Jeremey Latt) - not comple…
rsaccon authored Jan 31, 2008
394
395 CallTag -> open_tag call_keyword identifier close_tag : {call, '$3'}.
b4bf177 @evanmiller 1. Can resolve variables from function calls to parameterized modules…
evanmiller authored Feb 14, 2008
396 CallWithTag -> open_tag call_keyword identifier with_keyword Value close_tag : {call, '$3', '$5'}.
9f074aa @psyeugenic Add support for {% elif Expr %} syntax
psyeugenic authored Jul 19, 2012
397
398 %% vim: syntax=erlang
Something went wrong with that request. Please try again.