foxtail-runtime 0.6.0 → 0.6.1
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/CHANGELOG.md +5 -0
- data/lib/foxtail/bundle/resolver.rb +12 -2
- data/lib/foxtail/bundle/scope.rb +9 -0
- data/lib/foxtail/runtime/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 910edf16aa47af13bd016e4a61e515a61d6f69fa5b3704195c449371da0e21e8
|
|
4
|
+
data.tar.gz: 8879628635ece445517e2b0409a56a4026ce04f56faf52c317922b7332b1044c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d8ba6ac7ea4aba84ec6d748ac87d49876407c0a221dec6f378ac87bbcf70023df95d579b0d145a27ea7e728f52ff11d54ba048f15ed3b49672133d6620977291
|
|
7
|
+
data.tar.gz: 131d0c122bd6bedf89b4f2948332367b1cf0b7dd8a211248b6add51248df5a617a47aa39f4827ca13666636637994a54eb23cbca41460adbf72c5e3ef51082cc
|
data/CHANGELOG.md
CHANGED
|
@@ -185,16 +185,26 @@ module Foxtail
|
|
|
185
185
|
return "{-#{name}}"
|
|
186
186
|
end
|
|
187
187
|
|
|
188
|
+
# Build an isolated scope containing only the named call arguments.
|
|
189
|
+
# Per the Fluent spec, term scope must not inherit the caller's external variables.
|
|
190
|
+
named_args = expr.args.filter_map {|arg|
|
|
191
|
+
next unless arg.is_a?(Parser::AST::NamedArgument)
|
|
192
|
+
|
|
193
|
+
[arg.name.to_sym, resolve_expression(arg.value, scope)]
|
|
194
|
+
}.to_h
|
|
195
|
+
term_scope = scope.term_scope(**named_args)
|
|
196
|
+
|
|
188
197
|
# Resolve term value
|
|
189
198
|
if attr
|
|
190
|
-
result = resolve_term_attribute(term, attr,
|
|
199
|
+
result = resolve_term_attribute(term, attr, term_scope)
|
|
191
200
|
elsif term.value
|
|
192
|
-
result = resolve_pattern(term.value,
|
|
201
|
+
result = resolve_pattern(term.value, term_scope)
|
|
193
202
|
else
|
|
194
203
|
scope.add_error("No value: -#{name}")
|
|
195
204
|
result = "{-#{name}}"
|
|
196
205
|
end
|
|
197
206
|
|
|
207
|
+
scope.errors.concat(term_scope.errors)
|
|
198
208
|
scope.release(name)
|
|
199
209
|
result
|
|
200
210
|
end
|
data/lib/foxtail/bundle/scope.rb
CHANGED
|
@@ -53,6 +53,15 @@ module Foxtail
|
|
|
53
53
|
child
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
+
# Create an isolated scope for term resolution.
|
|
57
|
+
# Unlike child_scope, this does NOT inherit external variables — only the
|
|
58
|
+
# explicitly passed named call arguments are visible as variables inside the term.
|
|
59
|
+
def term_scope(**named_args)
|
|
60
|
+
child = self.class.new(@bundle, **named_args)
|
|
61
|
+
child.instance_variable_set(:@dirty, @dirty.dup)
|
|
62
|
+
child
|
|
63
|
+
end
|
|
64
|
+
|
|
56
65
|
# Reset locals (used in some resolution contexts)
|
|
57
66
|
def clear_locals = @locals.clear
|
|
58
67
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foxtail-runtime
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OZAWA Sakuro
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bigdecimal
|