q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ca3f41851753598d90c31255c453a1268962d0e0

commit ca3f41851753598d90c31255c453a1268962d0e0
Author: Daniel Kolesa <d.kol...@osg.samsung.com>
Date:   Fri Aug 12 13:51:39 2016 +0100

    docs: theme string retrieval for doctree classes
---
 src/scripts/elua/apps/docgen/doctree.lua | 23 +++++++++++++++--------
 src/scripts/elua/apps/gendoc.lua         |  9 +--------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/scripts/elua/apps/docgen/doctree.lua 
b/src/scripts/elua/apps/docgen/doctree.lua
index c489b63..f3428eb 100644
--- a/src/scripts/elua/apps/docgen/doctree.lua
+++ b/src/scripts/elua/apps/docgen/doctree.lua
@@ -119,13 +119,6 @@ M.Doc = Node:clone {
     end
 }
 
-local classt_to_str = {
-    [eolian.class_type.REGULAR] = "class",
-    [eolian.class_type.ABSTRACT] = "class",
-    [eolian.class_type.MIXIN] = "mixin",
-    [eolian.class_type.INTERFACE] = "interface"
-}
-
 M.Class = Node:clone {
     -- class types
     UNKNOWN = eolian.class_type.UNKNOWN,
@@ -156,7 +149,21 @@ M.Class = Node:clone {
     end,
 
     type_str_get = function(self)
-        return classt_to_str[self:type_get()]
+        return ({
+            [eolian.class_type.REGULAR] = "class",
+            [eolian.class_type.ABSTRACT] = "class",
+            [eolian.class_type.MIXIN] = "mixin",
+            [eolian.class_type.INTERFACE] = "interface"
+        })[self:type_get()]
+    end,
+
+    theme_str_get = function(self)
+        return ({
+            [eolian.class_type.REGULAR] = "regular",
+            [eolian.class_type.ABSTRACT] = "abstract",
+            [eolian.class_type.MIXIN] = "mixin",
+            [eolian.class_type.INTERFACE] = "interface"
+        })[self:type_get()]
     end,
 
     doc_get = function(self)
diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua
index 042d4a5..9833bcd 100644
--- a/src/scripts/elua/apps/gendoc.lua
+++ b/src/scripts/elua/apps/gendoc.lua
@@ -667,20 +667,13 @@ local set_theme = function(tname)
     end
 end
 
-local classt_to_theme = {
-    [dtree.Class.REGULAR] = "regular",
-    [dtree.Class.ABSTRACT] = "abstract",
-    [dtree.Class.MIXIN] = "mixin",
-    [dtree.Class.INTERFACE] = "interface"
-}
-
 local class_to_node = function(cl, main)
     local ret = {}
 
     ret.label = cl:full_name_get()
     ret.name = ret.label:lower():gsub("%.", "_")
 
-    local clr = classt_to_theme[cl:type_get()]
+    local clr = cl:theme_str_get()
 
     ret.style = current_theme.classes[clr].style
     ret.color = current_theme.classes[clr][main and "primary_color" or "color"]

-- 


Reply via email to