From 17c508ec8b6516d45246bd0998b876f3e8c03afe Mon Sep 17 00:00:00 2001 From: gpercival Date: Tue, 19 Jul 2005 05:22:25 +0000 Subject: [PATCH] Yoshinobu Ishizaki's patch to allow multiple header definitions. --- ChangeLog | 5 +++++ lily/parser.yy | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d5d1f35b2..78531bcef2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-07-18 Yoshinobu Isizaki + + * lily/parser.yy (lilypond_header_body): enables + multiple header definition. + 2005-07-19 Han-Wen Nienhuys * lily/include/translator.icc diff --git a/lily/parser.yy b/lily/parser.yy index 2b5b6c0caa..03df3be127 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -626,8 +626,16 @@ embedded_scm: lilypond_header_body: { - $$ = ly_make_anonymous_module (be_safe_global); - THIS->lexer_->add_scope ($$); + SCM id = THIS->lexer_->lookup_identifier("$globalheader"); + if ( ly_is_module(id) ){ + // if the header exists, then comes here. + THIS->lexer_->add_scope(id); + $$ = id; + }else{ + /* org code */ + $$ = ly_make_anonymous_module (be_safe_global); + THIS->lexer_->add_scope ($$); + } } | lilypond_header_body assignment { -- 2.39.5