lua-users home
lua-l archive

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



Took my dip into the Wonderful World of token filters. Veeery lua- ish, indeed.

May I suggest using .lhf for filter files? ;) For Lua Halfway Filter, or...

Attachment: do-filter.lua
Description: Binary data

Attachment: test-do.lua
Description: Binary data


-asko

ps. Is there any way I could wrap-in a function body, when processing its paramlist, without needing a ')' token to be
inserted after the function?  Guess not. :-?


Luiz Henrique de Figueiredo kirjoitti 24.10.2006 kello 17.57:

Here's my semi-regular posting about erlang style numbers... this time
as an excuse to play with Luiz' token filter. Below is the code to
support this interesting (to me at least) extension:

See, no need for C hacking! :-) And pretty easy to do it in Lua, right? (I'm not blowing my own horn here; just remarking that token filters can be
a better alternative to hacking the Lua core to add more sugar.)

-- 2#1001 means base "2" numeric constant "1001" or 9 in decimal

Just note that you cannot enforce that the three parts are a single token, that is, 2 # 1001 will be accepted as a binary constant. Just don't
tell your users about it :-)
--lhf