diff --git a/src/parser/parser.jl b/src/parser/parser.jl index ed13f3a..f2194aa 100644 --- a/src/parser/parser.jl +++ b/src/parser/parser.jl @@ -8,7 +8,7 @@ end function Base.showerror(io::IO, e::TeXParseError) println(io, "TeXParseError: ", e.msg) show_state(io, e.stack, e.position, e.tex) - show_tokenization(io, tex) + show_tokenization(io, e.tex) end function show_tokenization(io, tex) diff --git a/test/parser.jl b/test/parser.jl index 6370ec3..19c59a0 100644 --- a/test/parser.jl +++ b/test/parser.jl @@ -20,6 +20,10 @@ end ) end + @testset "Showing errors" begin + @test_throws "tokenized as" texparse("{") + end + @testset "Delimiter" begin expr = texparse(L"\left(\frac{x}{y}\right)") delimited = expr.args[1].args[1]