@@ -406,8 +406,9 @@ function parse_constants!(exprs, dict, body, mod)
406
406
Expr (:(= ), Expr (:(:: ), a, type), Expr (:tuple , b, metadata)) || Expr (:(= ), Expr (:(:: ), a, type), b) => begin
407
407
type = getfield (mod, type)
408
408
b = _type_check! (get_var (mod, b), a, type, :constants )
409
- constant = first (@constants $ a:: type = b)
410
- push! (exprs, :($ a = $ constant))
409
+ push! (exprs,
410
+ :($ (Symbolics. _parse_vars (
411
+ :constants , type, [:($ a = $ b), metadata], toconstant))))
411
412
dict[:constants ][a] = Dict (:value => b, :type => type)
412
413
if @isdefined metadata
413
414
for data in metadata. args
@@ -416,16 +417,18 @@ function parse_constants!(exprs, dict, body, mod)
416
417
end
417
418
end
418
419
Expr (:(= ), a, Expr (:tuple , b, metadata)) => begin
419
- constant = first (@constants $ a = b)
420
- push! (exprs, :($ a = $ constant))
420
+ push! (exprs,
421
+ :($ (Symbolics. _parse_vars (
422
+ :constants , Real, [:($ a = $ b), metadata], toconstant))))
421
423
dict[:constants ][a] = Dict {Symbol, Any} (:value => get_var (mod, b))
422
424
for data in metadata. args
423
425
dict[:constants ][a][data. args[1 ]] = data. args[2 ]
424
426
end
425
427
end
426
428
Expr (:(= ), a, b) => begin
427
- constant = first (@constants $ a = b)
428
- push! (exprs, :($ a = $ constant))
429
+ push! (exprs,
430
+ :($ (Symbolics. _parse_vars (
431
+ :constants , Real, [:($ a = $ b)], toconstant))))
429
432
dict[:constants ][a] = Dict (:value => get_var (mod, b))
430
433
end
431
434
_ => error (""" Malformed constant definition `$arg `. Please use the following syntax:
0 commit comments