lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> > Why not? Just expand tokens with the same line numbers as the tokens that
> > trigger the expansion.
> 
> That can be a useful approach, but it might not be a general solution
> if the lines get rearranged:
> 
> macro square(x) (x*x)  -- (1)
> print square(x)     -- (2)
>   unless bar  -- (3)
> 
> if not bar then   -- (3)
>   print (x*x) end  -- (1,2)
> 
> unless you transform the generated code in a contorted way so that the
> lines remain in order.

Right! I was thinking about less drastic rewritting.