aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-14 16:51:11 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-14 16:51:11 +0100
commit2d0a25c9953c28d8c4a8c7e1bcc9034bb565384a (patch)
treeb2e586797677e906168a21ae777bacea9bbce693
parenteo: fix invalidate to always happen. (diff)
downloadefl-2d0a25c9953c28d8c4a8c7e1bcc9034bb565384a.tar.gz
eolian: refactor doc ref resolution API
-rw-r--r--src/bindings/luajit/eolian.lua6
-rw-r--r--src/lib/eolian/Eolian.h4
-rw-r--r--src/lib/eolian/database_validate.c2
-rw-r--r--src/lib/eolian/eolian_database.c4
-rw-r--r--src/scripts/elua/apps/docgen/doctree.lua7
-rw-r--r--src/scripts/elua/apps/docgen/writer.lua2
-rw-r--r--src/scripts/pyolian/eolian_lib.py6
-rw-r--r--src/tests/eolian/eolian_parsing.c4
8 files changed, 17 insertions, 18 deletions
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index 07179190be..9f629009f2 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -461,7 +461,7 @@ ffi.cdef [[
void eolian_doc_token_init(Eolian_Doc_Token *tok);
Eolian_Doc_Token_Type eolian_doc_token_type_get(const Eolian_Doc_Token *tok);
char *eolian_doc_token_text_get(const Eolian_Doc_Token *tok);
- Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const Eolian_Object **data, const Eolian_Object **data2);
+ Eolian_Object_Type eolian_doc_token_ref_resolve(const Eolian_Doc_Token *tok, const Eolian_Unit *unit, const Eolian_Object **data, const Eolian_Object **data2);
]]
local cutil = require("cutil")
@@ -1735,9 +1735,9 @@ M.Eolian_Doc_Token = ffi.metatype("Eolian_Doc_Token", {
return ret
end,
- ref_get = function(self, unit)
+ ref_resolve = function(self, unit)
local stor = ffi.new("const Eolian_Object *[2]")
- local tp = tonumber(eolian.eolian_doc_token_ref_get(unit, self, stor, stor + 1))
+ local tp = tonumber(eolian.eolian_doc_token_ref_resolve(self, unit, stor, stor + 1))
local reft = M.object_type
if tp == reft.CLASS then
return tp, ffi.cast("const Eolian_Class *", stor[0])
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 627941e574..b6f4fa852f 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -2866,13 +2866,13 @@ EAPI char *eolian_doc_token_text_get(const Eolian_Doc_Token *tok);
* and the second data is the event, when it's a struct field or enum field
* the first data is is the struct/enum and the second data is the field.
*
- * @param[in] unit the unit to look in
* @param[in] tok the token
+ * @param[in] unit the unit to look in
* @param[out] data the primary data
* @param[out] data2 the secondary data
* @return the kind of reference this is
*/
-EAPI Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const Eolian_Object **data, const Eolian_Object **data2);
+EAPI Eolian_Object_Type eolian_doc_token_ref_resolve(const Eolian_Doc_Token *tok, const Eolian_Unit *unit, const Eolian_Object **data, const Eolian_Object **data2);
#endif
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index 5733db3141..516db724a8 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -35,7 +35,7 @@ _validate_docstr(const Eolian_Unit *src, Eina_Stringshare *str, const Eolian_Obj
eolian_doc_token_init(&tok);
while (ret && (doc = eolian_documentation_tokenize(doc, &tok)))
if (eolian_doc_token_type_get(&tok) == EOLIAN_DOC_TOKEN_REF)
- if (eolian_doc_token_ref_get(src, &tok, NULL, NULL) == EOLIAN_OBJECT_UNKNOWN)
+ if (eolian_doc_token_ref_resolve(&tok, src, NULL, NULL) == EOLIAN_OBJECT_UNKNOWN)
{
char *refn = eolian_doc_token_text_get(&tok);
_eolian_log_line(info->file, info->line, info->column,
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index e5cd1c0b7f..9cb4759cd1 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -410,8 +410,8 @@ _resolve_event(const Eolian_Unit *src, char *name, const Eolian_Object **data,
}
EAPI Eolian_Object_Type
-eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok,
- const Eolian_Object **data, const Eolian_Object **data2)
+eolian_doc_token_ref_resolve(const Eolian_Doc_Token *tok, const Eolian_Unit *unit,
+ const Eolian_Object **data, const Eolian_Object **data2)
{
if (tok->type != EOLIAN_DOC_TOKEN_REF)
return EOLIAN_OBJECT_UNKNOWN;
diff --git a/src/scripts/elua/apps/docgen/doctree.lua b/src/scripts/elua/apps/docgen/doctree.lua
index 825ac7365e..bad0e68637 100644
--- a/src/scripts/elua/apps/docgen/doctree.lua
+++ b/src/scripts/elua/apps/docgen/doctree.lua
@@ -670,8 +670,7 @@ M.Type = Node:clone {
end,
class_get = function(self)
- -- FIXME: unit
- return self._obj:class_get(eos:unit_get())
+ return self._obj:class_get()
end,
is_owned = function(self)
@@ -1347,9 +1346,9 @@ M.DocTokenizer = util.Object:clone {
return self.tok:type_get()
end,
- ref_get = function(self, root)
+ ref_resolve = function(self, root)
-- FIXME: unit
- local tp, d1, d2 = self.tok:ref_get(eos:unit_get())
+ local tp, d1, d2 = self.tok:ref_resolve(eos:unit_get())
local reft = eolian.doc_ref_type
local ret = {}
if tp == reft.CLASS or tp == reft.FUNC or tp == reft.EVENT then
diff --git a/src/scripts/elua/apps/docgen/writer.lua b/src/scripts/elua/apps/docgen/writer.lua
index 92be2f1adf..2aeadf8da7 100644
--- a/src/scripts/elua/apps/docgen/writer.lua
+++ b/src/scripts/elua/apps/docgen/writer.lua
@@ -345,7 +345,7 @@ writers["dokuwiki"] = util.Object:clone {
hasraw = true
end
if tp == tokp.REF then
- local reft = tokp:ref_get(true)
+ local reft = tokp:ref_resolve(true)
local str = tokp:text_get()
if str:sub(1, 1) == "[" then
str = str:sub(2, #str - 1)
diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py
index 9fb0a33142..c16ef5ce5e 100644
--- a/src/scripts/pyolian/eolian_lib.py
+++ b/src/scripts/pyolian/eolian_lib.py
@@ -759,7 +759,7 @@ lib.eolian_doc_token_type_get.restype = c_int
lib.eolian_doc_token_text_get.argtypes = [c_void_p,]
lib.eolian_doc_token_text_get.restype = c_void_p # char* TO BE FREED
-# EAPI Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const Eolian_Object **data, const Eolian_Object **data2);
-# lib.eolian_doc_token_ref_get.argtypes = [c_void_p, c_void_p, ???, ???]
-# lib.eolian_doc_token_ref_get.restype = c_int
+# EAPI Eolian_Object_Type eolian_doc_token_ref_resolve(const Eolian_Doc_Token *tok, const Eolian_Unit *unit, const Eolian_Object **data, const Eolian_Object **data2);
+# lib.eolian_doc_token_ref_resolve.argtypes = [c_void_p, c_void_p, ???, ???]
+# lib.eolian_doc_token_ref_resolve.restype = c_int
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index b86cb6c1d3..33c26f1593 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -1256,7 +1256,7 @@ START_TEST(eolian_docs)
fail_if(eolian_doc_token_type_get(&tok) != EOLIAN_DOC_TOKEN_REF);
txt = eolian_doc_token_text_get(&tok);
fail_if(strcmp(txt, "pants"));
- fail_if(eolian_doc_token_ref_get(unit, &tok, NULL, NULL) != EOLIAN_OBJECT_VARIABLE);
+ fail_if(eolian_doc_token_ref_resolve(&tok, unit, NULL, NULL) != EOLIAN_OBJECT_VARIABLE);
free(txt);
tdoc = eolian_documentation_tokenize(tdoc, &tok);
fail_if(eolian_doc_token_type_get(&tok) != EOLIAN_DOC_TOKEN_TEXT);
@@ -1267,7 +1267,7 @@ START_TEST(eolian_docs)
fail_if(eolian_doc_token_type_get(&tok) != EOLIAN_DOC_TOKEN_REF);
txt = eolian_doc_token_text_get(&tok);
fail_if(strcmp(txt, "Docs.meth"));
- fail_if(eolian_doc_token_ref_get(unit, &tok, NULL, NULL) != EOLIAN_OBJECT_FUNCTION);
+ fail_if(eolian_doc_token_ref_resolve(&tok, unit, NULL, NULL) != EOLIAN_OBJECT_FUNCTION);
free(txt);
tdoc = eolian_documentation_tokenize(tdoc, &tok);
fail_if(eolian_doc_token_type_get(&tok) != EOLIAN_DOC_TOKEN_TEXT);