msgpack-gen: Fix for Lua 5.1. (#4857)

goto statement was only introduced in Lua 5.2.
This commit is contained in:
Florian Walch
2016-06-02 01:14:09 +02:00
committed by Justin M. Keyes
parent 568da8ef3b
commit 634d59f646

View File

@@ -45,7 +45,7 @@ grammar = Ct((c_proto + c_comment + c_preproc + ws) ^ 1)
assert(#arg >= 1)
functions = {}
-- names of all headers relative to the source root(for inclusion in the
-- names of all headers relative to the source root (for inclusion in the
-- generated file)
headers = {}
-- output file(dispatch function + metadata serialized with msgpack)
@@ -64,9 +64,7 @@ for i = 1, #arg - 1 do
local tmp = grammar:match(input:read('*all'))
for i = 1, #tmp do
local fn = tmp[i]
if fn.noexport then
goto continue
end
if not fn.noexport then
functions[#functions + 1] = tmp[i]
if #fn.parameters ~= 0 and fn.parameters[1][2] == 'channel_id' then
-- this function should receive the channel id
@@ -81,7 +79,7 @@ for i = 1, #arg - 1 do
-- for specifying errors
fn.parameters[#fn.parameters] = nil
end
::continue::
end
end
input:close()
end