Commit 8131b1a
Anant Thazhemadam
feat: support components with fully-qualified names with
With the `@named` macro, we could use fully-qualified names for
components. However, trying to do the same with `@mtkmodel`,
```
@mtkmodel Model begin
@components begin
resistor = ModelingToolkitStandardLibrary.Electrical.Resistor(R = 1)
...
end
...
end
```
throws the following error.
```
ERROR: LoadError: MethodError: Cannot `convert` an object of type Expr to an object of type Symbol
Closest candidates are:
convert(::Type{T}, ::T) where T
@ Base Base.jl:84
Symbol(::Any...)
@ Base strings/basic.jl:229
```
Fix this and support fully qualified names by considering the
fully-qualifed name's Expr while parsing components.@mtkmodel
1 parent 493e695 commit 8131b1a
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
676 | | - | |
| 676 | + | |
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
| |||
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
695 | | - | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
696 | 698 | | |
697 | 699 | | |
698 | 700 | | |
| |||
0 commit comments