From: David Kastrup Date: Mon, 21 Nov 2011 18:26:53 +0000 (+0100) Subject: Get rid of pending_string_includes X-Git-Tag: release/2.15.20-1~9 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8c4e7863bd611b47c27c2c7e251fb74a7456a1e8;p=lilypond.git Get rid of pending_string_includes --- diff --git a/lily/includable-lexer.cc b/lily/includable-lexer.cc index 15d52a3ae9..5c26212185 100644 --- a/lily/includable-lexer.cc +++ b/lily/includable-lexer.cc @@ -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. */ diff --git a/lily/include/includable-lexer.hh b/lily/include/includable-lexer.hh index 3c0fe8b9fa..06b3e1fa4e 100644 --- a/lily/include/includable-lexer.hh +++ b/lily/include/includable-lexer.hh @@ -42,7 +42,6 @@ protected: bool close_input (); vector include_stack_; vector char_count_stack_; - vector 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; }; diff --git a/lily/lexer.ll b/lily/lexer.ll index 462ed8988e..2ef59f43f5 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -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 ("", 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)) diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index 2d19da8310..196b36f557 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -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 ("", ly_code, sources_); } void