From 0b93318836b1909ed00c0b933ed2ef55389443f3 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 23 Jun 2008 18:53:45 +0200 Subject: [PATCH] build: fix argument generation Signed-off-by: Julien Danjou --- build-utils/fake-lua-src.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build-utils/fake-lua-src.lua b/build-utils/fake-lua-src.lua index 38a332229..d8bc91031 100755 --- a/build-utils/fake-lua-src.lua +++ b/build-utils/fake-lua-src.lua @@ -3,13 +3,20 @@ -- dummy lua source file that can be processed by luadoc. -- Take a .c file in stdin +nparam = 0; +function string.replace_param(s) + nparam = nparam + 1; + return "@param arg" .. nparam +end + function string.comment_translate(s) local lua_comment = ""; + nparam = 0; for line in s:gmatch("[^\r\n]+") do line = line:gsub("/%*%*", "---") line = line:gsub("^.*%*", "--") - line = line:gsub("\\lvalue", "@param") - line = line:gsub("\\lparam", "@param") + line = line:gsub("\\lvalue", "") + line = line:gsub("\\(lparam)", string.replace_param) line = line:gsub("\\lreturn", "@return") lua_comment = lua_comment .. line .. "\n" end