docgen: add a way to get numerical id of a function

This commit is contained in:
Daniel Kolesa 2017-02-22 18:29:07 +01:00
parent 967af33da2
commit 7249dd94ab
1 changed files with 6 additions and 0 deletions

View File

@ -326,6 +326,8 @@ local func_type_str = {
[eolian.function_type.METHOD] = "method"
}
local ffi = require("ffi")
M.Function = Node:clone {
-- function types
UNRESOLVED = eolian.function_type.UNRESOLVED,
@ -443,6 +445,10 @@ M.Function = Node:clone {
is_same = function(self, other)
return self.func == other.func
end,
id_get = function(self)
return tonumber(ffi.cast("uintptr_t", self.func))
end
}