lua-users home
lua-l archive

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

> I was trying to use metatables to create a abstract syntax tree (AST)
> like lisp from lua code.

There's a similar example in the SPE paper:

See section "Using fallbacks", starting at "Another unusual facility
provided by fallbacks is the reuse of Lua's parser".

The code in that paper is for Lua 2.1 but it can be readily adapted for Lua 5.1.