Skip to content

Commit

Permalink
Updated the package used for setfield (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRT committed Feb 28, 2024
1 parent e27149f commit 6269faf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name = "MetaModelica"
uuid = "9d7f2a79-07b5-5542-8b19-c0100dda6b06"
authors = ["Martin Sjölund <martin.sjolund@liu.se>", "John Tinnerholm <john.tinnerholm@liu.se>"]
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]
Expand Down
2 changes: 0 additions & 2 deletions src/MetaModelica.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/utilityMacros.jl
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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))
Expand Down

0 comments on commit 6269faf

Please sign in to comment.