]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lexer.ll
release: 1.3.92
[lilypond.git] / lily / lexer.ll
index 44209d00e3df2d37f24e78104b88e96aa81f25f2..208e7034205c25f956e9ba673a80ba4486eba89a 100644 (file)
@@ -39,6 +39,9 @@
 #include "identifier.hh"
 #include "version.hh"
 #include "mudela-version.hh"
+#include "translator-def.hh"
+
+#define isatty HORRIBLEKLUDGE
 
 void strip_trailing_white (String&);
 void strip_leading_white (String&);
@@ -137,9 +140,9 @@ HYPHEN              --
        String s (YYText ()+1);
        s = s.left_str (s.index_last_i ('"'));
        DEBUG_OUT << "#version `" << s << "'\n";
+       yy_pop_state ();
        if (!valid_version_b (s))
                return INVALID;
-       yy_pop_state ();
 }
 <version>.     {
        LexerError ("No quoted string found after \\version");
@@ -325,7 +328,7 @@ HYPHEN              --
                        }
 
                char c = s[s.length_i () - 1];
-               if (c == '{' &&  c == '}') // brace open is for not confusing dumb tools.
+               if (c == '{' ||  c == '}') // brace open is for not confusing dumb tools.
                        here_input ().warning (
                                "Brace found at end of lyric. Did you forget a space?");
                yylval.scm = ly_str02scm (s.ch_C ());
@@ -477,9 +480,17 @@ My_lily_lexer::scan_escaped_word (String str)
        } else if (gh_number_p (sid)) {
                yylval.scm = sid;
                return NUMBER_IDENTIFIER;
+       } else if (unsmob_translator_def (sid)) {
+               yylval.scm = sid;
+               return TRANSLATOR_IDENTIFIER;
+       } else if (Music * mus =unsmob_music (sid)) {
+               yylval.scm = sid;
+               
+               return dynamic_cast<Request*> (mus) ? REQUEST_IDENTIFIER : MUSIC_IDENTIFIER;
        }
 
 
+
        Identifier * id = unsmob_identifier (sid);
        if (id) {
                yylval.id = id;
@@ -586,9 +597,9 @@ valid_version_b (String s)
   Mudela_version ver (s);
   if (!((ver >= oldest_version) && (ver <= current)))
        {       
-               error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), current.str ()));
-               if (!version_ignore_global_b)
-                       return false;
+               non_fatal_error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), current.str ()));
+               non_fatal_error (_("Consider converting the input with the convert-mudela script")); 
+               return false;
     }
   return true;
 }