|
From: | Han-Wen Nienhuys |
Subject: | Re: Feature: multiple header definitions |
Date: | Wed, 20 Jul 2005 01:45:47 +0200 |
User-agent: | Mozilla Thunderbird 1.0.2-6 (X11/20050513) |
Ishizaki wrote:
On Mon, 18 Jul 2005 00:27:13 +0900 Ishizaki <address@hidden> wrote:Hi, after wandering around lilypond sources, I think I could add this feature, changes are quite simple than I imagined. Please see and try this patch. ( should work both v2.6.1 and cvs tree )
I've reverted your patch from CVS. Graham, please do not apply code changes without discussing them with me. I know that I have been a little less responsive, but if that happens, just bug me more.
Ishizaki, can you follow our coding style guide lines wrt formatting? I'm missing documentation changes and ChangeLog entries for your patch. Also, the // and /**/ comments are superfluous, so they should be left out.
Also, for uniformity with midi and paper, add your code to lily-parser.cc , and use $defaultheader iso. $globalheader as identifier? Thanks!
--- lily/parser.yy.orig 2005-07-18 01:44:38.000000000 +0900 +++ lily/parser.yy 2005-07-18 02:23:09.000000000 +0900 @@ -626,8 +626,16 @@ 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 { -- Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen
[Prev in Thread] | Current Thread | [Next in Thread] |