]> git.lizzy.rs Git - metalua.git/commitdiff
mlp.chunk.transformers had disappeared because mlp.chunk wasn't a regular parser...
authorFabien Fleutot <metalua@gmail.com>
Tue, 3 Feb 2009 20:05:23 +0000 (21:05 +0100)
committerFabien Fleutot <metalua@gmail.com>
Tue, 3 Feb 2009 20:05:23 +0000 (21:05 +0100)
src/compiler/mlp_misc.lua

index b76b13664dce292a2cd3c9e6a33e2f70586eb319..c09483d47be4d335c238778429d9eee3103ec380 100644 (file)
@@ -171,7 +171,7 @@ function skip_initial_sharp_comment (lx)
    if i then lx.i, lx.column_offset, lx.line = i, i, lx.line+1 end
 end
 
-function chunk (lx)
+local function _chunk (lx)
    if lx:peek().tag == 'Eof' then return { } -- handle empty files
    else 
       skip_initial_sharp_comment (lx)
@@ -179,4 +179,7 @@ function chunk (lx)
       if lx:peek().tag ~= "Eof" then error "End-of-file expected" end
       return chunk
    end
-end
\ No newline at end of file
+end
+
+-- chunk is wrapped in a sequence so that it has a "transformer" field.
+chunk = gg.sequence { _chunk, builder = unpack }
\ No newline at end of file