Skip to content

Commit

Permalink
Enforce latexoperation String return.
Browse files Browse the repository at this point in the history
  • Loading branch information
korsbo committed Mar 29, 2021
1 parent 268af66 commit bfc7241
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/latexoperation.jl
Expand Up @@ -6,7 +6,7 @@ This uses the information about the previous operations to decide if
a parenthesis is needed.
"""
function latexoperation(ex::Expr, prevOp::AbstractArray; cdot=true, index=:bracket, kwargs...)
function latexoperation(ex::Expr, prevOp::AbstractArray; cdot=true, index=:bracket, kwargs...)::String
op = ex.args[1]
args = map(i -> typeof(i) (String, LineNumberNode) ? latexraw(i; kwargs...) : i, ex.args)

Expand Down Expand Up @@ -139,7 +139,7 @@ function latexoperation(ex::Expr, prevOp::AbstractArray; cdot=true, index=:brack
end

if ex.head == :macrocall && ex.args[1] == Symbol("@__dot__")
return ex.args[3]
return string(ex.args[end])
end

if ex.head == :call
Expand Down

0 comments on commit bfc7241

Please sign in to comment.