]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lexer.ll
Doc: ensure all level 3 and 4 headings have nodes (2967)
[lilypond.git] / lily / lexer.ll
index bad1cd795461e9fe273554220d37960408940bf7..e74dced0885534a2bee9ad22115dec42d60b4ef5 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
@@ -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 ();