Skip to content

Commit

Permalink
[v15.4.10-rc2] allow placeholder values in first pass of sequence scope
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielburnworth committed Jul 3, 2024
1 parent ebe7a24 commit 0f27a62
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

# 15.4.10

* Prevent unnecessary scheduler exit upon encountering duplicate variable values when one is a placeholder.

# 15.4.9

* Add `tool.flow_rate_ml_per_s`.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15.4.9
15.4.10-rc2
8 changes: 6 additions & 2 deletions lib/celery/compilers/scope.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@ defmodule FarmbotOS.Celery.Compiler.Scope do
if has_key?(state, key) do
state
else
set(state, key, value)
reckless_set(state, key, value)
end
end)
end

def has_key?(scope, label), do: Map.has_key?(scope.declarations, label)

def reckless_set(scope, key, value) do
%{scope | declarations: Map.put(scope.declarations, key, value)}
end

@nothing %AST{kind: :nothing, args: %{}, body: []}
@not_allowed [
:location_placeholder,
Expand All @@ -65,7 +69,7 @@ defmodule FarmbotOS.Celery.Compiler.Scope do
declr = Map.put(scope.declarations, key, @nothing)
%{scope | declarations: declr, valid: false}
else
%{scope | declarations: Map.put(scope.declarations, key, value)}
reckless_set(scope, key, value)
end
end

Expand Down

0 comments on commit 0f27a62

Please sign in to comment.