[Metalua-list] Patch

Fabien Fleutot fleutot at gmail.com
Wed Sep 3 20:57:41 GMT+2 2008


I don't understand the cause of the "else return; end" issue, I'll need to
look more carefully.

The initial # comment should be fixed in mlp.chunk(), at the end of
mlp_misc.lua, but it requires to fiddle with the lexer. A hack like this
might do a temporary fix, but it breaks through the lexer's morally
protected API:

function skip_sharp_comment (lx)
   local i = lx.src:match ("^#.-\n()", src.i)
   if i then src.i = i end

function chunk (lx)
   if lx:peek().tag == 'Eof' then return { }
      skip_sharp_comment (lx)
      local chunk = block (lx)
      if lx:peek().tag ~= "Eof" then error "End-of-file expected" end
      return chunk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.luaforge.net/pipermail/metalua-list/attachments/20080904/1ab2726a/attachment.htm

More information about the Metalua-list mailing list