docs: Treesitter (#13260)

* doc & fixes: Generate treesitter docs

* fixup to treesitter-core

* docs(treesitter): fix docs for most functions

Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
This commit is contained in:
TJ DeVries
2021-05-01 05:19:48 -07:00
committed by GitHub
parent ca6107cfbc
commit 27da5511a0
10 changed files with 775 additions and 298 deletions

View File

@@ -491,6 +491,27 @@ function TLua2DoX_filter.readfile(this,AppStamp,Filename)
end
end
-- Big hax
if string.find(fn, ":") then
-- TODO: We need to add a first parameter of "SELF" here
-- local colon_place = string.find(fn, ":")
-- local name = string.sub(fn, 1, colon_place)
fn = fn:gsub(":", ".", 1)
outStream:writeln("/// @param self")
local paren_start = string.find(fn, "(", 1, true)
local paren_finish = string.find(fn, ")", 1, true)
-- Nothing in between the parens
local comma
if paren_finish == paren_start + 1 then
comma = ""
else
comma = ", "
end
fn = string.sub(fn, 1, paren_start) .. "self" .. comma .. string.sub(fn, paren_start + 1)
end
-- add vanilla function
outStream:writeln(fn_type .. 'function ' .. fn .. '{}')
end