]> git.donarmstrong.com Git - lilypond.git/commitdiff
Get rid of pending_string_includes
authorDavid Kastrup <dak@gnu.org>
Mon, 21 Nov 2011 18:26:53 +0000 (19:26 +0100)
committerDavid Kastrup <dak@gnu.org>
Mon, 21 Nov 2011 18:26:53 +0000 (19:26 +0100)
lily/includable-lexer.cc
lily/include/includable-lexer.hh
lily/lexer.ll
lily/lily-parser.cc

index 15d52a3ae9b50368536bf60a38fc967053d23bad..5c262121858384ce280dfc0826ef07591d03e752 100644 (file)
@@ -111,12 +111,6 @@ Includable_lexer::new_input (string name, string data, Sources *sources)
   yy_switch_to_buffer (yy_create_buffer (file->get_istream (), YY_BUF_SIZE));
 }
 
-void
-Includable_lexer::add_string_include (string data)
-{
-  pending_string_includes_.push_back (data);
-}
-
 /** pop the inputstack.  conceptually this is a destructor, but it
     does not destruct the Source_file that Includable_lexer::new_input
     creates.  */
index 3c0fe8b9fa75c437aa7b0c7e62ac2dbbcabb6482..06b3e1fa4e4c805e07a519532324dc00d593f59f 100644 (file)
@@ -42,7 +42,6 @@ protected:
   bool close_input ();
   vector<Source_file *> include_stack_;
   vector<int> char_count_stack_;
-  vector<string> pending_string_includes_;
 
 public:
 
@@ -57,7 +56,6 @@ public:
   virtual void new_input (string s, Sources *);
 
   void new_input (string name, string data, Sources *);
-  void add_string_include (string data);
 
   char const *here_str0 () const;
 };
index 462ed8988e20e1e3e60060926cee908c652e35b7..2ef59f43f5243618951de8eb6d4c0ea90b23b03f 100644 (file)
@@ -402,7 +402,6 @@ BOM_UTF8    \357\273\277
        hi.step_forward ();
        SCM sval = ly_parse_scm (hi.start (), &n, hi,
                be_safe_global && is_main_input_, parser_);
-       sval = eval_scm (sval);
 
        for (int i = 0; i < n; i++)
        {
@@ -410,10 +409,7 @@ BOM_UTF8   \357\273\277
        }
        char_count_stack_.back () += n;
 
-       for (size_t i = 0; i < pending_string_includes_.size (); i++)
-               new_input ("<included string>", pending_string_includes_[i],
-                          parser_->sources_);
-       pending_string_includes_.clear ();
+       sval = eval_scm (sval);
                
        int token = scan_scm_id (sval);
        if (!scm_is_eq (yylval.scm, SCM_UNSPECIFIED))
index 2d19da83109251d8872a629e1396e47fe8f5f524..196b36f55792ee98a2957b1fc2ca76417fb68a5b 100644 (file)
@@ -199,7 +199,7 @@ Lily_parser::parse_string_expression (string ly_code)
 void
 Lily_parser::include_string (string ly_code)
 {
-  lexer_->add_string_include (ly_code);
+  lexer_->new_input ("<included string>", ly_code, sources_);
 }
 
 void