curlybars 1.16.1.pre.3 → 1.17.0.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/exe/curlybars-indent-lint +2 -0
  3. data/lib/curlybars/configuration.rb +5 -1
  4. data/lib/curlybars/dependency_tracker.rb +2 -0
  5. data/lib/curlybars/error/base.rb +2 -0
  6. data/lib/curlybars/error/compile.rb +2 -0
  7. data/lib/curlybars/error/lex.rb +2 -0
  8. data/lib/curlybars/error/parse.rb +4 -0
  9. data/lib/curlybars/error/presenter/not_found.rb +2 -0
  10. data/lib/curlybars/error/render.rb +2 -0
  11. data/lib/curlybars/error/validate.rb +2 -0
  12. data/lib/curlybars/generic.rb +2 -0
  13. data/lib/curlybars/lexer.rb +159 -53
  14. data/lib/curlybars/method_whitelist.rb +2 -0
  15. data/lib/curlybars/node/block_helper_else.rb +2 -0
  16. data/lib/curlybars/node/each_else.rb +3 -0
  17. data/lib/curlybars/node/if_else.rb +2 -0
  18. data/lib/curlybars/node/item.rb +2 -0
  19. data/lib/curlybars/node/literal.rb +2 -0
  20. data/lib/curlybars/node/option.rb +2 -0
  21. data/lib/curlybars/node/output.rb +2 -0
  22. data/lib/curlybars/node/partial.rb +2 -0
  23. data/lib/curlybars/node/path.rb +2 -5
  24. data/lib/curlybars/node/root.rb +2 -0
  25. data/lib/curlybars/node/sub_expression.rb +10 -11
  26. data/lib/curlybars/node/template.rb +2 -5
  27. data/lib/curlybars/node/text.rb +2 -0
  28. data/lib/curlybars/node/unless_else.rb +2 -0
  29. data/lib/curlybars/node/variable.rb +2 -0
  30. data/lib/curlybars/node/with_else.rb +3 -0
  31. data/lib/curlybars/parser.rb +247 -146
  32. data/lib/curlybars/partial_presenter.rb +2 -0
  33. data/lib/curlybars/path_finder.rb +3 -2
  34. data/lib/curlybars/position.rb +2 -0
  35. data/lib/curlybars/presenter.rb +2 -0
  36. data/lib/curlybars/processor/token_factory.rb +3 -1
  37. data/lib/curlybars/railtie.rb +2 -0
  38. data/lib/curlybars/rendering_support.rb +16 -1
  39. data/lib/curlybars/safe_buffer.rb +2 -0
  40. data/lib/curlybars/serialization_guard.rb +2 -0
  41. data/lib/curlybars/template_handler.rb +2 -0
  42. data/lib/curlybars/token.rb +28 -0
  43. data/lib/curlybars/validation_context.rb +2 -0
  44. data/lib/curlybars/version.rb +1 -1
  45. data/lib/curlybars/visitor.rb +2 -0
  46. data/lib/curlybars.rb +16 -10
  47. metadata +3 -33
  48. data/lib/curlybars/node/boolean.rb +0 -24
  49. data/lib/curlybars/node/string.rb +0 -24
  50. data/lib/curlybars/processor/tilde.rb +0 -34
@@ -1,4 +1,6 @@
1
- require 'rltk/parser'
1
+ # frozen_string_literal: true
2
+
3
+ require 'curlybars/token'
2
4
 
3
5
  require 'curlybars/node/root'
4
6
  require 'curlybars/node/template'
@@ -18,192 +20,290 @@ require 'curlybars/node/output'
18
20
  require 'curlybars/node/sub_expression'
19
21
 
20
22
  module Curlybars
21
- class Parser < RLTK::Parser
22
- start :root
23
-
24
- production(:root, 'template?') { |template| Node::Root.new(template || VOID, pos(0)) }
25
- production(:template, 'items') { |items| Node::Template.new(items || [], pos(0)) }
26
-
27
- production(:items) do
28
- clause('items item') { |items, item| items << Node::Item.new(item) }
29
- clause('item') { |item| [Node::Item.new(item)] }
23
+ # Recursive descent parser turning a token stream from Curlybars::Lexer into
24
+ # an AST of Curlybars::Node objects.
25
+ #
26
+ # Grammar (tokens in upper case, `?` optional, `*` zero or more):
27
+ #
28
+ # root := template? EOS
29
+ # template := item+
30
+ # item := TEXT
31
+ # | START HASH block
32
+ # | START GT path option* END
33
+ # | START path expression* option* END
34
+ # | START value END
35
+ # block := (IF | UNLESS) expression END body(IF | UNLESS)
36
+ # | (EACH | WITH) (path | subexpression) END body(EACH | WITH)
37
+ # | path expression* option* END body(path)
38
+ # body(close) := template? (START ELSE END template?)? START SLASH close END
39
+ # option := KEY expression
40
+ # expression := value | path | subexpression
41
+ # value := LITERAL | VARIABLE
42
+ # path := PATH
43
+ # subexpression := LPAREN path expression* option* RPAREN
44
+ #
45
+ # Inside a block body, a template ends at `{{/` or `{{else`, which is why the
46
+ # parser looks one token past START before deciding to parse an item.
47
+ class Parser
48
+ class Error < StandardError
49
+ # The token that the parser could not accept.
50
+ attr_reader :current
51
+
52
+ def initialize(current)
53
+ @current = current
54
+ super("Unexpected token #{current.type}")
55
+ end
30
56
  end
31
57
 
32
- production(:item) do
33
- clause('TEXT') { |text| Node::Text.new(text) }
58
+ class ParseDepthExceeded < Error
59
+ # The depth limit that the template exceeded.
60
+ attr_reader :limit
34
61
 
35
- clause('START HASH .path .expressions? .options? END
36
- .template?
37
- START SLASH .path END') do |helper, arguments, options, template, helperclose|
38
- Node::BlockHelperElse.new(
39
- helper,
40
- arguments || [],
41
- options || [],
42
- template || VOID,
43
- VOID,
44
- helperclose,
45
- pos(0)
46
- )
62
+ def initialize(current, limit)
63
+ @limit = limit
64
+ super(current)
47
65
  end
66
+ end
48
67
 
49
- clause('START HASH .path .expressions? .options? END
50
- .template?
51
- START ELSE END
52
- .template?
53
- START SLASH .path END') do |helper, arguments, options, helper_template, else_template, helperclose|
54
- Node::BlockHelperElse.new(
55
- helper,
56
- arguments || [],
57
- options || [],
58
- helper_template || VOID,
59
- else_template || VOID,
60
- helperclose,
61
- pos(0)
62
- )
63
- end
68
+ # Blocks and subexpressions nested deeper than the depth limit are rejected,
69
+ # so that recursion in the parser, in Node#validate and Node#compile, and in
70
+ # Ruby compiling the generated code cannot exhaust the stack. The last one
71
+ # is the tightest, and it is bounded by the machine stack rather than the VM
72
+ # stack: with a 1 MB machine stack, about 72 nested #each blocks are enough
73
+ # to raise SystemStackError, and each extra MB allows roughly 70 more
74
+ # levels. Threads get 1 MB by default (RUBY_THREAD_MACHINE_STACK_SIZE),
75
+ # while the main thread gets the process stack size limit (`ulimit -s`).
76
+ DEFAULT_PARSE_DEPTH_LIMIT = 50
64
77
 
65
- clause('START .path .expressions? .options? END') do |helper, arguments, options|
66
- Node::BlockHelperElse.new(
67
- helper,
68
- arguments || [],
69
- options || [],
70
- VOID,
71
- VOID,
72
- helper,
73
- pos(0)
74
- )
75
- end
78
+ EXPRESSION_START = [:LITERAL, :VARIABLE, :PATH, :LPAREN].freeze
76
79
 
77
- clause('START .value END') do |value|
78
- Node::Output.new(value)
79
- end
80
+ def self.parse(tokens, depth_limit: DEFAULT_PARSE_DEPTH_LIMIT)
81
+ new(tokens, depth_limit: depth_limit).parse
82
+ end
80
83
 
81
- clause('START HASH IF .expression END
82
- .template?
83
- START SLASH IF END') do |expression, if_template|
84
- Node::IfElse.new(expression, if_template || VOID, VOID)
85
- end
84
+ attr_reader :depth_limit
86
85
 
87
- clause('START HASH IF .expression END
88
- .template?
89
- START ELSE END
90
- .template?
91
- START SLASH IF END') do |expression, if_template, else_template|
92
- Node::IfElse.new(expression, if_template || VOID, else_template || VOID)
93
- end
86
+ # The deepest nesting of blocks and subexpressions seen so far, which is
87
+ # what the depth limit applies to.
88
+ attr_reader :max_depth
94
89
 
95
- clause('START HASH UNLESS .expression END
96
- .template?
97
- START SLASH UNLESS END') do |expression, unless_template|
98
- Node::UnlessElse.new(expression, unless_template || VOID, VOID)
99
- end
90
+ def initialize(tokens, depth_limit: DEFAULT_PARSE_DEPTH_LIMIT)
91
+ @tokens = tokens
92
+ @depth_limit = depth_limit
93
+ @index = 0
94
+ @depth = 0
95
+ @max_depth = 0
96
+ end
100
97
 
101
- clause('START HASH UNLESS .expression END
102
- .template?
103
- START ELSE END
104
- .template?
105
- START SLASH UNLESS END') do |expression, unless_template, else_template|
106
- Node::UnlessElse.new(expression, unless_template || VOID, else_template || VOID)
98
+ def parse
99
+ template = parse_template(in_block: false)
100
+ expect(:EOS)
101
+ if template
102
+ Node::Root.new(template, template.position)
103
+ else
104
+ Node::Root.new(VOID, StreamPosition::NULL)
107
105
  end
106
+ end
108
107
 
109
- clause('START HASH EACH .path END
110
- .template?
111
- START SLASH EACH END') do |path, each_template|
112
- Node::EachElse.new(path, each_template || VOID, VOID, pos(0))
113
- end
108
+ private
114
109
 
115
- clause('START HASH EACH .subexpression END
116
- .template?
117
- START SLASH EACH END') do |subexpression, each_template|
118
- Node::EachElse.new(subexpression, each_template || VOID, VOID, pos(0))
119
- end
110
+ def parse_template(in_block:)
111
+ first_index = @index
112
+ items = []
113
+ items << Node::Item.new(parse_item) while item_start?(in_block)
114
+ Node::Template.new(items, span(first_index)) unless items.empty?
115
+ end
120
116
 
121
- clause('START HASH EACH .path END
122
- .template?
123
- START ELSE END
124
- .template?
125
- START SLASH EACH END') do |path, each_template, else_template|
126
- Node::EachElse.new(path, each_template || VOID, else_template || VOID, pos(0))
117
+ def item_start?(in_block)
118
+ case peek.type
119
+ when :TEXT then true
120
+ when :START then !(in_block && [:SLASH, :ELSE].include?(peek(1).type))
121
+ else false
127
122
  end
123
+ end
128
124
 
129
- clause('START HASH EACH .subexpression END
130
- .template?
131
- START ELSE END
132
- .template?
133
- START SLASH EACH END') do |subexpression, each_template, else_template|
134
- Node::EachElse.new(subexpression, each_template || VOID, else_template || VOID, pos(0))
125
+ def parse_item
126
+ return Node::Text.new(advance.value) if peek.type == :TEXT
127
+
128
+ first_index = @index
129
+ expect(:START)
130
+
131
+ case peek.type
132
+ when :HASH
133
+ advance
134
+ parse_block(first_index)
135
+ when :GT
136
+ advance
137
+ path = parse_path
138
+ options = parse_options
139
+ expect(:END)
140
+ Node::Partial.new(path, options, span(first_index))
141
+ when :PATH
142
+ helper = parse_path
143
+ arguments = parse_expressions
144
+ options = parse_options
145
+ expect(:END)
146
+ Node::BlockHelperElse.new(helper, arguments, options, VOID, VOID, helper, span(first_index))
147
+ when :LITERAL
148
+ literal = parse_literal
149
+ expect(:END)
150
+ Node::Output.new(literal)
151
+ when :VARIABLE
152
+ variable = parse_variable
153
+ expect(:END)
154
+ Node::Output.new(variable)
155
+ else
156
+ raise Error, peek
135
157
  end
158
+ end
136
159
 
137
- clause('START HASH WITH .path END
138
- .template?
139
- START SLASH WITH END') do |path, with_template|
140
- Node::WithElse.new(path, with_template || VOID, VOID, pos(0))
160
+ def parse_block(first_index)
161
+ case peek.type
162
+ when :IF, :UNLESS
163
+ keyword = advance.type
164
+ expression = parse_expression
165
+ expect(:END)
166
+ template, else_template = parse_body(first_index) { expect(keyword) }
167
+ node_class = keyword == :IF ? Node::IfElse : Node::UnlessElse
168
+ node_class.new(expression, template || VOID, else_template || VOID)
169
+ when :EACH, :WITH
170
+ keyword = advance.type
171
+ path = peek.type == :LPAREN ? parse_subexpression : parse_path
172
+ expect(:END)
173
+ template, else_template = parse_body(first_index) { expect(keyword) }
174
+ node_class = keyword == :EACH ? Node::EachElse : Node::WithElse
175
+ node_class.new(path, template || VOID, else_template || VOID, span(first_index))
176
+ when :PATH
177
+ helper = parse_path
178
+ arguments = parse_expressions
179
+ options = parse_options
180
+ expect(:END)
181
+ template, else_template, helperclose = parse_body(first_index) { parse_path }
182
+ Node::BlockHelperElse.new(
183
+ helper,
184
+ arguments,
185
+ options,
186
+ template || VOID,
187
+ else_template || VOID,
188
+ helperclose,
189
+ span(first_index)
190
+ )
191
+ else
192
+ raise Error, peek
141
193
  end
194
+ end
142
195
 
143
- clause('START HASH WITH .subexpression END
144
- .template?
145
- START SLASH WITH END') do |subexpression, with_template|
146
- Node::WithElse.new(subexpression, with_template || VOID, VOID, pos(0))
196
+ # Parses a block body up to and including its closing tag. The block
197
+ # parses the name that follows `{{/`, which is returned as the third
198
+ # element.
199
+ def parse_body(first_index)
200
+ nested(first_index) do
201
+ template = parse_template(in_block: true)
202
+ expect(:START)
203
+
204
+ if peek.type == :ELSE
205
+ advance
206
+ expect(:END)
207
+ else_template = parse_template(in_block: true)
208
+ expect(:START)
209
+ end
210
+
211
+ expect(:SLASH)
212
+ closing_name = yield
213
+ expect(:END)
214
+
215
+ [template, else_template, closing_name]
147
216
  end
217
+ end
148
218
 
149
- clause('START HASH WITH .path END
150
- .template?
151
- START ELSE END
152
- .template?
153
- START SLASH WITH END') do |path, with_template, else_template|
154
- Node::WithElse.new(path, with_template || VOID, else_template || VOID, pos(0))
155
- end
219
+ def parse_options
220
+ options = []
221
+ options << Node::Option.new(advance.value, parse_expression) while peek.type == :KEY
222
+ options
223
+ end
156
224
 
157
- clause('START HASH WITH .subexpression END
158
- .template?
159
- START ELSE END
160
- .template?
161
- START SLASH WITH END') do |subexpression, with_template, else_template|
162
- Node::WithElse.new(subexpression, with_template || VOID, else_template || VOID, pos(0))
163
- end
225
+ def parse_expressions
226
+ expressions = []
227
+ expressions << parse_expression while EXPRESSION_START.include?(peek.type)
228
+ expressions
229
+ end
164
230
 
165
- clause('START GT .path .options? END') do |path, options|
166
- Node::Partial.new(path, options || [], pos(0))
231
+ def parse_expression
232
+ case peek.type
233
+ when :LITERAL then parse_literal
234
+ when :VARIABLE then parse_variable
235
+ when :PATH then parse_path
236
+ when :LPAREN then parse_subexpression
237
+ else raise Error, peek
167
238
  end
168
239
  end
169
240
 
170
- production(:options) do
171
- clause('options option') { |options, option| options << option }
172
- clause('option') { |option| [option] }
241
+ def parse_literal
242
+ token = expect(:LITERAL)
243
+ Node::Literal.new(token.value)
173
244
  end
174
245
 
175
- production(:option, '.KEY .expression') do |key, expression|
176
- Node::Option.new(key, expression)
246
+ def parse_variable
247
+ token = expect(:VARIABLE)
248
+ Node::Variable.new(token.value, token.position)
177
249
  end
178
250
 
179
- production(:expressions) do
180
- clause('expressions expression') { |expressions, expression| expressions << expression }
181
- clause('expression') { |expression| [expression] }
251
+ def parse_path
252
+ token = expect(:PATH)
253
+ Node::Path.new(token.value, token.position)
182
254
  end
183
255
 
184
- production(:expression) do
185
- clause('value') { |value| value }
186
- clause('path') { |path| path }
187
- clause('subexpression') { |subexpression| subexpression }
256
+ def parse_subexpression
257
+ first_index = @index
258
+ expect(:LPAREN)
259
+ nested(first_index) do
260
+ helper = parse_path
261
+ arguments = parse_expressions
262
+ options = parse_options
263
+ expect(:RPAREN)
264
+ Node::SubExpression.new(helper, arguments, options, span(first_index))
265
+ end
188
266
  end
189
267
 
190
- production(:value) do
191
- clause('LITERAL') { |literal| Node::Literal.new(literal) }
192
- clause('VARIABLE') { |variable| Node::Variable.new(variable, pos(0)) }
193
- end
268
+ def nested(first_index)
269
+ raise ParseDepthExceeded.new(@tokens[first_index], depth_limit) if @depth >= depth_limit
194
270
 
195
- production(:path, 'PATH') { |path| Node::Path.new(path, pos(0)) }
271
+ @depth += 1
272
+ @max_depth = @depth if @depth > @max_depth
273
+ result = yield
274
+ @depth -= 1
275
+ result
276
+ end
196
277
 
197
- production(:subexpression, 'LPAREN .path .expressions? .options? RPAREN') do |helper, arguments, options|
198
- Node::SubExpression.new(
199
- helper,
200
- arguments || [],
201
- options || [],
202
- pos(0)
278
+ # The position spanning from the token at `first_index` through the last
279
+ # token consumed.
280
+ def span(first_index)
281
+ start = @tokens[first_index].position
282
+ finish = @tokens[@index - 1].position
283
+ StreamPosition.new(
284
+ start.stream_offset,
285
+ start.line_number,
286
+ start.line_offset,
287
+ finish.stream_offset + finish.length - start.stream_offset,
288
+ start.file_name
203
289
  )
204
290
  end
205
291
 
206
- finalize
292
+ def expect(type)
293
+ raise Error, peek unless peek.type == type
294
+
295
+ advance
296
+ end
297
+
298
+ def advance
299
+ token = peek
300
+ @index += 1
301
+ token
302
+ end
303
+
304
+ def peek(offset = 0)
305
+ @tokens[@index + offset] || Token::EOS
306
+ end
207
307
 
208
308
  VOID = Class.new do
209
309
  def compile
@@ -218,5 +318,6 @@ module Curlybars
218
318
  # Empty cache key.
219
319
  end
220
320
  end.new
321
+ private_constant :VOID
221
322
  end
222
323
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Curlybars
2
4
  class PartialPresenter
3
5
  extend MethodWhitelist
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Curlybars
2
4
  class PathFinder
3
5
  def initialize(ast)
@@ -82,8 +84,7 @@ module Curlybars
82
84
  stack.pop unless stack.empty?
83
85
  end
84
86
 
85
- remaining_segments = full_path.empty? ? [] : full_path.split('.')
86
- stack + remaining_segments
87
+ stack + full_path.split('.')
87
88
  end
88
89
 
89
90
  def handle_block_helper(node, context_stack)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Curlybars
2
4
  Position = Struct.new(:file_name, :line_number, :line_offset, :length) do
3
5
  def initialize(file_name, line_number, line_offset, length = 0)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'curlybars/method_whitelist'
2
4
  require 'curlybars/configuration'
3
5
 
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Curlybars
2
4
  module Processor
3
5
  module TokenFactory
4
6
  def create_token(type, value, position)
5
- RLTK::Token.new(type, value, position)
7
+ Curlybars::Token.new(type, value, position)
6
8
  end
7
9
  end
8
10
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'curlybars/template_handler'
2
4
  require 'curlybars/dependency_tracker'
3
5
  require 'action_view/dependency_tracker'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Curlybars
2
4
  class RenderingSupport
3
5
  def initialize(timeout, contexts, variables, file_name, global_helpers_providers = [], cache = ->(key, &block) { block.call }, start_time: nil, depth: 0, partial_provider: nil)
@@ -31,6 +33,16 @@ module Curlybars
31
33
  raise ::Curlybars::Error::Render.new('timeout', message, nil)
32
34
  end
33
35
 
36
+ # Called before a #with or #each block pushes its context. The contexts
37
+ # stack starts with the root presenter, so its length is one more than
38
+ # the number of enclosing #with and #each blocks.
39
+ def check_nesting_not_too_deep(position)
40
+ return if contexts.length <= Curlybars.configuration.nesting_limit
41
+
42
+ message = "Nesting too deep (> #{Curlybars.configuration.nesting_limit} levels)"
43
+ raise Curlybars::Error::Render.new('nesting_too_deep', message, position)
44
+ end
45
+
34
46
  def check_context_is_presenter(context, path, position)
35
47
  return if presenter?(context)
36
48
 
@@ -257,8 +269,11 @@ module Curlybars
257
269
  raise Curlybars::Error::Render.new('unallowed_path', message, position)
258
270
  end
259
271
 
272
+ # Counts the dots after the final `/` in the path. Leading `../` segments
273
+ # move up the contexts stack rather than traversing, so they don't count.
260
274
  def check_traverse_not_too_deep(traverse, position)
261
- return unless traverse.count('.') > Curlybars.configuration.traversing_limit
275
+ dots = traverse.split('/').last.count('.')
276
+ return unless dots > Curlybars.configuration.traversing_limit
262
277
 
263
278
  message = "`#{traverse}` too deep"
264
279
  raise Curlybars::Error::Render.new('traverse_too_deep', message, position)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Curlybars
2
4
  class SafeBuffer < ActiveSupport::SafeBuffer
3
5
  def concat(buffer)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Curlybars
2
4
  class SerializationGuard
3
5
  def initialize(budget:, depth_limit:)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_support'
2
4
  require 'action_view'
3
5
  require 'curlybars'
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Curlybars
4
+ # A token produced by Curlybars::Lexer and consumed by Curlybars::Parser.
5
+ # Custom processors receive and may replace these (see Processor::TokenFactory).
6
+ Token = Struct.new(:type, :value, :position) do
7
+ # Tokens are equal when type and value match, regardless of position.
8
+ def ==(other)
9
+ type == other.type && value == other.value
10
+ end
11
+
12
+ # Matches RLTK::Token#to_s, e.g. `PATH(a)`, or `END` without a value.
13
+ def to_s
14
+ value ? "#{type}(#{value})" : type.to_s
15
+ end
16
+ end
17
+
18
+ Token::EOS = Token.new(:EOS, nil, nil).freeze
19
+
20
+ # Where a token, or a node built from a run of tokens, appears in the source.
21
+ StreamPosition = Struct.new(:stream_offset, :line_number, :line_offset, :length, :file_name) do
22
+ # Kept from RLTK::StreamPosition.
23
+ alias_method :start, :line_offset
24
+ end
25
+
26
+ # A shared position for tokens that have no source, e.g. in an empty template.
27
+ StreamPosition::NULL = StreamPosition.new(0, 0, 0, 0, nil).freeze
28
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Curlybars
2
4
  class ValidationContext
3
5
  attr_reader :partial_resolver, :depth
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Curlybars
4
- VERSION = '1.16.1.pre.3'
4
+ VERSION = '1.17.0.pre'
5
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_support/core_ext/string/inflections'
2
4
 
3
5
  module Curlybars