]> git.donarmstrong.com Git - lilypond.git/commitdiff
When printing a context def, include the source location.
authorDavid Kastrup <dak@gnu.org>
Sat, 8 Sep 2012 15:31:14 +0000 (17:31 +0200)
committerDavid Kastrup <dak@gnu.org>
Sat, 8 Sep 2012 17:44:31 +0000 (19:44 +0200)
This is a supplement to make the printing of "parser objects should be
dead" messages more useful.  Adding the source location of an undead
context def makes the problem far easier to identify.

lily/context-def.cc

index b4e1e2567cc19397940b58e41a4852a1b9bb9ca2..1f823bf50368f747aff414b68bd6e8181c6b9b7c 100644 (file)
@@ -93,6 +93,9 @@ Context_def::print_smob (SCM smob, SCM port, scm_print_state *)
 
   scm_puts ("#<Context_def ", port);
   scm_display (me->context_name_, port);
+  scm_puts (" ", port);
+  string loc = me->origin ()->location_string ();
+  scm_puts (loc.c_str (), port);
   scm_puts (">", port);
   return 1;
 }