Let's say I have a frequently used template foo, used all over my code. If there is an exception thrown inside code inserted by foo there is no way to see line numbers (on the stacktrace) of the proc which instantiated it. Is there a way to disable line number inside templates?2016-01-19 12:45:21
instantiationInfo is helpful, but I'd like to achieve something different.
template foo(): stmt = if true: raise newException(ValueError, "foo!") proc foo1() = foo() foo() foo() foo1()
This code shows:
Traceback (most recent call last) foomodule.nim(9) foomodule foomodule.nim(2) foo1
so I don't know which foo caused the exception. I would like to be able to temporarily disable line number tracking in templates, so the stack trace would be:
Traceback (most recent call last) foomodule.nim(9) foomodule foomodule.nim(5) foo1