Skip to content

Commit b7d1233

Browse files
committed
tidy up
1 parent a6ca2d1 commit b7d1233

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

src/macro.jl

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -673,10 +673,11 @@ function recursemacro(ex::Expr, canon, store::NamedTuple, call::CallInfo)
673673
return recursemacro(tensorprimetidy(ex), canon, store, call)
674674
elseif Meta.isexpr(ex, :$)
675675
return only(ex.args)
676-
elseif ex isa Expr && ex.head in [:call, Symbol("'")]
677-
return Expr(ex.head, map(x -> recursemacro(x, canon, store, call), ex.args)...)
678676
elseif ex isa Expr
679-
@warn "not a call, what is it?:" ex
677+
# && ex.head in [:call, Symbol("'")]
678+
# return Expr(ex.head, map(x -> recursemacro(x, canon, store, call), ex.args)...)
679+
# elseif ex isa Expr
680+
# @warn "not a call, what is it?:" ex
680681
return Expr(ex.head, map(x -> recursemacro(x, canon, store, call), ex.args)...)
681682
else
682683
return ex
@@ -789,7 +790,7 @@ function castparse(ex, store::NamedTuple, call::CallInfo; reduce=false)
789790
if @capture(left, Z_[outer__][inner__] | [outer__][inner__] | Z_[outer__]{inner__} | [outer__]{inner__} )
790791
if isnothing(Z)
791792
(:inplace in call.flags) && throw(MacroError("can't write into a nameless tensor", call))
792-
@warn "please write `@cast _[i][k] := ...` to omit a name, instead of `@cast [i][k] := ...`"
793+
@warn "please write `@cast _[i][k] := ...` to omit a name, instead of `@cast [i][k] := ...`" call.string maxlog=3
793794
Z = :_ # gensym(:output)
794795
end
795796
Z = (Z == :_) ? gensym(:output) : Z
@@ -801,8 +802,8 @@ function castparse(ex, store::NamedTuple, call::CallInfo; reduce=false)
801802
elseif @capture(left, Z_[outer__] | [outer__] )
802803
if isnothing(Z)
803804
(:inplace in call.flags) && throw(MacroError("can't write into a nameless tensor", call))
804-
@warn "please write `@cast _[i] := ...` to omit a name, instead of `@cast [i] := ...`"
805-
Z = :_ # gensym(:output)
805+
@warn "please write `@cast _[i] := ...` to omit a name, instead of `@cast [i] := ...`" call.string maxlog=3
806+
Z = :_
806807
end
807808
Z = (Z == :_) ? gensym(:output) : Z
808809
parsed = indexparse(Z, outer, store, call, save=(:inplace in call.flags))
@@ -1022,22 +1023,22 @@ function optionparse(opt, store::NamedTuple, call::CallInfo)
10221023
elseif @capture(opt, lazy = val_Number) && 0 <= val <= 2
10231024
push!(call.flags, Symbol(:lazy_, Int(val)))
10241025
elseif @capture(opt, i_:s_)
1025-
@warn "please replace index ranges like `i:3` with `i in 1:3` or `i ∈ 1:3`"
1026+
@warn "please replace index ranges like `i:3` with `i in 1:3` or `i ∈ 1:3`" call.string maxlog=3
10261027
saveonesize(tensorprimetidy(i), s, store)
10271028
push!(call.flags, :assert)
10281029
elseif opt in (:strided, :avx)
1029-
@warn "postfix option $opt is deprecated, please write @cast @$opt A[i] := ..."
1030+
@warn "postfix option $opt is deprecated, please write @cast @$opt A[i] := ..." call.string maxlog=3
10301031
push!(call.flags, opt)
10311032
elseif opt == :lazy
1032-
@warn "postfix option lazy is deprecated, please write " *
1033-
"@lazy A[i] := ... for LazyArrays broadcasting, or " *
1034-
"lazy=true to use for PermutedDimsArray etc. (the default)"
1033+
@warn "postfix option `lazy` is deprecated, please write " *
1034+
"`@lazy A[i] := ...` for LazyArrays broadcasting, or " *
1035+
"`lazy=true` to use PermutedDimsArray-like arrays (the default)" call.string maxlog=3
10351036
push!(call.flags, :lazy, :lazy_1)
10361037
elseif opt == :nolazy
1037-
@warn "option `nolazy` is deprecated, please write keyword style `lazy=false` to disable PermutedDimsArray etc."
1038+
@warn "option `nolazy` is deprecated, please write keyword style `lazy=false` to disable PermutedDimsArray etc." call.string maxlog=3
10381039
push!(call.flags, :lazy_0)
10391040
elseif opt in (:assert, :(!))
1040-
@warn "option 'assert' is no longer needed, this is the default" call.string maxlog=1
1041+
@warn "option `assert` is no longer needed, this is the default" call.string maxlog=3
10411042
else
10421043
throw(MacroError("don't understand option $opt", call))
10431044
end

0 commit comments

Comments
 (0)