[NTG-pdftex] \expanded

Heiko Oberdiek oberdiek at uni-freiburg.de
Tue Dec 11 22:28:45 CET 2007


On Tue, Dec 11, 2007 at 05:54:42PM +0100, Taco Hoekwater wrote:

> Heiko Oberdiek wrote:
> > 
> > Patch 885.
> 
> I suspect there will be a problem with
> 
>    \setvalue{begin\expanded{\getvalue{relax}}}
> 
> but have not time to delve into that right now.
> 
> I suspect this, because \directlua in luatex has similar
> problems wrt. the 'current string', and I had to do
> introduce a variable to save that, like this:
> 
>      procedure conv_toks;
>      u:str_number;
>      {...}
> 
>      u:=0;
>      if str_start_macro(str_ptr)<pool_ptr then u:=make_string;
>      {...... body of action here .......}
>      if u<>0 then begin
>        if str_ptr=u+1 then
>          decr(str_ptr)
>        else begin {copy old string to the top location}
>           i:=0;
>           str_room(length(u));
>           while i<length(u) do
>             str_pool[pool_ptr+i]:=str_pool[str_start[u]+i];
>          end;
>      end;

In pdfTeX 1.40.5 all the primitives (\pdfstrcmp, \pdfescape*, ...)
are surrounded by save_cur_string and restore_cur_string. They
do quite similar:

@dsave_cur_string==if str_start[str_ptr]<pool_ptr then u:=make_string
@d restore_cur_string==if u<>0 then begin decr(str_ptr); u:=0; end

The initial "u:=0" and the extra "else" case aren't present.
Either the situation in LuaTeX is a little different or
all these primitives would probably need this. But I don't
have any examples that would show the problem.

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>
-- 


More information about the ntg-pdftex mailing list