]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.23
authorfred <fred>
Sun, 24 Mar 2002 19:28:15 +0000 (19:28 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:28:15 +0000 (19:28 +0000)
hdr/inputcommand.hh
src/inputcommand.cc
src/mylexer.cc
src/simplewalker.cc

index 61f968ee53cbea66cc8f35781fffefab9749d2d0..2654d06b7c8470046d133c2c82d9598d7f3d28b0 100644 (file)
@@ -1,7 +1,7 @@
 /*
   inputcommand.hh -- part of LilyPond
 
-  (c) 1996 Han-Wen Nienhuys
+  (c) 1996,97 Han-Wen Nienhuys
 */
 
 #ifndef INPUTCOMMAND_HH
@@ -19,6 +19,7 @@ struct Input_command {
 
     operator Command();
 };
+Input_command*get_cadenza_toggle(int i);
 Input_command *get_meterchange_command( int,int);
 Input_command *get_key_interpret_command(Array<int >);
 Input_command *get_clef_interpret_command(String w);
@@ -28,6 +29,7 @@ Input_command *get_skip_command(int,Moment);
 Input_command *get_grouping_command(Array<int>);
 Input_command *get_bar_command(String);
 Input_command *get_newmeasure_command();
+Input_command *get_goto_command(String);
 Array<int> get_default_grouping(int count);
 #endif // INPUTCOMMAND_HH
 
index 9cedc52c2ab5c42d5d235999f533d85bab375d1b..02e7e7281308b15d25ddecbcd31effcf3c9946d1 100644 (file)
@@ -44,6 +44,24 @@ get_partial_command(Moment u)
     return c;
 }
 
+Input_command*
+get_goto_command(String s)
+{
+    Input_command*c = new Input_command;
+    c->args.add("GOTO");
+    c->args.add(s);
+    return c;
+}
+
+Input_command*
+get_cadenza_toggle(int i)
+{
+    
+    Input_command*c = new Input_command;
+    c->args.add("CADENZA");
+    c->args.add(i);
+    return c;
+}
 Input_command*
 get_grouping_command(Array<int>a ) 
 {
@@ -90,9 +108,7 @@ Input_command *
 get_newmeasure_command()
 {
     Input_command*c = new Input_command;
-
     c->args.add( "NEWMEASURE");
-
     return c;
 }
 
@@ -112,6 +128,7 @@ get_skip_command(int n, Moment m)
 void
 Input_command::print()const
 {
+#ifndef NPRINT
     mtor << "{ ";
     if (args.size()) {
        mtor<< " args: ";
@@ -119,6 +136,7 @@ Input_command::print()const
            mtor << "`"<<args[i] <<"',";
     }
     mtor << "}\n";
+#endif    
 }
 
 Input_command*
index 53763a6ab24c5ed0f506dbc796baa40d588aca38..824a1ac809e3f632a13f62c754020a41be0324e0 100644 (file)
 static Keyword_ent the_key_tab[]={
     "bar", BAR,
     "bass", BASS,
+    "cadenza", CADENZA,
     "clef", CLEF,
     "cm", CM,
     "commands", COMMANDS,
     "duration", DURATIONCOMMAND,
     "geometric", GEOMETRIC,
+    "goto", GOTO,
     "in", IN,
-    "key", KEY, 
+    "key", KEY,
+    "mark", MARK,
     "melodic", MELODIC,
     "meter", METER,
     "mm", MM,
@@ -92,14 +95,19 @@ My_flex_lexer::~My_flex_lexer()
     delete the_id_tab;
 }
 
+String
+My_flex_lexer::spot()const
+{
+    return include_stack.top()->name +  ": " + lineno();
+}
+
 void
 My_flex_lexer::LexerError(const char *s)
 {
     if (lexer->include_stack.empty()) {
-       *mlog << "error at EOF" << s;
+       *mlog << "error at EOF" << s << '\n';
     }else 
-       *mlog << lexer->include_stack.top()->name <<  ": " <<
-        lexer->lineno() <<  ": error:" << s << '\n';
+       *mlog << spot() << ": error:" << s << '\n';
      exit(1);
 }
 // set the  new input to s, remember old file.
index 21ed11573af506ead3bdbd1089fffad83bccf698..33ddf1ea69ef1d00847e165e9027964e0299fe0f 100644 (file)
@@ -185,7 +185,7 @@ Simple_walker::process_requests()
 
        if (sl->spantype == Span_req::START) {
            if  (find_slur(sl->elt_l_->voice_ )>=0)
-               error_t("Too many slurs in voice", col()->when());
+               error_t("Too many slurs in voice", *col()->tdescription_);
            pending_slur_reqs.add(sl);
            pending_slurs.add(new Slur);
        }
@@ -206,7 +206,7 @@ Simple_walker::process_requests()
     if (beam_) {
        if (!stem_)
            WARN <<"beamed note should have a stem (t = " 
-                 <<String(c->when())<<"\n";
+                 <<String(c->when())<<")\n";
        else
            beam_->add(stem_);
 
@@ -219,6 +219,7 @@ Simple_walker::process_requests()
     }
 
     if (c->beam_&& c->beam_->spantype == Span_req::STOP) {
+       default_grouping.extend(current_grouping->interval());
        beam_->set_grouping(default_grouping, *current_grouping);
        pscore_->typeset_spanner(beam_, s->theline);
 
@@ -251,7 +252,7 @@ Simple_walker::process_requests()
        if (sl->spantype == Span_req::STOP) {
            int idx = find_slur(sl->elt_l_->voice_);
            if (idx < 0)
-               error_t("can't find slur to end; ", c->when());
+               error_t("can't find slur to end; ", *c->tdescription_);
            
            pscore_->typeset_spanner(pending_slurs[idx],
                                     s->theline);