]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lexer.ll
* lily/side-position-interface.cc (out_of_staff): move contents of
[lilypond.git] / lily / lexer.ll
index baa1d6f0f0f7c5cff7ab98d961722ec742ab2f4c..c2cb3077ca71401c2a27c611c065f2c858712c7f 100644 (file)
@@ -47,7 +47,7 @@ using namespace std;
 #include "main.hh"
 #include "version.hh"
 #include "lilypond-input-version.hh"
-#include "translator-def.hh"
+#include "context-def.hh"
 #include "identifier-smob.hh"
 
 /*
@@ -132,7 +132,7 @@ BLACK               [^ \n\t\f\r]
 RESTNAME       [rs]
 NOTECOMMAND    \\{A}+
 MARKUPCOMMAND  \\({A}|[-_])+
-LYRICS         ({AA}|{TEX})[^0-9 \t\n\f]*
+LYRICS         ({AA}|{TEX})[^0-9 \t\n\r\f]*
 ESCAPED                [nt\\'"]
 EXTENDER       __
 HYPHEN         --
@@ -147,13 +147,13 @@ HYPHEN            --
   "%{" {
        yy_push_state (longcomment);
   }
-  %[^{\n].*\n  {
+  %[^{\n\r].*[\n\r]    {
   }
-  %[^{\n]      { // backup rule
+  %[^{\n\r]    { // backup rule
   }
-  %\n  {
+  %[\n\r]      {
   }
-  %[^{\n].*    {
+  %[^{\n\r].*  {
   }
   {WHITE}+     {
 
@@ -179,7 +179,12 @@ HYPHEN             --
        s = s.left_string (s.index_last ('\"'));
 
        yy_pop_state();
-       this->here_input().source_file_->name_ = s; 
+       this->here_input().source_file_->name_ = s;
+       progress_indication (_f("\nRenamed input to `%s'", s.to_str0()));
+       scm_module_define (gh_car (scopes_),
+                    ly_symbol2scm ("input-file-name"),
+                    scm_makfrom0str (s.to_str0()));
+
 }
 
 <version>.     {
@@ -308,12 +313,12 @@ HYPHEN            --
        yylval.scm = sval;
        return SCM_T;
 }
-<INITIAL,notes,markup>{ 
+<INITIAL,notes,lyrics>{ 
        \<\<   {
-               return CHORD_OPEN;
+               return LESSLESS;
        }
        \>\>   {
-               return CHORD_CLOSE;
+               return MOREMORE;
        }
 }
 <figures>{
@@ -464,6 +469,12 @@ HYPHEN             --
        \" {
                start_quote ();
        }
+       \< {
+               return '<';
+       }
+       \> {
+               return '>';
+       }
        {MARKUPCOMMAND} {
                String str (YYText() + 1);
                SCM s = lookup_markup_command (str);
@@ -473,6 +484,8 @@ HYPHEN              --
                        SCM tag = gh_cdr(s);
                        if (tag == ly_symbol2scm("markup0"))
                                return MARKUP_HEAD_MARKUP0;
+                       if (tag == ly_symbol2scm("empty"))
+                               return MARKUP_HEAD_EMPTY;
                        else if (tag == ly_symbol2scm ("markup0-markup1"))
                                return MARKUP_HEAD_MARKUP0_MARKUP1;
                        else if (tag == ly_symbol2scm ("markup-list0"))
@@ -495,23 +508,23 @@ HYPHEN            --
                } else
                        return scan_escaped_word (str);
        }
-       {LYRICS} {
+       [{}]    {
+               return YYText()[0];
+       }
+       [^#{}"\\ \t\n\r\f]+ {
                String s (YYText ()); 
 
                char c = s[s.length () - 1];
                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?"));
+                               _ ("Brace found at end of markup.  Did you forget a space?"));
                yylval.scm = scm_makfrom0str (s.to_str0 ());
 
 
                return STRING;
        }
-       {WHITE} {
-
-       }
-       . {
-               return YYText ()[0];
+       .  {
+               return YYText()[0];
        }
 }