From 6269faf1dc5b9187a68e08ac6e7126e2eb2587e9 Mon Sep 17 00:00:00 2001 From: John Tinnerholm Date: Wed, 28 Feb 2024 15:41:08 +0100 Subject: [PATCH] Updated the package used for setfield (#62) --- Project.toml | 4 ++-- src/MetaModelica.jl | 2 -- src/utilityMacros.jl | 5 +++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index c8c4242..c6950b6 100644 --- a/Project.toml +++ b/Project.toml @@ -1,15 +1,15 @@ name = "MetaModelica" uuid = "9d7f2a79-07b5-5542-8b19-c0100dda6b06" authors = ["Martin Sjölund ", "John Tinnerholm "] -version = "0.0.4" +version = "0.0.5" [deps] +Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" ExportAll = "ad2082ca-a69e-11e9-38fa-e96309a31fe4" FastClosures = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a" ImmutableList = "4a558cac-c1ed-11e9-20da-3584bcd8709a" MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] diff --git a/src/MetaModelica.jl b/src/MetaModelica.jl index 6857a2e..0de2d90 100644 --- a/src/MetaModelica.jl +++ b/src/MetaModelica.jl @@ -3,8 +3,6 @@ module MetaModelica import MacroTools import MacroTools: @capture import ExportAll -import Setfield: @set! -import Setfield: @set #= Have to treat the types slightly different. Precompilation of the types need to occur before everything else diff --git a/src/utilityMacros.jl b/src/utilityMacros.jl index f259235..b2dbfeb 100644 --- a/src/utilityMacros.jl +++ b/src/utilityMacros.jl @@ -1,5 +1,6 @@ -import Setfield +#import Setfield import FastClosures +import Accessors """ Helper function for the assignmacro, see @assign We have one case where we assign a immutable structure to an immutable structure or something to a primitive variable. @@ -9,7 +10,7 @@ function assignFunc(expr) res = if @capture(expr, lhs_._ = rhs_) if !isprimitivetype(typeof(lhs)) - Setfield.setmacro(identity, expr, overwrite=true) + Accessors.setmacro(identity, expr, overwrite=true) else quote $(esc(expr))