Re: [PMCMS-discuss] MP4H with entity support
Status: Beta
Brought to you by:
dinsen
|
From: Denis B. <ba...@im...> - 2001-09-28 13:54:04
|
On Fri, Sep 28, 2001 at 02:39:57PM +0200, Anders Dinsen wrote: > Hi Denis > > I've begun adding support for user defined entities to MP4H, i.e. argument > less macros that are invoked with ¯o-name; To do it, I've changed the > parser and added a new builtin <define-entity>...</define-entity> similar > to define-tag. There's also a new symbol table for entities. Hi Anders, nice, this is exactly the name I chose too ;) > It works mostly, but evaluates the body of the define-entity builtin too > early. I cannot track the problem. Can you help me. > > I've attached a patch, that can be applied against mp4h-1.2.0. > Try ``make test'' and watch the second entity test fail. Right, I'll have a look tonight. > <define-entity foo>hello</define-entity> > <define-entity bar>&foo;</define-entity>&bar; > <define-entity foo>hello world</define-entity>&bar; There is indeed a problem here, you have to disable entity expansion when defining macros. Maybe the simplest solution is to transform &foo; by <%foo%/> (or any other special name) in expand_user_macro, it should then be expanded as you want. BTW I do not remember rules about entity expansion, are you sure that the latter definition overrides the formers? Denis |