Skip to content

Commit 91aefd0

Browse files
authored
Merge pull request #109 from Kolaru/command_unsupported
Avoid TeXParseError showing as unexpected error
2 parents c75948e + d744002 commit 91aefd0

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
version:
1818
- '1.7'
19-
- '1.8'
19+
- '1.9'
2020
os:
2121
- ubuntu-latest
2222
arch:

Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
1212
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
1313
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
1414
RelocatableFolders = "05181044-ff0b-4ac5-8273-598c1e38db00"
15-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1615
UnicodeFun = "1cfade01-22cf-5700-b092-accc4b62d6e1"
1716

1817
[compat]

src/parser/parser.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,12 @@ actions = Dict(actions...)
289289

290290
try
291291
$(Automa.generate_exec_code(machine, actions))
292-
catch
293-
throw(TeXParseError("unexpected error while parsing", stack, p, data))
292+
catch e
293+
if e isa TeXParseError
294+
rethrow()
295+
else
296+
throw(TeXParseError("unexpected error while parsing", stack, p, data))
297+
end
294298
end
295299

296300
while current_head(stack) == :skip_char

test/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[deps]
2+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

test/runtests.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using LaTeXStrings
21
using Test
32

43
using MathTeXEngine

0 commit comments

Comments
 (0)