Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(561)

Unified Diff: lily/parse-scm.cc

Issue 6295098: Allow immediate Scheme expressions with splicing and multiple values (Closed) Base URL: http://git.savannah.gnu.org/gitweb/?p=lilypond.git/trunk/
Patch Set: A bit more explanation in the docs Created 12 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lily/lexer.ll ('k') | lily/parser.yy » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lily/parse-scm.cc
diff --git a/lily/parse-scm.cc b/lily/parse-scm.cc
index fbd60a941a4bdff3b1536fd5ce11c97ca4c6aff4..3dc07fa3d5c68e5295ebe3c6b1353c383088fa58 100644
--- a/lily/parse-scm.cc
+++ b/lily/parse-scm.cc
@@ -47,9 +47,14 @@ internal_ly_parse_scm (Parse_start *ps)
scm_set_port_line_x (port, scm_from_int (ps->start_location_.line_number () - 1));
scm_set_port_column_x (port, scm_from_int (ps->start_location_.column_number () - 1));
- SCM form = scm_read (port);
+ bool multiple = ly_is_equal (scm_peek_char (port), SCM_MAKE_CHAR ('@'));
+
+ if (multiple)
+ (void) scm_read_char (port);
+ SCM form = scm_read (port);
SCM to = scm_ftell (port);
+
ps->nchars = scm_to_int (to) - scm_to_int (from);
if (!SCM_EOF_OBJECT_P (form))
@@ -62,6 +67,10 @@ internal_ly_parse_scm (Parse_start *ps)
// Replace form with a call to previously compiled closure
form = scm_list_1 (c);
}
+ if (multiple)
+ form = scm_list_3 (ly_symbol2scm ("apply"),
+ ly_symbol2scm ("values"),
+ form);
return scm_cons (form, make_input (ps->start_location_));
}
@@ -171,4 +180,3 @@ ly_eval_scm (SCM form, Input i, bool safe, Lily_parser *parser)
scm_remember_upto_here_1 (form);
return ans;
}
-
« no previous file with comments | « lily/lexer.ll ('k') | lily/parser.yy » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b