]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/input.cc
patch::: 1.4.2.jcn5
[lilypond.git] / flower / input.cc
index 9413f7c49e82fc37ca204dddaf9cf0b0cd4ff2f7..d45f81b9d32a62d37c4a61913d9bf9d871bb4632 100644 (file)
@@ -3,10 +3,10 @@
 
  source file of the LilyPond music typesetter
 
- (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 #include <iostream.h>
-#include "proto.hh"
+#include "flower-proto.hh"
 #include "input.hh"
 #include "string.hh"
 #include "source.hh"
@@ -37,11 +37,9 @@ Input::set_spot (Input const &i)
 }
 
 /*
-  Produce almost GNU-compliant error message.  Lily used to be rather
-  GNU-compliant in this too, but correcting mudela is such a breeze if 
-  you('re edidor) know(s) the error column too (there's no GNU standard
-  on columns, is there?).
-
+  Produce GNU-compliant error message.  Correcting lilypond source is
+  such a breeze if you ('re edidor) know (s) the error column too
+  
   Format:
 
     [file:line:column:][warning:]message
@@ -95,7 +93,7 @@ Input::error (String s) const
 void
 Input::non_fatal_error (String s) const
 {
-  message (_ ("Non fatal error: ") + s);
+  message (_ ("non fatal error: ") + s);
 }
 String
 Input::location_str () const
@@ -103,7 +101,7 @@ Input::location_str () const
   if (source_file_l_)
     return source_file_l_->file_line_column_str (defined_ch_C_);
   else
-    return "(" + _ ("position unknown") + ")";
+    return " (" + _ ("position unknown") + ")";
 }
 
 String
@@ -114,3 +112,33 @@ Input::line_number_str () const
   else
     return "?";
 }
+
+String
+Input::file_str () const
+{
+  if (source_file_l_)
+    return source_file_l_->name_str ();
+  else
+    return "";
+}
+
+
+int
+Input::line_number () const
+{
+  if (source_file_l_)
+    return source_file_l_->line_i (defined_ch_C_);
+  else
+    return 0;
+
+}
+
+int
+Input::column_number () const
+{
+  if (source_file_l_)
+    return source_file_l_->column_i (defined_ch_C_);
+  else
+    return 0;
+
+}