From 1a1fc6172ce9945608d998c1874408c4a42400a0 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Thu, 7 Jul 2016 15:23:45 +0100 Subject: [PATCH] docs: support refs and new types in generator --- src/scripts/elua/apps/docgen/gendoc.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/scripts/elua/apps/docgen/gendoc.lua b/src/scripts/elua/apps/docgen/gendoc.lua index 509305e412..0d586273fc 100644 --- a/src/scripts/elua/apps/docgen/gendoc.lua +++ b/src/scripts/elua/apps/docgen/gendoc.lua @@ -762,6 +762,9 @@ local wrap_type_attrs = function(tp, str) if ffunc then str = "free(" .. str .. ", " .. ffunc .. ")" end + if tp:is_ref() then + str = "ref(" .. str .. ")" + end return str end @@ -793,6 +796,13 @@ get_type_str = function(tp) suffix = "*" end return wrap_type_attrs(tp, get_type_str(btp) .. suffix) + elseif tpt == tps.STATIC_ARRAY then + return wrap_type_attrs(tp, "static_array<" + .. get_type_str(tp:base_type_get()) .. ", " + .. tp:array_size_get() .. ">") + elseif tpt == tps.TERMINATED_ARRAY then + return wrap_type_attrs(tp, "terminated_array<" + .. get_type_str(tp:base_type_get()) .. ">") end error("unhandled type type: " .. tpt) end