Skip to content

Commit 0a92fe2

Browse files
committed
format and small typo fix
1 parent 7b7f438 commit 0a92fe2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/indexnotation/tensormacros.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ macro tensor(args::Vararg{Expr})
4848
end
4949

5050
function tensorparser(tensorexpr, kwargs...)
51-
5251
parser = TensorParser()
5352

5453
for param in kwargs
@@ -102,8 +101,10 @@ function parse_tensor_kwargs(args)
102101

103102
# @tensor kw1=val1 kw2=val2 ... tensorexpr
104103
function kw_to_pair(ex)
105-
return (isexpr(ex, :(=), 2) || isexpr(ex, :kw, 2)) ? Pair(ex.args[1], ex.args[2]) : ex
106-
throw(ArgumentError("unknown keyword expression `$ex`"))
104+
if (isexpr(ex, :(=), 2) || isexpr(ex, :kw, 2))
105+
return Pair(ex.args[1], ex.args[2])
106+
end
107+
throw(ArgumentError("unknown keyword expression `$ex`"))
107108
end
108109
return kw_to_pair.(args)
109110
end

0 commit comments

Comments
 (0)