Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Shopify/liquid
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.5.0
Choose a base ref
...
head repository: Shopify/liquid
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Oct 3, 2022

  1. Update homepage url

    `http://www.liquidmarkup.org` is `http` 
    `http://www.liquidmarkup.org` redirects to `https://shopify.github.io/liquid/`
    `https://www.liquidmarkup.org` can’t provide a secure connection (ERR_SSL_PROTOCOL_ERROR)
    tjoyal authored Oct 3, 2022
    Copy the full SHA
    347a241 View commit details

Commits on Apr 5, 2024

  1. Commit a .ruby-version

    jenshenny committed Apr 5, 2024
    Copy the full SHA
    8596bb2 View commit details
  2. Update rubocop to 1.61.0

    jenshenny committed Apr 5, 2024
    Copy the full SHA
    fc4f194 View commit details
  3. Remove TargetRubyVersion in RuboCop config

    reads from required_ruby_version in RuboCop 1.61+
    jenshenny committed Apr 5, 2024
    Copy the full SHA
    2b48100 View commit details
  4. Remove ruby version definition in CI/CD

    it will be read from .ruby-version
    jenshenny committed Apr 5, 2024
    Copy the full SHA
    36c7fc8 View commit details
  5. Copy the full SHA
    88d013c View commit details

Commits on Apr 11, 2024

  1. Merge pull request #1792 from Shopify/centralize_ruby_version

    Centralize Ruby Version to `.ruby-version`
    peterzhu2118 authored Apr 11, 2024
    Copy the full SHA
    77bc56a View commit details

Commits on Jul 16, 2024

  1. Copy the full SHA
    d36937d View commit details
  2. Require base64

    ianks committed Jul 16, 2024
    Copy the full SHA
    d6ca569 View commit details
  3. Merge pull request #1811 from Shopify/marco-cycle-update

    Add named? method to Cycle class for checking if the cycle is named
    ianks authored Jul 16, 2024
    Copy the full SHA
    ed42120 View commit details

Commits on Jul 23, 2024

  1. Bump to v5.5.1

    ianks committed Jul 23, 2024
    Copy the full SHA
    a0411e0 View commit details

Commits on Aug 7, 2024

  1. Add concept of Liquid::Environment (#1815)

    * Add concept of `Liquid::World`
    
    * Rename `World` to `Environment`
    ianks authored Aug 7, 2024
    Copy the full SHA
    fb6634f View commit details

Commits on Aug 15, 2024

  1. Copy the full SHA
    9067e51 View commit details
  2. Merge pull request #1818 from Shopify/tablerow-interrupt

    Handle interrupts in table row
    alexcoco authored Aug 15, 2024
    Copy the full SHA
    ac91d31 View commit details
  3. Bump to v5.6.0.alpha (#1819)

    ianks authored Aug 15, 2024
    Copy the full SHA
    b233b3d View commit details

Commits on Oct 23, 2024

  1. Speed up the lexer for Ruby 3.4+ (#1832)

    * Speed up lexing
    
    * Bump msrv to 3.0 (from 2.7)
    
    * Normalize test for ruby-head compat
    
    * Fix bug when parsing negative numbers
    ianks authored Oct 23, 2024
    Copy the full SHA
    b355378 View commit details

Commits on Oct 24, 2024

  1. Update liquid docs for named parameters

    The YARD liquid gem now supports specifying named parameters. For the
    core liquid tags and filters this is the only object I could find that
    needed to be updated.
    graygilmore committed Oct 24, 2024
    Copy the full SHA
    8d7ed70 View commit details

Commits on Oct 25, 2024

  1. Copy the full SHA
    cb16219 View commit details
  2. Copy the full SHA
    fb6ac72 View commit details

Commits on Oct 28, 2024

  1. Merge pull request #1831 from Shopify/gg-add-named-params-docs

    Update liquid docs for named parameters
    graygilmore authored Oct 28, 2024
    Copy the full SHA
    6d58c41 View commit details
  2. Merge pull request #1833 from Shopify/fast-variable-parse

    Faster Variable BlockBody Matching
    ggmichaelgo authored Oct 28, 2024
    Copy the full SHA
    b419648 View commit details
  3. Copy the full SHA
    6c13805 View commit details
  4. Copy the full SHA
    d94293a View commit details
  5. Merge pull request #1837 from Shopify/lexer-comparison-fix

    fix lexer parsing comparison without whitespaces
    ggmichaelgo authored Oct 28, 2024
    Copy the full SHA
    36251e6 View commit details
  6. Merge pull request #1835 from Shopify/fix-multibyte-variable-parsing

    fix parsing Variable blockbody with multibyte character
    ggmichaelgo authored Oct 28, 2024
    Copy the full SHA
    1943441 View commit details

Commits on Oct 30, 2024

  1. Copy the full SHA
    8a9f33a View commit details
  2. Merge pull request #1839 from Shopify/lexer-parse-error-with-utf8

    raise syntax error from lexer parser with UTF-8 character
    ggmichaelgo authored Oct 30, 2024
    Copy the full SHA
    c626dfa View commit details
  3. Copy the full SHA
    1375a9e View commit details
  4. Merge pull request #1840 from Shopify/fix-lexer-contains-as-id

    fix lexer parsing ID 'contains' as comparison
    ggmichaelgo authored Oct 30, 2024
    Copy the full SHA
    f6ffc37 View commit details
  5. Copy the full SHA
    f6a3e25 View commit details
  6. refactor lexer unit test

    ggmichaelgo committed Oct 30, 2024
    Copy the full SHA
    f00670c View commit details
  7. Copy the full SHA
    ffce6de View commit details
  8. Merge pull request #1838 from Shopify/quirky-lexer-parsing

    fix parsing quirky incomplete expressions
    ggmichaelgo authored Oct 30, 2024
    Copy the full SHA
    8e40f80 View commit details

Commits on Nov 4, 2024

  1. remove TagRegistry

    ggmichaelgo committed Nov 4, 2024
    Copy the full SHA
    29986d3 View commit details
  2. Copy the full SHA
    3ed54bf View commit details
  3. Merge pull request #1845 from Shopify/remove-tag-registry

    remove TagRegistry
    ggmichaelgo authored Nov 4, 2024
    Copy the full SHA
    4bd22a2 View commit details
  4. Merge pull request #1846 from Shopify/env-propgating

    propagate Environment on new Context creation
    ggmichaelgo authored Nov 4, 2024
    Copy the full SHA
    06f4422 View commit details
  5. Copy the full SHA
    1f3ea73 View commit details
  6. Merge pull request #1843 from Shopify/empty-array

    avoid allocating new empty array
    ggmichaelgo authored Nov 4, 2024
    Copy the full SHA
    8d86613 View commit details
  7. 1
    Copy the full SHA
    b0cba0b View commit details
  8. Copy the full SHA
    c77ff68 View commit details
  9. Merge pull request #1848 from Shopify/env-warn-cleanup

    clean up all warnings by using new Environment
    ggmichaelgo authored Nov 4, 2024
    Copy the full SHA
    e5d18c8 View commit details
  10. Bump to v5.6.0.rc1

    ianks committed Nov 4, 2024
    Copy the full SHA
    42b6763 View commit details

Commits on Dec 11, 2024

  1. Merge pull request #1634 from tjoyal/patch-1

    Update homepage url
    benjaminsehl authored Dec 11, 2024
    Copy the full SHA
    9a06ced View commit details
  2. Write one value at a time for array variables (#1863)

    * Write one value at a time for array variables
    
    * Handle recursive array
    ianks authored Dec 11, 2024
    Copy the full SHA
    63583ff View commit details
  3. Stop testing against liquid-c (#1868)

    * Stop testing against `liquid-c`
    
    * Bump to `v5.6.0.rc2`
    ianks authored Dec 11, 2024
    Copy the full SHA
    fdd8c71 View commit details

Commits on Dec 17, 2024

  1. Copy the full SHA
    a0a4307 View commit details
  2. Merge pull request #1873 from Shopify/bp/tokenizer-fix

    Fix bug in tokenizer with nil source value
    bahar-p authored Dec 17, 2024
    Copy the full SHA
    c3ac0e0 View commit details
  3. bring back to_s.to_str

    bahar-p committed Dec 17, 2024
    Copy the full SHA
    0c49dd5 View commit details
  4. Bump version patch

    bahar-p committed Dec 17, 2024
    Copy the full SHA
    60701f8 View commit details
Showing with 2,519 additions and 563 deletions.
  1. +20 −4 .github/workflows/liquid.yml
  2. +1 −2 .gitignore
  3. +0 −1 .rubocop.yml
  4. +1 −0 .ruby-version
  5. +8 −0 CONTRIBUTING.md
  6. +8 −5 Gemfile
  7. +71 −0 History.md
  8. +45 −3 README.md
  9. +28 −3 Rakefile
  10. +14 −15 lib/liquid.rb
  11. +11 −8 lib/liquid/block_body.rb
  12. +8 −0 lib/liquid/const.rb
  13. +16 −10 lib/liquid/context.rb
  14. +22 −0 lib/liquid/deprecations.rb
  15. +159 −0 lib/liquid/environment.rb
  16. +97 −21 lib/liquid/expression.rb
  17. +161 −43 lib/liquid/lexer.rb
  18. +2 −0 lib/liquid/locales/en.yml
  19. +29 −6 lib/liquid/parse_context.rb
  20. +1 −1 lib/liquid/parse_tree_visitor.rb
  21. +3 −3 lib/liquid/parser.rb
  22. +3 −3 lib/liquid/range_lookup.rb
  23. +137 −58 lib/liquid/standardfilters.rb
  24. +0 −41 lib/liquid/strainer_factory.rb
  25. +3 −0 lib/liquid/tag.rb
  26. +49 −0 lib/liquid/tags.rb
  27. +0 −2 lib/liquid/tags/assign.rb
  28. +0 −2 lib/liquid/tags/break.rb
  29. +0 −2 lib/liquid/tags/capture.rb
  30. +0 −2 lib/liquid/tags/case.rb
  31. +0 −2 lib/liquid/tags/comment.rb
  32. +0 −2 lib/liquid/tags/continue.rb
  33. +13 −3 lib/liquid/tags/cycle.rb
  34. +0 −2 lib/liquid/tags/decrement.rb
  35. +74 −0 lib/liquid/tags/doc.rb
  36. +0 −2 lib/liquid/tags/echo.rb
  37. +1 −3 lib/liquid/tags/for.rb
  38. +2 −4 lib/liquid/tags/if.rb
  39. +0 −2 lib/liquid/tags/ifchanged.rb
  40. +0 −2 lib/liquid/tags/include.rb
  41. +0 −2 lib/liquid/tags/increment.rb
  42. +0 −2 lib/liquid/tags/inline_comment.rb
  43. +0 −2 lib/liquid/tags/raw.rb
  44. +0 −2 lib/liquid/tags/render.rb
  45. +6 −2 lib/liquid/tags/table_row.rb
  46. +0 −2 lib/liquid/tags/unless.rb
  47. +51 −56 lib/liquid/template.rb
  48. +129 −13 lib/liquid/tokenizer.rb
  49. +96 −0 lib/liquid/utils.rb
  50. +14 −8 lib/liquid/variable.rb
  51. +13 −5 lib/liquid/variable_lookup.rb
  52. +1 −1 lib/liquid/version.rb
  53. +5 −2 liquid.gemspec
  54. +11 −6 performance/benchmark.rb
  55. +8 −7 performance/shopify/liquid.rb
  56. +13 −0 performance/theme_runner.rb
  57. +94 −0 performance/unit/expression_benchmark.rb
  58. +43 −0 performance/unit/lexer_benchmark.rb
  59. +15 −0 test/integration/context_test.rb
  60. +22 −14 test/integration/error_handling_test.rb
  61. +107 −0 test/integration/expression_test.rb
  62. +106 −0 test/integration/hash_rendering_test.rb
  63. +20 −0 test/integration/parsing_quirks_test.rb
  64. +1 −1 test/integration/profiler_test.rb
  65. +222 −5 test/integration/standard_filter_test.rb
  66. +48 −0 test/integration/tags/cycle_tag_test.rb
  67. +17 −20 test/integration/tags/include_tag_test.rb
  68. +1 −0 test/integration/tags/raw_tag_test.rb
  69. +8 −5 test/integration/tags/render_tag_test.rb
  70. +48 −0 test/integration/tags/table_row_test.rb
  71. +4 −0 test/integration/variable_test.rb
  72. +17 −38 test/test_helper.rb
  73. +13 −1 test/unit/block_unit_test.rb
  74. +25 −18 test/unit/{strainer_factory_unit_test.rb → environment_filter_test.rb}
  75. +115 −19 test/unit/lexer_unit_test.rb
  76. +16 −10 test/unit/parser_unit_test.rb
  77. +13 −8 test/unit/strainer_template_unit_test.rb
  78. +13 −4 test/unit/tag_unit_test.rb
  79. +184 −0 test/unit/tags/doc_tag_unit_test.rb
  80. +15 −53 test/unit/template_unit_test.rb
  81. +18 −0 test/unit/tokenizer_unit_test.rb
24 changes: 20 additions & 4 deletions .github/workflows/liquid.yml
Original file line number Diff line number Diff line change
@@ -11,26 +11,42 @@ jobs:
strategy:
matrix:
entry:
- { ruby: 2.7, allowed-failure: false } # minimum supported
- { ruby: 3.0, allowed-failure: false } # minimum supported
- { ruby: 3.2, allowed-failure: false }
- { ruby: 3.3, allowed-failure: false } # latest
- { ruby: ruby-head, allowed-failure: true }
- { ruby: 3.3, allowed-failure: false }
- { ruby: 3.3, allowed-failure: false }
- { ruby: 3.4, allowed-failure: false } # latest
- {
ruby: 3.4,
allowed-failure: false,
rubyopt: "--enable-frozen-string-literal",
}
- { ruby: 3.4, allowed-failure: false, rubyopt: "--yjit" }
- { ruby: ruby-head, allowed-failure: false }
- {
ruby: ruby-head,
allowed-failure: false,
rubyopt: "--enable-frozen-string-literal",
}
- { ruby: ruby-head, allowed-failure: false, rubyopt: "--yjit" }
name: Test Ruby ${{ matrix.entry.ruby }}
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.entry.ruby }}
bundler-cache: true
bundler: latest
- run: bundle exec rake
continue-on-error: ${{ matrix.entry.allowed-failure }}
env:
RUBYOPT: ${{ matrix.entry.rubyopt }}

memory_profile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- run: bundle exec rake memory_profile:run
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@
pkg
*.rbc
.rvmrc
.ruby-version
Gemfile.lock
.bundle
.byebug_history
Gemfile.lock
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ Performance:
Enabled: true

AllCops:
TargetRubyVersion: 2.7
NewCops: disable
SuggestExtensions: false
Exclude:
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.4.1
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -26,3 +26,11 @@
* If it makes sense, add tests for your code and/or run a performance benchmark
* Make sure all tests pass (`bundle exec rake`)
* Create a pull request

## Releasing

* Bump the version in `lib/liquid/version.rb`
* Update the `History.md` file
* Open a PR like [this one](https://github.com/Shopify/liquid/pull/1894) and merge it to `main`
* Create a new release using the [GitHub UI](https://github.com/Shopify/liquid/releases/new)

13 changes: 8 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -7,22 +7,25 @@ end

gemspec

gem "base64"

group :benchmark, :test do
gem 'benchmark-ips'
gem 'memory_profiler'
gem 'terminal-table'
gem "lru_redux"

install_if -> { RUBY_PLATFORM !~ /mingw|mswin|java/ && RUBY_ENGINE != 'truffleruby' } do
gem 'stackprof'
end
end

group :development do
gem "webrick"
end

group :test do
gem 'rubocop', '~> 1.44.0'
gem 'rubocop', '~> 1.61.0'
gem 'rubocop-shopify', '~> 2.12.0', require: false
gem 'rubocop-performance', require: false

platform :mri, :truffleruby do
gem 'liquid-c', github: 'Shopify/liquid-c', ref: 'main'
end
end
71 changes: 71 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,76 @@
# Liquid Change Log

## 5.8.1 (unreleased)

## 5.8.1

* Fix `{% doc %}` tag to be visitable [Guilherme Carreiro]

## 5.8.0

* Introduce the new `{% doc %}` tag [Guilherme Carreiro]

## 5.7.3

* Raise Liquid::SyntaxError when parsing invalidly encoded strings [Chris AtLee]

## 5.7.2 2025-01-31

* Fix array filters to not support nested properties [Guilherme Carreiro]

## 5.7.1 2025-01-24

* Fix the `find` and `find_index`filters to return `nil` when filtering empty arrays [Guilherme Carreiro]
* Fix the `has` filter to return `false` when filtering empty arrays [Guilherme Carreiro]

## 5.7.0 2025-01-16

### Features

* Add `find`, `find_index`, `has`, and `reject` filters to arrays [Guilherme Carreiro]
* Compatibility with Ruby 3.4 [Ian Ker-Seymer]

## 5.6.4 2025-01-14

### Fixes
* Add a default `string_scanner` to avoid errors with `Liquid::VariableLookup.parse("foo.bar")` [Ian Ker-Seymer]

## 5.6.3 2025-01-13
* Remove `lru_redux` dependency [Michael Go]

## 5.6.2 2025-01-13

### Fixes
* Preserve the old behavior of requiring floats to start with a digit [Michael Go]

## 5.6.1 2025-01-13

### Performance improvements
* Faster Expression parser / Tokenizer with StringScanner [Michael Go]

## 5.6.0 2024-12-19

### Architectural changes
* Added new `Environment` class to manage configuration and state that was previously stored in `Template` [Ian Ker-Seymer]
* Moved tag registration from `Template` to `Environment` [Ian Ker-Seymer]
* Removed `StrainerFactory` in favor of `Environment`-based strainer creation [Ian Ker-Seymer]
* Consolidated standard tags into a new `Tags` module with `STANDARD_TAGS` constant [Ian Ker-Seymer]

### Performance improvements
* Optimized `Lexer` with a new `Lexer2` implementation using jump tables for faster tokenization, requires Ruby 3.4 [Ian Ker-Seymer]
* Improved variable rendering with specialized handling for different types [Michael Go]
* Reduced array allocations by using frozen empty constants [Michael Go]

### API changes
* Deprecated several `Template` class methods in favor of `Environment` methods [Ian Ker-Seymer]
* Added deprecation warnings system [Ian Ker-Seymer]
* Changed how filters and tags are registered to use Environment [Ian Ker-Seymer]

### Fixes
* Fixed table row handling of break interrupts [Alex Coco]
* Improved variable output handling for arrays [Ian Ker-Seymer]
* Fix Tokenizer to handle null source value (#1873) [Bahar Pourazar]

## 5.5.0 2024-03-21

Please reference the GitHub release for more information.
48 changes: 45 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -52,6 +52,47 @@ For standard use you can just pass it the content of a file and call render with
@template.render('name' => 'tobi') # => "hi tobi"
```

### Concept of Environments

In Liquid, a "Environment" is a scoped environment that encapsulates custom tags, filters, and other configurations. This allows you to define and isolate different sets of functionality for different contexts, avoiding global overrides that can lead to conflicts and unexpected behavior.

By using environments, you can:

1. **Encapsulate Logic**: Keep the logic for different parts of your application separate.
2. **Avoid Conflicts**: Prevent custom tags and filters from clashing with each other.
3. **Improve Maintainability**: Make it easier to manage and understand the scope of customizations.
4. **Enhance Security**: Limit the availability of certain tags and filters to specific contexts.

We encourage the use of Environments over globally overriding things because it promotes better software design principles such as modularity, encapsulation, and separation of concerns.

Here's an example of how you can define and use Environments in Liquid:

```ruby
user_environment = Liquid::Environment.build do |environment|
environment.register_tag("renderobj", RenderObjTag)
end

Liquid::Template.parse(<<~LIQUID, environment: user_environment)
{% renderobj src: "path/to/model.obj" %}
LIQUID
```

In this example, `RenderObjTag` is a custom tag that is only available within the `user_environment`.

Similarly, you can define another environment for a different context, such as email templates:

```ruby
email_environment = Liquid::Environment.build do |environment|
environment.register_tag("unsubscribe_footer", UnsubscribeFooter)
end

Liquid::Template.parse(<<~LIQUID, environment: email_environment)
{% unsubscribe_footer %}
LIQUID
```

By using Environments, you ensure that custom tags and filters are only available in the contexts where they are needed, making your Liquid templates more robust and easier to manage. For smaller projects, a global environment is available via `Liquid::Environment.default`.

### Error Modes

Setting the error mode of Liquid lets you specify how strictly you want your templates to be interpreted.
@@ -62,9 +103,10 @@ Liquid also comes with a stricter parser that can be used when editing templates
when templates are invalid. You can enable this new parser like this:

```ruby
Liquid::Template.error_mode = :strict # Raises a SyntaxError when invalid syntax is used
Liquid::Template.error_mode = :warn # Adds strict errors to template.errors but continues as normal
Liquid::Template.error_mode = :lax # The default mode, accepts almost anything.
Liquid::Environment.default.error_mode = :strict
Liquid::Environment.default.error_mode = :strict # Raises a SyntaxError when invalid syntax is used
Liquid::Environment.default.error_mode = :warn # Adds strict errors to template.errors but continues as normal
Liquid::Environment.default.error_mode = :lax # The default mode, accepts almost anything.
```

If you want to set the error mode only on specific templates you can pass `:error_mode` as an option to `parse`:
31 changes: 28 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -43,8 +43,6 @@ task :test do
Rake::Task['base_test'].invoke

if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'truffleruby'
ENV['LIQUID_C'] = '1'

ENV['LIQUID_PARSER_MODE'] = 'lax'
Rake::Task['integration_test'].reenable
Rake::Task['integration_test'].invoke
@@ -73,14 +71,41 @@ end

namespace :benchmark do
desc "Run the liquid benchmark with lax parsing"
task :run do
task :lax do
ruby "./performance/benchmark.rb lax"
end

desc "Run the liquid benchmark with strict parsing"
task :strict do
ruby "./performance/benchmark.rb strict"
end

desc "Run the liquid benchmark with both lax and strict parsing"
task run: [:lax, :strict]

desc "Run unit benchmarks"
namespace :unit do
task :all do
Dir["./performance/unit/*_benchmark.rb"].each do |file|
puts "🧪 Running #{file}"
ruby file
end
end

task :lexer do
Dir["./performance/unit/lexer_benchmark.rb"].each do |file|
puts "🧪 Running #{file}"
ruby file
end
end

task :expression do
Dir["./performance/unit/expression_benchmark.rb"].each do |file|
puts "🧪 Running #{file}"
ruby file
end
end
end
end

namespace :profile do
29 changes: 14 additions & 15 deletions lib/liquid.rb
Original file line number Diff line number Diff line change
@@ -21,6 +21,8 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

require "strscan"

module Liquid
FilterSeparator = /\|/
ArgumentSeparator = ','
@@ -44,13 +46,21 @@ module Liquid
VariableParser = /\[(?>[^\[\]]+|\g<0>)*\]|#{VariableSegment}+\??/o

RAISE_EXCEPTION_LAMBDA = ->(_e) { raise }

singleton_class.send(:attr_accessor, :cache_classes)
self.cache_classes = true
HAS_STRING_SCANNER_SCAN_BYTE = StringScanner.instance_methods.include?(:scan_byte)
end

require "liquid/version"
require "liquid/deprecations"
require "liquid/const"
require 'liquid/standardfilters'
require 'liquid/file_system'
require 'liquid/parser_switching'
require 'liquid/tag'
require 'liquid/block'
require 'liquid/parse_tree_visitor'
require 'liquid/interrupts'
require 'liquid/tags'
require "liquid/environment"
require 'liquid/lexer'
require 'liquid/parser'
require 'liquid/i18n'
@@ -61,23 +71,16 @@ module Liquid
require 'liquid/errors'
require 'liquid/interrupts'
require 'liquid/strainer_template'
require 'liquid/strainer_factory'
require 'liquid/expression'
require 'liquid/context'
require 'liquid/parser_switching'
require 'liquid/tag'
require 'liquid/tag/disabler'
require 'liquid/tag/disableable'
require 'liquid/block'
require 'liquid/block_body'
require 'liquid/document'
require 'liquid/variable'
require 'liquid/variable_lookup'
require 'liquid/range_lookup'
require 'liquid/file_system'
require 'liquid/resource_limits'
require 'liquid/expression'
require 'liquid/template'
require 'liquid/standardfilters'
require 'liquid/condition'
require 'liquid/utils'
require 'liquid/tokenizer'
@@ -86,7 +89,3 @@ module Liquid
require 'liquid/usage'
require 'liquid/registers'
require 'liquid/template_factory'

# Load all the tags of the standard library
#
Dir["#{__dir__}/liquid/tags/*.rb"].each { |f| require f }
Loading