Justin Li
070639daba
Push to for_stack at the beginning of For#render
2015-05-15 23:13:15 -04:00
Justin Li
dad98cfc89
Merge pull request #562 from Shopify/use-find_variable-for-parentloop
...
Use custom stack for forloop references
2015-05-15 21:48:57 -04:00
Justin Li
648a4888af
Pop the for_stack register in an ensure
2015-05-14 15:02:20 -04:00
Florian Weingarten
3372ca8136
Rubocop
2015-05-14 14:37:18 +00:00
Justin Li
863e8968f0
Use extra stack for forloop references
2015-05-12 17:04:34 -04:00
Justin Li
4c9d2009f9
Add find_own_variable method to look up internal context variables
2015-05-12 16:49:39 -04:00
Justin Li
239cfa5a44
Use find_variable for parentloop
2015-05-12 16:11:32 -04:00
Justin Li
205bd19d3f
Add forloop.parentloop as a reference to the parent loop
2015-02-04 12:43:09 -05:00
Dylan Thacker-Smith
15e1d46125
Avoid storing options instance variable in BlockBody.
...
There is no need to pass parse options to the BlockBody initializer, since
it does all the parsing in the parse method, unlike tags which parse the
tag markup in the initializer.
2014-11-03 17:07:42 -05:00
Dylan Thacker-Smith
73fcd42403
Create a BlockBody class to decouple block body parsing from tags.
2014-11-03 17:07:42 -05:00
Dylan Thacker-Smith
d502b9282a
Use Expression.parse and Context#evaluate in the For class.
2014-10-18 15:03:36 -04:00
Florian Weingarten
3dbb35d823
Merge branch 'freeze_all_the_things'
...
Conflicts:
History.md
lib/liquid/tags/assign.rb
lib/liquid/tags/capture.rb
lib/liquid/tags/decrement.rb
lib/liquid/tags/if.rb
2014-03-24 12:39:34 -04:00
Dylan Thacker-Smith
d4ecaff8b8
Refactor to create tags with a parse class method instead of new.
...
By moving parse out of the initializer, we can call super at the start of
the initializers for subclasses, and avoid the nasty allocate hack.
2014-03-20 16:10:10 -04:00
Nicholas Jones
8f9f12e542
Merge remote-tracking branch 'upstream/master' into correct-if-nodelists
...
Conflicts:
test/liquid/tags/for_tag_test.rb
test/liquid/tags/if_else_tag_test.rb
2014-01-13 12:43:43 -08:00
Nicholas Jones
06e2f2577f
Add else
blocks to for
and case
nodelists
2014-01-13 11:53:25 -08:00
Florian Weingarten
43ac8d560b
Freeze all the things
2014-01-07 12:35:16 -05:00
Tom Burns
e667352629
move slice_collection optimization to utils
2013-11-24 14:00:23 -05:00
Tom Burns
cf49b06ccc
allow drops to optimize loading a slice of elements
2013-11-24 12:29:15 -05:00
Simon Eskildsen
072c12dc47
Localize errors in Liquid
2013-08-30 12:31:57 -04:00
Tristan Hume
5bdfb62bf2
Remove old warning method
2013-08-22 12:57:16 -04:00
Tristan Hume
047900d0dd
Proper warning support
2013-08-19 15:14:26 -04:00
Tristan Hume
15b53b77d6
Make stuff nicer
2013-08-02 15:17:17 -04:00
Tristan Hume
8ca00982b6
Fixed ranges and added for loop parser
2013-07-29 14:11:47 -04:00
Florian Weingarten
fbfda1a189
Little cosmetic change
2013-07-05 11:30:50 -04:00
Peter Schröder
a2df5a421d
rejects variables like a/b in for loops, closes #150
2013-06-11 17:22:33 -04:00
Tom Burns
8913a5615a
Revert "Merge pull request #185 from ISSIntel/liquid-utf8"
...
This reverts commit c5dfcd29b0937e0d84780f11f61919faa4741806, reversing
changes made to f7d1e1d0c1336a9c51d652f07e0187b429e154e4.
2013-05-20 19:53:13 -04:00
Adam Tanner
0b36540b78
Liquid has UTF8 support.
2012-12-26 18:14:36 -08:00
Jon Daniel
9c183bea83
added interrupt class for continue/break statements
...
When a continue or break statement is executed it pushes an interrupt to a
stack in context. If any non-handled interrupts are present blocks will cease
to execute. The for loop can handle the most recent interrupt in the stack.
2012-08-21 13:14:27 -04:00
Jon Daniel
484fd18612
added break and continue tags
2012-08-21 00:00:02 -04:00
Dylan Smith
d0184555d9
Allow tablerow to work with any Enumerable. Closes #132
2012-06-20 11:07:11 -04:00
Jonathan Rudenberg
1aff63ff57
Merge pull request #107 from amateurhuman/syntax-error-fixes-for-rubinius
...
Fix syntax error in htmltags.rb and for.rb for compatibility with rbx-2.0.0-dev (1.9.3)
2012-06-07 12:14:35 -07:00
Jonathan Rudenberg
08fdcbbf65
Merge pull request #120 from infospace/interpolate_regex_once
...
add interpolate once flag to regexes that never change
2012-06-07 12:06:57 -07:00
Michael Green
281e3ea9c8
add interpolate once flag to regexes that never change
2012-05-08 16:27:50 -07:00
Chris Kelly
db07e2b67e
Fix syntax error in for and htmltags files for compatibility with Rubinius 2.0.0-dev
2012-03-09 00:24:31 -08:00
Dennis Theisen
b8d7b9aeda
Fix for-tag update to also work properly in Ruby 1.8.
...
* Follow up commit to 3d7c1c8
2012-02-29 16:13:46 -05:00
Dennis Theisen
3d7c1c80a0
Ruby 1.8 compatibility fix: Ensure for-loop on an empty string does not enter for-body.
2012-02-29 14:41:21 -05:00
Kristian PD
58ad90677b
Clarified compatibility comments, removed unused var from tag test.
2012-01-20 17:22:23 -05:00
Kristian PD
2b04590d4b
Revert "Revert "Added backwards compatibility for 1.8.7 String.each returning itself (and 1.9.3 not supporting .each).""
...
This reverts commit bce0033c6594d085088383526ad1b64e43aec133.
2012-01-20 16:54:26 -05:00
Kristian PD
bce0033c65
Revert "Added backwards compatibility for 1.8.7 String.each returning itself (and 1.9.3 not supporting .each)."
...
This reverts commit 01dea9467122bf84b0ad9d8249b85aa36d050fef.
2012-01-20 16:47:34 -05:00
Kristian PD
01dea94671
Added backwards compatibility for 1.8.7 String.each returning itself (and 1.9.3 not supporting .each).
...
Moved for tag tests to their own test model from StandardTagTest.
2012-01-20 16:45:41 -05:00
Tobias Lütke
410cce9740
Merge pull request #56 from oozou/for-else
...
For-else !!!
2011-07-01 11:42:17 -07:00
Steven Soroka
1a4ff9547a
render_all should internally always return strings. This eases some 1.9 compatability issues.
2011-05-02 10:58:27 -04:00
Prathan Thananart
d19213177a
Added documentation for for-else
2011-04-28 13:11:13 +07:00
Prathan Thananart
caf59940d3
Added code to make for-else work
2011-04-28 13:07:41 +07:00
Tobias Lütke
edcc14f148
Reverted james filter in tags branch
...
This reverts commit 282786d7e2deb728f82977d4db38b0f7a05e7e76.
Conflicts:
lib/liquid.rb
lib/liquid/variable.rb
test/if_else_test.rb
2009-04-06 08:30:19 -06:00
James MacAulay
3d8efe04a7
filtered variables in for loops
2008-10-24 14:50:59 -04:00
Tobias Lütke
63f9a05223
Implemented reversed flag on for loops {% for a in b reversed %}
2008-05-08 17:17:41 -04:00
Tobias Lütke
4c0cfae0b7
Changed implementation of For in such a way that it only depends on the existence of a each method. This allows drops to simply implement each for enumeration
2008-05-08 12:30:48 -04:00
Tobias Lütke
1d647361e1
Initial github import of liquid
2008-05-08 11:28:13 -04:00