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
This commit is contained in:
William S Fulton 2012-03-21 06:48:51 +00:00
commit eee2a6a2f2

View file

@ -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);