From 4f49447fe8cd9d1e635a4789f34928e7f0c928e5 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 3 Nov 2019 19:01:46 +0100 Subject: [PATCH] Fixed #393 (properly show DRC syntax errors) --- src/rba/rba/rbaUtils.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rba/rba/rbaUtils.cc b/src/rba/rba/rbaUtils.cc index 9d199b53f..fa54e4af7 100644 --- a/src/rba/rba/rbaUtils.cc +++ b/src/rba/rba/rbaUtils.cc @@ -160,7 +160,13 @@ rba_check_error () // parse the backtrace to get the line number tl::BacktraceElement info; - if (! bt.empty ()) { + if (CLASS_OF (lasterr) == rb_eSyntaxError) { + // for syntax errors we try to parse the message + info = rba_split_bt_information (emsg.c_str (), emsg.size ()); + if (info.line == 0 && ! bt.empty ()) { + info = bt.front (); + } + } else if (! bt.empty ()) { // use the backtrace info = bt.front (); } else {