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
* 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
#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
*/
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
--- /dev/null
+/*
+ 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)";
+}
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 );
+ */
}
}
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;
}