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

Unified Diff: scm/parser-ly-from-scheme.scm

Issue 581610043: parser-ly-from-scheme: Make #{ compilable (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scm/parser-ly-from-scheme.scm
diff --git a/scm/parser-ly-from-scheme.scm b/scm/parser-ly-from-scheme.scm
index 2c75010ab809df3e24b3736a6021dad8c6604e59..1bd8ac70da2a6cc2e38f0f513f9ff317af8bab47 100644
--- a/scm/parser-ly-from-scheme.scm
+++ b/scm/parser-ly-from-scheme.scm
@@ -16,6 +16,13 @@
;;;; You should have received a copy of the GNU General Public License
;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+(define (read-lily-expression-internal lily-string filename line closures)
thomasmorley651 2020/02/08 20:35:49 I was going to write that we would need to care ab
dak 2020/02/08 22:02:59 Uh, is this the right issue to discuss this with?
+ (let* ((clone (ly:parser-clone closures (*location*)))
+ (result (ly:parse-string-expression clone lily-string filename line)))
+ (if (ly:parser-has-error? clone)
+ (ly:parser-error (_ "error in #{ ... #}") (*location*)))
+ result))
+
(define-public (read-lily-expression chr port)
"Read a lilypond music expression enclosed within @code{#@{} and @code{#@}}
from @var{port} and return the corresponding Scheme music expression.
@@ -97,16 +104,9 @@ from @var{port} and return the corresponding Scheme music expression.
(else
(do ((c (copy-char) (copy-char)))
((char=? c #\nl)))))))))))))
-
- (define (embedded-lilypond lily-string filename line closures)
- (let* ((clone (ly:parser-clone closures (*location*)))
- (result (ly:parse-string-expression clone lily-string
- filename line)))
- (if (ly:parser-has-error? clone)
- (ly:parser-error (_ "error in #{ ... #}") (*location*)))
- result))
- (list embedded-lilypond
- lily-string filename line
- (cons 'list (reverse! closures)))))
+ (list (if (guile-v2)
+ '(@@ (lily) read-lily-expression-internal)
+ read-lily-expression-internal)
+ lily-string filename line (cons 'list (reverse! closures)))))
(read-hash-extend #\{ read-lily-expression)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

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