]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lexer.ll
stencil.cc: Backspacing stencils are not empty
[lilypond.git] / lily / lexer.ll
index bad1cd795461e9fe273554220d37960408940bf7..63d58527e89578cac863adb9b63ffb13a0b7836a 100644 (file)
@@ -159,7 +159,7 @@ WHITE               [ \n\t\f\r]
 HORIZONTALWHITE                [ \t]
 BLACK          [^ \n\t\f\r]
 RESTNAME       [rs]
-ESCAPED                [nt\\'"]
+ESCAPED                [nt\\''""]
 EXTENDER       __
 HYPHEN         --
 BOM_UTF8       \357\273\277
@@ -247,7 +247,7 @@ BOM_UTF8    \357\273\277
 <INITIAL,chords,lyrics,notes,figures>\\sourcefileline{WHITE}*  {
        yy_push_state (sourcefileline);
 }
-<version>\"[^"]*\"     { /* got the version number */
+<version>\"[^""]*\"     { /* got the version number */
        string s (YYText_utf8 () + 1);
        s = s.substr (0, s.rfind ('\"'));
 
@@ -309,9 +309,10 @@ BOM_UTF8   \357\273\277
 
 
 <INITIAL,chords,lyrics,notes,figures>\\maininput           {
-       if (!is_main_input_ && include_stack_.size () == 1)
+       if (!is_main_input_)
        {
                start_main_input ();
+               main_input_level_ = include_stack_.size ();
                is_main_input_ = true;
        }
        else
@@ -524,7 +525,7 @@ BOM_UTF8    \357\273\277
                                                          SCM_UNDEFINED,
                                                          SCM_UNDEFINED);
 
-               return is_lyric_state () ? LYRICS_STRING : STRING;
+               return STRING;
        }
        \\      {
                 yylval = scm_cons (scm_from_locale_string (YYText ()),
@@ -565,7 +566,7 @@ BOM_UTF8    \357\273\277
                s = lyric_fudge (s);
                yylval = ly_string2scm (s);
 
-               return LYRICS_STRING;
+               return STRING;
        }
        /* This should really just cover {} */
        . {
@@ -698,11 +699,9 @@ BOM_UTF8   \357\273\277
         yylval = SCM_UNSPECIFIED;
         if (is_main_input_)
        {
-               /* 2 = init.ly + current file.
-                  > because we're before closing, but is_main_input_ should
-                  reflect after.
-               */ 
-               is_main_input_ = include_stack_.size () > 2;
+               is_main_input_ = include_stack_.size () > main_input_level_;
+               if (!is_main_input_)
+                       main_input_level_ = 0;
                if (!close_input () || !is_main_input_)
                /* Returns YY_NULL */
                        yyterminate ();
@@ -903,8 +902,7 @@ Lily_lexer::scan_escaped_word (string str)
 
         yylval = SCM_UNSPECIFIED;
        int i = lookup_keyword (str);
-       if (i == MARKUP && is_lyric_state ())
-               return LYRIC_MARKUP;
+
        if (i != -1)
                return i;