From 740899831e6385fdda656dd906ea2a3b8e62f8c9 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Mon, 21 Nov 2011 17:48:07 +0100 Subject: [PATCH] ly:parser-include-string can't be executed asynchronously --- lily/lexer.ll | 14 ++++++++------ lily/lily-parser-scheme.cc | 3 ++- ly/init.ly | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lily/lexer.ll b/lily/lexer.ll index 32fa5f2b68..462ed8988e 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -392,11 +392,6 @@ 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 (); - yylval.scm = sval; return SCM_TOKEN; } @@ -415,7 +410,14 @@ BOM_UTF8 \357\273\277 } char_count_stack_.back () += n; - return scan_scm_id (sval); + for (size_t i = 0; i < pending_string_includes_.size (); i++) + new_input ("", pending_string_includes_[i], + parser_->sources_); + pending_string_includes_.clear (); + + int token = scan_scm_id (sval); + if (!scm_is_eq (yylval.scm, SCM_UNSPECIFIED)) + return token; } { diff --git a/lily/lily-parser-scheme.cc b/lily/lily-parser-scheme.cc index 50f02051b2..596987dd1e 100644 --- a/lily/lily-parser-scheme.cc +++ b/lily/lily-parser-scheme.cc @@ -228,7 +228,8 @@ LY_DEFINE (ly_parse_string_expression, "ly:parse-string-expression", LY_DEFINE (ly_parser_include_string, "ly:parser-include-string", 2, 0, 0, (SCM parser_smob, SCM ly_code), "Include the string @var{ly-code} into the input stream" - " for @var{parser-smob}.") + " for @var{parser-smob}. Can only be used in immediate" + " Scheme expressions (@code{$} instead of @code{#}).") { LY_ASSERT_SMOB (Lily_parser, parser_smob, 1); Lily_parser *parser = unsmob_lily_parser (parser_smob); diff --git a/ly/init.ly b/ly/init.ly index 380d9d2a0b..25c2ba0afb 100644 --- a/ly/init.ly +++ b/ly/init.ly @@ -4,7 +4,7 @@ #(if (and #t (defined? 'set-debug-cell-accesses!)) (set-debug-cell-accesses! 5000)) -\version "2.14.0" +\version "2.15.18" \include "declarations-init.ly" @@ -23,7 +23,7 @@ #(define book-output-suffix #f) #(use-modules (scm clip-region)) -#(if (ly:get-option 'include-settings) +$(if (ly:get-option 'include-settings) (ly:parser-include-string parser (format #f "\\include \"~a\"" (ly:get-option 'include-settings)))) -- 2.39.5