]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.47
authorfred <fred>
Sun, 24 Mar 2002 19:38:05 +0000 (19:38 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:38:05 +0000 (19:38 +0000)
TODO
lib/include/debug.hh
lib/include/input.hh
lib/input.cc [new file with mode: 0644]
lily/my-lily-lexer.cc
lily/warn.cc

diff --git a/TODO b/TODO
index 522f9cafbe53c5bc9a85d4c74783a5981559d0a1..6e3d3f5c938662d12320551c4b34b29479f40e8e 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,9 +1,7 @@
 before 0.1
-       * update 20 pt table
-
-       * remove spurious/outdated comments in .ly, debug .ly
+       * fix mi2mu
 
-       * pushgroup, popgroup.
+       * update 20 pt table
 
        * decent TeX page layout
 
@@ -75,6 +73,8 @@ SMALLISH PROJECTS
        * bugreport to doc++ devel: struct not in class hier; public
        virtual baseclasses
 
+       * rpm package buildroot
+
        * indentable stream for TeX stream, lily stream, Dstream.
 
        * key transposition
index 7870a0da03231a05100f24b4bb8ebfe44fdbaae7..b3b786172d4516fdee53a41fec29a2ea91b42093 100644 (file)
 #include "real.hh"
 #include "proto.hh"
 
-void message( String message_str, char const* context_ch_c_l );
-void warning( String message_str, char const* context_ch_c_l );
 void warning( String message_str  );
-void error( String message_str, char const* context_ch_c_l );
-
 void error( String message_str);
-void error(String s);          // errors
 void error_t(const String& s, Time_description const &  t_tdes);
 void error_t(String const &s, const Moment &when);
 // warnings
index 80ab11a1bb235c418fe6813173a03a6f03f9dcc0..180baf170be87d21e05858ff2d415b512b846293 100644 (file)
  */
 class Input {
     char const *defined_ch_C_ ;
-
+    Source_file * source_file_l_;
 public:
-    set_spot(char const *);
-    Input(char const *);
-    Input(Input const &);
+    
+    void warning(String)const; // should use member func?
+    void error(String)const;
+    void message(String)const;
+    void set_spot(Input const &);
+    
+    String location_str()const;
+    Input(Source_file*, char const*);
+    Input();
 };
 
 #endif // INPUT_HH
diff --git a/lib/input.cc b/lib/input.cc
new file mode 100644 (file)
index 0000000..de34181
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+  input.cc -- implement Input
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "proto.hh"
+#include "input.hh"
+#include "string.hh"
+#include "source.hh"
+#include "source-file.hh"
+
+Input::Input(Source_file*s, char const *cl)
+{
+    source_file_l_=s;
+    defined_ch_C_=cl;
+}
+
+Input::Input()
+{
+    source_file_l_ = 0;
+    defined_ch_C_ = 0;
+}
+
+Input::Input(Input const &s)
+{
+    source_file_l_ = s.source_file_l_;
+    defined_ch_C_ = s.defined_ch_C_;
+}
+
+void
+Input::set_spot(Input const &i)
+{
+    *this  = i;
+}
+
+void
+Input::message(String message_str)const
+{
+    String str = "";
+    
+    if ( source_file_l_ ) {
+       str += source_file_l_->file_line_no_str(defined_ch_C_) + String(": ");
+    }
+    
+    str += message_str;
+    if ( source_file_l_ ) {
+       str += ":\n";
+       str += source_file_l_->error_str( defined_ch_C_);
+    }
+    cerr << str << endl;
+}
+
+void
+Input::warning( String message_str)const
+{
+    message( "warning: " + message_str);
+}
+void
+Input::error(String s)const
+{
+    message("error: "+ s);
+    exit (1);
+}
+
+String
+Input::location_str()const
+{
+    if (source_file_l_) 
+       return source_file_l_->file_line_no_str(defined_ch_C_);
+    else
+       return "(location unknown)";
+}
index 2bb88b7448bffa53d59cbb0d49c31cdab2d77025..6ff46f282cabfc19e7360bfe133e8df452bf94ae 100644 (file)
@@ -128,15 +128,13 @@ My_lily_lexer::LexerError(char const *s)
     if (include_stack_.empty()) {
        *mlog << "error at EOF" << s << '\n';
     } else {
-       char const* ch_C = here_ch_C();
-       if ( ch_C ) {
-           ch_C--;
-           while (isspace(*ch_C == ' ' ))
-                   ch_C--;
-           ch_C++;
-       }
        errorlevel_i_ |= 1;
-       error( s, ch_C );
+       error(String(s));
+       // FIXME.
+/*Input spot(source_l_g = here_spot();
+
+       spot.error( s );
+       */
     }
 }
 
index 4240aa04b5459a6da8f2b0f6d64c3bd28a8320f8..08c8b526960dbc03f1be58e4a0ad1b39ee4afa06 100644 (file)
@@ -44,51 +44,15 @@ error_t(String const & s, Time_description const &t_tdes)
     error(e);
 }
 
-void
-message( String message_str, char const* context_ch_C )
-{
-    String str = "";
-    Source_file* sourcefile_l = source_l_g->sourcefile_l( context_ch_C );
-    if ( sourcefile_l ) {
-       str += sourcefile_l->file_line_no_str(context_ch_C) + String(": ");
-    }
-    str += message_str;
-    if ( sourcefile_l ) {
-       str += ":\n";
-       str += sourcefile_l->error_str( context_ch_C );
-    }
-    if ( busy_parsing() )
-       cerr << endl;
-    cerr << str << endl;
-}
-
-void
-warning( String message_str, char const* context_ch_C )
-{
-    message( "warning: " + message_str, context_ch_C );
-}
-
-void
-error( String message_str, char const* context_ch_C )
-{
-    message( message_str, context_ch_C );
-    // since when exits error again?
-    // i-d say: error: errorlevel |= 1; -> no output upon error
-    //          warning: recovery -> output (possibly wrong)
-/*    if ( lexer )
-        lexer->errorlevel_i_ |= 1;*/
-//    exit( 1 );
-}
-
-
 void
 warning(String m)
 {
-    warning(m, (char*)0);
+    cerr << "warning" <<m <<endl;
+
 }
 
 void
 message(String m)
 {
-    error(m, (char*)0);
+    cerr << m<<endl;
 }