Tobias Lütke
594b6da8c5
Initial checkin
2013-03-19 18:30:09 -04:00
Tobias Lutke
7cc10b9abf
various speedups
2013-03-19 18:30:09 -04:00
Tobias Lütke
20beec2de3
Convert parser to C99
2013-03-19 18:30:09 -04:00
Tobias Lutke
06486fd21d
Implement naive recusrive descent
...
Ragel doesn't allow us to recurse so we simply
reinvoke the parser for each step.
2013-03-19 18:30:08 -04:00
Tobias Lütke
7dcf578898
Replace regexpes with Ragel grammer
...
context parsing was handrolled and pretty ad-hoc
this branch exists to explore parsing the context
through a defined fsm as produced by Ragel
2013-03-19 18:30:08 -04:00
Dylan Smith
9913895b81
Merge branch 'master' into remove-symbolizing
...
Conflicts:
lib/liquid/variable.rb
2013-03-05 15:25:11 -05:00
Dylan Smith
d706db3bd7
Add support for filter keyword arguments. Closes #175
2013-03-05 15:17:14 -05:00
Dylan Smith
38b4543bf1
Use sets to check if methods are invokable without symbolizing.
2013-02-05 14:45:08 -05:00
Jason Roelofs
1300210f05
Convert Strainer to white-list method protection
...
After moving the method existence check from Context into Strainer,
updated Strainer to only accept invokation methods that were added via
filter Modules, and done in a way that respond_to? is never called,
preventing unconstrained Symbol table growth.
2013-01-16 11:14:01 -05:00
Jason Roelofs
a48e162237
Change Drop method lookup to not hit respond_to?
...
Class.public_method_defined? ends up diving into Ruby's core looking for
a method with the given method_or_key. This process at some point turns
method_or_key into a Symbol. This change no longer takes that path and
thus doesn't grow the Symbol table.
2013-01-16 11:07:48 -05:00
Jason Roelofs
7bcb565668
Remove #to_sym calls from Drop and Variable
...
Symbols are not needed here and using plain strings is nicer on Ruby
2013-01-16 09:46:17 -05:00
Dylan Smith
ee41b3f4a3
Fix filter parser regex for filter args without separating spaces.
...
The regex was using \S+ to match the comma between the filters
arguments, but would continue to match idependent quote characters and
filter separators. This can result in multiple filters being interpreted as
a single one with many arguments.
2012-12-18 01:23:31 -05:00
Tom Burns
6c2fde5eea
Instantiate blank string once instead of at every comparison
2012-10-25 11:54:19 -04: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
f5a20ff8e8
Fix a regression in tablerow limit parameter.
...
I had accidentally read slice_collection_using_each as using to as an
inclusive limit rather than exclusive, and no tests covered the offset or
limit parameters.
2012-06-21 14:56:05 -04:00
Dylan Smith
d0184555d9
Allow tablerow to work with any Enumerable. Closes #132
2012-06-20 11:07:11 -04:00
Jason Normore
515b31158e
strip_html to ignore comments with html tags. fixes #1650
2012-06-11 10:32:12 -04:00
7rans
40cc799f3d
Add example to split filter.
2012-06-11 10:32:12 -04:00
Daniel Schierbeck
5ac91e0837
Fix typo and add punctuation
2012-06-11 10:32:12 -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
akira yamada
84ed3d9964
apply "o" option to regexps to improve process time
2012-04-02 19:31:55 +09:00
Dennis Theisen
0e3b522fe2
Fix conditions using negative number comparisons
2012-03-12 16:38:34 -04: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
Dennis Theisen
043d816460
Fix tablerow block to work with collection names in quoted syntax.
...
* Allows e.g. {% tablerow product in collections['frontpage'] %} instead of only collections.frontpage
2012-02-22 12:45:38 -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 bce0033c65 .
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 01dea94671 .
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
1a1b4702d7
Merge pull request #80 from ROFISH/master
...
Add Filters to Assign
2011-12-20 13:58:05 -08:00
Igor Zubkov
0eafe7f2fd
Fix typo
2011-12-16 12:28:29 +02:00
Jonathan Rudenberg
c4d713b6bb
Add modulo filter
2011-11-17 14:08:57 -05:00
Ryan Alyea
975b17b529
Allow filters in assign.
...
A simple attempt, but basically it shifts the parsing of the right hand side of the assign from a simple context lookup to using the Variable parser (that includes filters). Fixes #79 .
2011-11-01 01:46:26 -07:00
Jonathan Rudenberg
b816521563
Merge pull request #72 from zacstewart/patch-1
...
Correct formatting for doc comments
2011-10-15 17:25:48 -07:00
Jonathan Rudenberg
487b240404
Fix another drop call regression
2011-10-14 11:21:22 -04:00
Jonathan Rudenberg
8b5cf73ccc
Fix regression with calling a drop with a empty string
2011-10-13 11:47:23 -04:00
Zac
6cf6d8b990
Correct formatting for doc comments
...
Portions of the code examples were not being rendered as code because they lacked a leading tab. Also, a missing period on the first sentence made the first paragraph confusing.
2011-09-10 10:36:22 -03:00
7rans
cc7899aef5
Add split filter.
2011-08-31 21:28:32 -04:00
Jonathan Rudenberg
2434c3d0e0
Remove duplicate commas from StrictQuotedFragment. Closes #26 .
2011-07-12 09:18:46 -04:00
Tobias Lütke
352f83a9d2
Merge pull request #28 from mcr/mcr_inc_tag
...
increment tag
2011-07-01 11:48:13 -07:00
Tobias Lütke
98c96ed86a
Merge pull request #60 from a-team/master
...
Avoid creating singleton classes on nil, true and false objects
2011-07-01 11:43:27 -07:00
Tobias Lütke
410cce9740
Merge pull request #56 from oozou/for-else
...
For-else !!!
2011-07-01 11:42:17 -07:00
Jonathan Rudenberg
4aaf750fa8
Don't mess with the load path
2011-06-30 16:31:37 -04:00
Jonathan Rudenberg
fe25644726
Rescue NameError for Rubinius
2011-06-30 16:24:17 -04:00
Jonathan Rudenberg
c47eac1683
Add kind_of? and singleton_methods to Strainer so that Rubinius works
2011-06-30 16:17:31 -04:00
Tim Felgentreff
c7033ff4c8
Avoid creating singleton classes on nil, true and false objects. Instead extend their respective classes. Just because those objects are singletons in current Ruby implementations doesn't mean we should rely on that. Fixes liquid on Maglev.
2011-06-13 18:13:47 +02:00