From: Matthijs Kooijman Date: Thu, 27 Aug 2009 11:03:39 +0000 (+0200) Subject: Make pret-trans complain on invalid input. X-Git-Tag: final-thesis~283 X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Freport.git;a=commitdiff_plain;h=25adb8e7568b748a08f3106fcd30ac81e8cf0d6f Make pret-trans complain on invalid input. Before, the lua would just crash with a vague error. --- diff --git a/pret-trans.lua b/pret-trans.lua index ac1b525..238a4e5 100644 --- a/pret-trans.lua +++ b/pret-trans.lua @@ -91,7 +91,11 @@ function vis.end_of_display() break end end - + + if not len then + error("No horizontal separator found in:\n" .. table.concat(lines, "\n")) + end + -- Split the input in three parts. Stuff before the line, stuff -- after the line, stuff to the right of the line. before, after, rights = {}, {}, {}