From f13201203aa29869b1ea937d1be0492d165989d5 Mon Sep 17 00:00:00 2001 From: totoro Date: Sat, 27 Nov 2021 08:21:24 +0100 Subject: [PATCH] [+] refactoring the get X _show_string --- src/generation/types.anubis | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/generation/types.anubis b/src/generation/types.anubis index f8feb70..f710341 100644 --- a/src/generation/types.anubis +++ b/src/generation/types.anubis @@ -415,7 +415,17 @@ public define Maybe(One) " failure then default_select,\n"+ " success(obj) then "+show_string+"\n"+ " }\n"+ - " }." + " }\n"+ + "."+ + "\n\n"+ + "public define String\n"+ + " get_"+name+"_show_string\n"+ + " (\n"+ + " SQLite3DataBase db,\n"+ + " "+type_name+" obj\n"+ + " )=\n"+ + " "+show_string+"\n"+ + "." ) is //end of the function { failure then println("can't write generate_update "+type_name); failure, @@ -446,11 +456,7 @@ public define Maybe(One) " {\n"+ " [] then [selector_default_entry . reverse(so_far)],\n"+ " [ h . t ] then \n"+ - " if h.id is \n"+ - " {\n"+ - " none then [selector_default_entry],\n"+ - " db_id(_id) then _get_selector_"+name+"(db, t, [([], wav(to_String(_id)), get_"+name+"_show_string(db, h.id)) . so_far])\n"+ - " }\n"+ + " _get_selector_"+name+"(db, t, [([], wav(to_String(h.id)), get_"+name+"_show_string(db, h)) . so_far])\n"+ " }.\n\n"+ "public define List((List(CoreAttrs), WebArgValue, String))\n"+ " get_selector_"+name+"\n"+ -- libgit2 0.21.4