From eee2a6a2f2f2a80de73144f8df3fdd6602a77066 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 21 Mar 2012 06:48:51 +0000 Subject: [PATCH] Add missing line and file number for some errors in %fragment declaration git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12941 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Swig/fragment.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Swig/fragment.c b/Source/Swig/fragment.c index 896461b30..4a3fea5a2 100644 --- a/Source/Swig/fragment.c +++ b/Source/Swig/fragment.c @@ -60,6 +60,8 @@ void Swig_fragment_register(Node *fragment) { if (kwargs) { Setmeta(ccode, "kwargs", kwargs); } + Setfile(ccode, Getfile(fragment)); + Setline(ccode, Getline(fragment)); Setattr(fragments, name, ccode); if (debug) Printf(stdout, "registering fragment %s %s\n", name, section); @@ -142,7 +144,7 @@ void Swig_fragment_emit(Node *n) { if (section) { File *f = Swig_filebyname(section); if (!f) { - Swig_error(Getfile(code), Getline(code), "Bad section '%s' for code fragment '%s'\n", section, name); + Swig_error(Getfile(code), Getline(code), "Bad section '%s' in %%fragment declaration for code fragment '%s'\n", section, name); } else { if (debug) Printf(stdout, "emitting subfragment %s %s\n", name, section);