fixes error location when error in macro or child template
add macro(name, args...) function