From 0a92fe2a5e1e363f2adfeaad1281befff0053f86 Mon Sep 17 00:00:00 2001 From: Jutho Haegeman Date: Thu, 3 Aug 2023 15:48:28 +0200 Subject: [PATCH] format and small typo fix --- src/indexnotation/tensormacros.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/indexnotation/tensormacros.jl b/src/indexnotation/tensormacros.jl index 77e43432..751d160f 100644 --- a/src/indexnotation/tensormacros.jl +++ b/src/indexnotation/tensormacros.jl @@ -48,7 +48,6 @@ macro tensor(args::Vararg{Expr}) end function tensorparser(tensorexpr, kwargs...) - parser = TensorParser() for param in kwargs @@ -102,8 +101,10 @@ function parse_tensor_kwargs(args) # @tensor kw1=val1 kw2=val2 ... tensorexpr function kw_to_pair(ex) - return (isexpr(ex, :(=), 2) || isexpr(ex, :kw, 2)) ? Pair(ex.args[1], ex.args[2]) : ex - throw(ArgumentError("unknown keyword expression `$ex`")) + if (isexpr(ex, :(=), 2) || isexpr(ex, :kw, 2)) + return Pair(ex.args[1], ex.args[2]) + end + throw(ArgumentError("unknown keyword expression `$ex`")) end return kw_to_pair.(args) end