From d23a6efb94f04f0fc33dc35025189b54a5a24d7c Mon Sep 17 00:00:00 2001 From: Thomas Purdy Date: Tue, 22 Oct 2024 15:08:18 -0600 Subject: [PATCH] Add check that all stocks in a sum's list are defined under :stocks for stock_and_flow macro --- src/Syntax.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Syntax.jl b/src/Syntax.jl index 0445980..5c9d0ad 100644 --- a/src/Syntax.jl +++ b/src/Syntax.jl @@ -257,6 +257,8 @@ function parse_stock_and_flow_syntax(statements::Vector{Any}) end end + @assert all(sv_stocks -> all(s -> s in stocks, sv_stocks), last.(sums)) "Not all stocks in sums were found under :stocks" + s = StockAndFlowBlock(stocks, params, dyvars, flows, sums) return s end