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.
- checksums.yaml +4 -4
- data/exe/curlybars-indent-lint +2 -0
- data/lib/curlybars/configuration.rb +5 -1
- data/lib/curlybars/dependency_tracker.rb +2 -0
- data/lib/curlybars/error/base.rb +2 -0
- data/lib/curlybars/error/compile.rb +2 -0
- data/lib/curlybars/error/lex.rb +2 -0
- data/lib/curlybars/error/parse.rb +4 -0
- data/lib/curlybars/error/presenter/not_found.rb +2 -0
- data/lib/curlybars/error/render.rb +2 -0
- data/lib/curlybars/error/validate.rb +2 -0
- data/lib/curlybars/generic.rb +2 -0
- data/lib/curlybars/lexer.rb +159 -53
- data/lib/curlybars/method_whitelist.rb +2 -0
- data/lib/curlybars/node/block_helper_else.rb +2 -0
- data/lib/curlybars/node/each_else.rb +3 -0
- data/lib/curlybars/node/if_else.rb +2 -0
- data/lib/curlybars/node/item.rb +2 -0
- data/lib/curlybars/node/literal.rb +2 -0
- data/lib/curlybars/node/option.rb +2 -0
- data/lib/curlybars/node/output.rb +2 -0
- data/lib/curlybars/node/partial.rb +2 -0
- data/lib/curlybars/node/path.rb +2 -5
- data/lib/curlybars/node/root.rb +2 -0
- data/lib/curlybars/node/sub_expression.rb +10 -11
- data/lib/curlybars/node/template.rb +2 -5
- data/lib/curlybars/node/text.rb +2 -0
- data/lib/curlybars/node/unless_else.rb +2 -0
- data/lib/curlybars/node/variable.rb +2 -0
- data/lib/curlybars/node/with_else.rb +3 -0
- data/lib/curlybars/parser.rb +247 -146
- data/lib/curlybars/partial_presenter.rb +2 -0
- data/lib/curlybars/path_finder.rb +3 -2
- data/lib/curlybars/position.rb +2 -0
- data/lib/curlybars/presenter.rb +2 -0
- data/lib/curlybars/processor/token_factory.rb +3 -1
- data/lib/curlybars/railtie.rb +2 -0
- data/lib/curlybars/rendering_support.rb +16 -1
- data/lib/curlybars/safe_buffer.rb +2 -0
- data/lib/curlybars/serialization_guard.rb +2 -0
- data/lib/curlybars/template_handler.rb +2 -0
- data/lib/curlybars/token.rb +28 -0
- data/lib/curlybars/validation_context.rb +2 -0
- data/lib/curlybars/version.rb +1 -1
- data/lib/curlybars/visitor.rb +2 -0
- data/lib/curlybars.rb +16 -10
- metadata +3 -33
- data/lib/curlybars/node/boolean.rb +0 -24
- data/lib/curlybars/node/string.rb +0 -24
- data/lib/curlybars/processor/tilde.rb +0 -34
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f6da5518b6b73d9f76f01132039228b8eeb4e7ca2e47fb6148dcdb05bbac949d
|
|
4
|
+
data.tar.gz: '0688645c6e1f342ca1529b64b7797e48f0ffc27f697a73b717bcb1e222bb0ba7'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5bc3d992f6cc5d2f5a730efd765aae1d75ff2ec8665588d8387ff4faded3716f24f9b0b1680f8e9066cf4b05ebb3e008a6f91432a211af629434374398ceac49
|
|
7
|
+
data.tar.gz: c1a1f65604432f1156f34ec8d4ae3755f656a6647380bd068eda016fcaf5d79bbb5eabb6c5d63cb94a56be89ac6df007b96ab3b45351143a8513c34fd10ff241
|
data/exe/curlybars-indent-lint
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Curlybars
|
|
2
4
|
class << self
|
|
3
5
|
attr_writer :configuration
|
|
@@ -13,14 +15,16 @@ module Curlybars
|
|
|
13
15
|
|
|
14
16
|
def self.reset
|
|
15
17
|
@configuration = Configuration.new
|
|
18
|
+
@global_helpers_dependency_tree = nil
|
|
16
19
|
end
|
|
17
20
|
|
|
18
21
|
class Configuration
|
|
19
|
-
attr_accessor :presenters_namespace, :nesting_limit, :traversing_limit, :output_limit, :rendering_timeout, :custom_processors, :compiler_transformers, :global_helpers_provider_classes, :cache, :partial_nesting_limit, :partial_provider_class
|
|
22
|
+
attr_accessor :presenters_namespace, :nesting_limit, :traversing_limit, :output_limit, :rendering_timeout, :custom_processors, :compiler_transformers, :global_helpers_provider_classes, :cache, :partial_nesting_limit, :partial_provider_class, :parse_depth_limit
|
|
20
23
|
|
|
21
24
|
def initialize
|
|
22
25
|
@presenters_namespace = ''
|
|
23
26
|
@nesting_limit = 10
|
|
27
|
+
@parse_depth_limit = Curlybars::Parser::DEFAULT_PARSE_DEPTH_LIMIT
|
|
24
28
|
@traversing_limit = 10
|
|
25
29
|
@output_limit = 1.megabyte
|
|
26
30
|
@rendering_timeout = 10.seconds
|
data/lib/curlybars/error/base.rb
CHANGED
data/lib/curlybars/error/lex.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'curlybars/error/base'
|
|
2
4
|
|
|
3
5
|
module Curlybars
|
|
@@ -9,6 +11,8 @@ module Curlybars
|
|
|
9
11
|
if exception.current.type == :EOS
|
|
10
12
|
message = "A block helper hasn't been closed properly"
|
|
11
13
|
position = EOSPosition.new(source)
|
|
14
|
+
elsif exception.is_a?(Curlybars::Parser::ParseDepthExceeded)
|
|
15
|
+
message = "Blocks and subexpressions cannot be nested more than %d levels deep" % exception.limit
|
|
12
16
|
else
|
|
13
17
|
line_number = position.line_number
|
|
14
18
|
line_offset = position.line_offset
|
data/lib/curlybars/generic.rb
CHANGED
data/lib/curlybars/lexer.rb
CHANGED
|
@@ -1,64 +1,170 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'strscan'
|
|
4
|
+
require 'curlybars/token'
|
|
2
5
|
|
|
3
6
|
# rubocop:disable Style/RegexpLiteral, Style/Semicolon
|
|
4
7
|
module Curlybars
|
|
5
|
-
class Lexer
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
class Lexer
|
|
9
|
+
class Error < StandardError
|
|
10
|
+
attr_reader :stream_offset, :line_number, :line_offset, :remainder
|
|
11
|
+
|
|
12
|
+
def initialize(stream_offset, line_number, line_offset, remainder)
|
|
13
|
+
@stream_offset = stream_offset
|
|
14
|
+
@line_number = line_number
|
|
15
|
+
@line_offset = line_offset
|
|
16
|
+
@remainder = remainder
|
|
17
|
+
super("Unable to match string with any of the given rules: #{remainder}")
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Rules are tried in definition order and the first match wins. A rule
|
|
22
|
+
# can declare the bytes its matches start with (`first:`), and is then
|
|
23
|
+
# only tried when the next byte is one of them. Rules without `first:`
|
|
24
|
+
# are tried at every byte.
|
|
25
|
+
# Each rule belongs to a state; the current state is the top of a stack
|
|
26
|
+
# that rule actions manipulate with push_state and pop_state.
|
|
27
|
+
# Actions receive the matched text and can read capture groups with
|
|
28
|
+
# @scanner[n].
|
|
29
|
+
Rule = Data.define(:pattern, :action)
|
|
30
|
+
|
|
31
|
+
@rules = Hash.new { |hash, state| hash[state] = [] }
|
|
32
|
+
# For each state, the rules to try for each value of the next byte.
|
|
33
|
+
@dispatch = Hash.new { |hash, state| hash[state] = Array.new(256) { [] } }
|
|
34
|
+
|
|
35
|
+
class << self
|
|
36
|
+
attr_reader :rules, :dispatch
|
|
37
|
+
|
|
38
|
+
def r(pattern, state = :default, first: nil, &action)
|
|
39
|
+
rule = Rule.new(pattern, action || proc {})
|
|
40
|
+
@rules[state] << rule
|
|
41
|
+
(first ? first.bytes : 0..255).each { |byte| @dispatch[state][byte] << rule }
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def lex(string, file_name = nil)
|
|
45
|
+
new(string, file_name).tokens
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# The following is a Handlebars compliant identifier
|
|
50
|
+
# IDENTIFIER = '[A-Za-z_]\w*'
|
|
10
51
|
|
|
11
52
|
# This accomodates the edge case of identifiers containing dashes
|
|
12
|
-
# IDENTIFIER = '[A-Za-z_\-][
|
|
53
|
+
# IDENTIFIER = '[A-Za-z_\-][\w\-]*'
|
|
13
54
|
|
|
14
55
|
# This accomodates the edge case of identifiers containing all numbers
|
|
15
56
|
# and dashes
|
|
16
|
-
IDENTIFIER = '[
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
r(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
r(/{{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
r(/{{
|
|
30
|
-
r(/~}}/, :curly) { pop_state; :
|
|
31
|
-
|
|
32
|
-
r(/{{
|
|
33
|
-
r(/}}/, :curly) { pop_state; :END }
|
|
34
|
-
|
|
35
|
-
r(/\(/, :curly) { push_state :curly; :LPAREN }
|
|
36
|
-
r(/\)/, :curly) { pop_state; :RPAREN }
|
|
37
|
-
|
|
38
|
-
r(/#/, :curly) { :HASH }
|
|
39
|
-
r(/\//, :curly) { :SLASH }
|
|
40
|
-
r(/>/, :curly) { :GT }
|
|
41
|
-
|
|
42
|
-
r(/if\b/, :curly) { :IF }
|
|
43
|
-
r(/unless\b/, :curly) { :UNLESS }
|
|
44
|
-
r(/each\b/, :curly) { :EACH }
|
|
45
|
-
r(/with\b/, :curly) { :WITH }
|
|
46
|
-
r(/else\b/, :curly) { :ELSE }
|
|
47
|
-
|
|
48
|
-
r(/true/, :curly) { [:LITERAL, true] }
|
|
49
|
-
r(/false/, :curly) { [:LITERAL, false] }
|
|
50
|
-
r(/[-+]?\d+/, :curly) { |integer| [:LITERAL, integer.to_i] }
|
|
51
|
-
r(/'(.*?)'/, :curly) { [:LITERAL,
|
|
52
|
-
r(/"(.*?)"/, :curly) { [:LITERAL,
|
|
53
|
-
|
|
54
|
-
r(/@((?:\.\.\/)*#{IDENTIFIER})/o, :curly) {
|
|
55
|
-
|
|
56
|
-
r(/(#{IDENTIFIER})\s*=/o, :curly) { [:KEY,
|
|
57
|
-
r(/(?:\.\.\/)*(?:#{IDENTIFIER}\.)*#{IDENTIFIER}/o, :curly) { |name| [:PATH, name] }
|
|
58
|
-
|
|
59
|
-
r(/\s
|
|
60
|
-
|
|
61
|
-
r(/.*?(?=\\|{{|\z)/m) { |text| [:TEXT, text] }
|
|
57
|
+
IDENTIFIER = '[\w\-]+'
|
|
58
|
+
IDENTIFIER_START = [*'0'..'9', *'A'..'Z', *'a'..'z', '_', '-'].join.freeze
|
|
59
|
+
|
|
60
|
+
r(/\\{/, first: '\\') { [:TEXT, '{'] }
|
|
61
|
+
r(/\\/, first: '\\') { [:TEXT, '\\'] }
|
|
62
|
+
|
|
63
|
+
# Comments are skipped up to their closing delimiter, or to the end of
|
|
64
|
+
# the template when they are not closed.
|
|
65
|
+
r(/{{!--.*?(?:--}}|\z)/m, first: '{')
|
|
66
|
+
r(/{{!.*?(?:}}|\z)/m, first: '{')
|
|
67
|
+
|
|
68
|
+
# The tilde operator strips whitespace from the adjacent text:
|
|
69
|
+
# `{{~` from the previous token and `~}}` from the next one.
|
|
70
|
+
r(/{{~/, first: '{') { rstrip_previous_text; push_state :curly; :START }
|
|
71
|
+
r(/~}}/, :curly, first: '~') { pop_state; lstrip_next_text; :END }
|
|
72
|
+
|
|
73
|
+
r(/{{/, first: '{') { push_state :curly; :START }
|
|
74
|
+
r(/}}/, :curly, first: '}') { pop_state; :END }
|
|
75
|
+
|
|
76
|
+
r(/\(/, :curly, first: '(') { push_state :curly; :LPAREN }
|
|
77
|
+
r(/\)/, :curly, first: ')') { pop_state; :RPAREN }
|
|
78
|
+
|
|
79
|
+
r(/#/, :curly, first: '#') { :HASH }
|
|
80
|
+
r(/\//, :curly, first: '/') { :SLASH }
|
|
81
|
+
r(/>/, :curly, first: '>') { :GT }
|
|
82
|
+
|
|
83
|
+
r(/if\b/, :curly, first: 'i') { :IF }
|
|
84
|
+
r(/unless\b/, :curly, first: 'u') { :UNLESS }
|
|
85
|
+
r(/each\b/, :curly, first: 'e') { :EACH }
|
|
86
|
+
r(/with\b/, :curly, first: 'w') { :WITH }
|
|
87
|
+
r(/else\b/, :curly, first: 'e') { :ELSE }
|
|
88
|
+
|
|
89
|
+
r(/true/, :curly, first: 't') { [:LITERAL, true] }
|
|
90
|
+
r(/false/, :curly, first: 'f') { [:LITERAL, false] }
|
|
91
|
+
r(/[-+]?\d+/, :curly, first: '-+0123456789') { |integer| [:LITERAL, integer.to_i] }
|
|
92
|
+
r(/'(.*?)'/, :curly, first: "'") { [:LITERAL, @scanner[1].inspect] }
|
|
93
|
+
r(/"(.*?)"/, :curly, first: '"') { [:LITERAL, @scanner[1].inspect] }
|
|
94
|
+
|
|
95
|
+
r(/@((?:\.\.\/)*#{IDENTIFIER})/o, :curly, first: '@') { [:VARIABLE, @scanner[1]] }
|
|
96
|
+
|
|
97
|
+
r(/(#{IDENTIFIER})\s*=/o, :curly, first: IDENTIFIER_START) { [:KEY, @scanner[1]] }
|
|
98
|
+
r(/(?:\.\.\/)*(?:#{IDENTIFIER}\.)*#{IDENTIFIER}/o, :curly, first: ".#{IDENTIFIER_START}") { |name| [:PATH, name] }
|
|
99
|
+
|
|
100
|
+
r(/\s+/, :curly, first: " \t\n\v\f\r")
|
|
101
|
+
|
|
102
|
+
r(/.*?(?=\\|{{|\z)/m) { |text| [:TEXT, @tokens.length == @lstrip_index ? text.lstrip : text] }
|
|
103
|
+
|
|
104
|
+
def initialize(string, file_name)
|
|
105
|
+
@string = string
|
|
106
|
+
@scanner = StringScanner.new(string)
|
|
107
|
+
@file_name = file_name
|
|
108
|
+
@states = [:default]
|
|
109
|
+
@tokens = []
|
|
110
|
+
@lstrip_index = nil
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def tokens
|
|
114
|
+
stream_offset = 0
|
|
115
|
+
line_number = 1
|
|
116
|
+
line_offset = 0
|
|
117
|
+
|
|
118
|
+
until @scanner.eos?
|
|
119
|
+
text = nil
|
|
120
|
+
candidates = self.class.dispatch[@states.last][@string.getbyte(@scanner.pos)]
|
|
121
|
+
rule = candidates.detect { |candidate| text = @scanner.scan(candidate.pattern) }
|
|
122
|
+
raise Error.new(stream_offset, line_number, line_offset, @scanner.rest) unless rule
|
|
123
|
+
|
|
124
|
+
type, value = instance_exec(text, &rule.action)
|
|
125
|
+
|
|
126
|
+
if type
|
|
127
|
+
position = StreamPosition.new(stream_offset, line_number, line_offset, text.length, @file_name)
|
|
128
|
+
@tokens << Token.new(type, value, position)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
stream_offset += text.length
|
|
132
|
+
newlines = text.count("\n")
|
|
133
|
+
if newlines > 0
|
|
134
|
+
line_number += newlines
|
|
135
|
+
line_offset = text.length - text.rindex("\n") - 1
|
|
136
|
+
else
|
|
137
|
+
line_offset += text.length
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
@tokens << Token::EOS
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
private
|
|
145
|
+
|
|
146
|
+
def push_state(state)
|
|
147
|
+
@states.push(state)
|
|
148
|
+
nil
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def pop_state
|
|
152
|
+
@states.pop
|
|
153
|
+
nil
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
def rstrip_previous_text
|
|
157
|
+
previous = @tokens.last
|
|
158
|
+
return unless previous&.type == :TEXT
|
|
159
|
+
|
|
160
|
+
@tokens[-1] = Token.new(:TEXT, previous.value.rstrip, previous.position)
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# The rule calling this emits a token at index @tokens.length, so the
|
|
164
|
+
# following token lands at @tokens.length + 1.
|
|
165
|
+
def lstrip_next_text
|
|
166
|
+
@lstrip_index = @tokens.length + 1
|
|
167
|
+
end
|
|
62
168
|
end
|
|
63
169
|
end
|
|
64
170
|
# rubocop:enable Style/RegexpLiteral, Style/Semicolon
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Curlybars
|
|
2
4
|
module Node
|
|
3
5
|
EachElse = Struct.new(:path, :each_template, :else_template, :position) do
|
|
@@ -12,6 +14,7 @@ module Curlybars
|
|
|
12
14
|
template_cache_key = '#{each_template.cache_key}'
|
|
13
15
|
|
|
14
16
|
collection = rendering.coerce_to_hash!(collection, #{collection_path.path.inspect}, position)
|
|
17
|
+
rendering.check_nesting_not_too_deep(position)
|
|
15
18
|
collection.each.with_index.map do |key_and_presenter, index|
|
|
16
19
|
rendering.check_timeout!
|
|
17
20
|
rendering.optional_presenter_cache(key_and_presenter[1], template_cache_key, buffer) do |buffer|
|
data/lib/curlybars/node/item.rb
CHANGED
data/lib/curlybars/node/path.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Curlybars
|
|
2
4
|
module Node
|
|
3
5
|
Path = Struct.new(:path, :position) do
|
|
@@ -168,11 +170,6 @@ module Curlybars
|
|
|
168
170
|
|
|
169
171
|
message = "`#{path}` cannot resolve to a helper"
|
|
170
172
|
raise Curlybars::Error::Validate.new('not_a_helper', message, position)
|
|
171
|
-
when :not_helper
|
|
172
|
-
return unless helper?(branches)
|
|
173
|
-
|
|
174
|
-
message = "`#{path}` resolves to a helper"
|
|
175
|
-
raise Curlybars::Error::Validate.new('is_a_helper', message, position)
|
|
176
173
|
when :anything
|
|
177
174
|
else
|
|
178
175
|
raise "invalid type `#{check_type}`"
|
data/lib/curlybars/node/root.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Curlybars
|
|
2
4
|
module Node
|
|
3
5
|
SubExpression = Struct.new(:helper, :arguments, :options, :position) do
|
|
@@ -63,22 +65,19 @@ module Curlybars
|
|
|
63
65
|
|
|
64
66
|
type = node.resolve_and_check!(branches, check_type: check_type)
|
|
65
67
|
|
|
66
|
-
if
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
if generic_helper?(type)
|
|
69
|
+
is_collection = type.last.is_a?(Array)
|
|
70
|
+
infer_generic_helper_type!(branches, is_collection: is_collection)
|
|
71
|
+
elsif helper?(type)
|
|
72
|
+
type.last
|
|
73
|
+
else
|
|
74
|
+
type
|
|
73
75
|
end
|
|
74
|
-
|
|
75
|
-
type
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
def generic_helper?(type)
|
|
79
|
-
return false unless
|
|
79
|
+
return false unless helper?(type)
|
|
80
80
|
return false unless type.size == 2
|
|
81
|
-
return false unless type.first == :helper
|
|
82
81
|
|
|
83
82
|
type.last == [{}] || type.last == {}
|
|
84
83
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Curlybars
|
|
2
4
|
module Node
|
|
3
5
|
Template = Struct.new(:items, :position) do
|
|
@@ -9,11 +11,6 @@ module Curlybars
|
|
|
9
11
|
<<-RUBY
|
|
10
12
|
::Module.new do
|
|
11
13
|
def self.exec(contexts, rendering, variables, buffer)
|
|
12
|
-
unless contexts.length < ::Curlybars.configuration.nesting_limit
|
|
13
|
-
message = "Nesting too deep"
|
|
14
|
-
position = rendering.position(#{position.line_number}, #{position.line_offset})
|
|
15
|
-
raise ::Curlybars::Error::Render.new('nesting_too_deep', message, position)
|
|
16
|
-
end
|
|
17
14
|
#{compiled_items}
|
|
18
15
|
end
|
|
19
16
|
end.exec(contexts, rendering, variables, buffer)
|
data/lib/curlybars/node/text.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Curlybars
|
|
2
4
|
module Node
|
|
3
5
|
WithElse = Struct.new(:path, :with_template, :else_template, :position) do
|
|
@@ -10,6 +12,7 @@ module Curlybars
|
|
|
10
12
|
if rendering.to_bool(compiled_path)
|
|
11
13
|
position = rendering.position(#{position.line_number}, #{position.line_offset})
|
|
12
14
|
rendering.check_context_is_presenter(compiled_path, #{presenter_path.path.inspect}, position)
|
|
15
|
+
rendering.check_nesting_not_too_deep(position)
|
|
13
16
|
|
|
14
17
|
contexts.push(compiled_path)
|
|
15
18
|
begin
|