diff --git a/densaku_lib b/densaku_lib index e7fa05a..aaa5024 160000 --- a/densaku_lib +++ b/densaku_lib @@ -1 +1 @@ -Subproject commit e7fa05a251e0fe746b9524e94b42b5093c4714bf +Subproject commit aaa50241ac140b5441e8cfb34bd4e884a4828af7 diff --git a/src/generation/types.anubis b/src/generation/types.anubis index a6cd9f7..ef49aa5 100644 --- a/src/generation/types.anubis +++ b/src/generation/types.anubis @@ -33,7 +33,7 @@ define Maybe(One) String dest_dir ) = - since ds_type is ds_type(name, alternatives), + since ds_type is ds_type(name, generation, alternatives), println("Generating file for type ["+name+"]"); with file_name = dest_dir+"types/generated/"+to_lower(name)+".anubis", @@ -47,11 +47,15 @@ define Maybe(One) with strm = make_stream(fd), if generate_type_header(strm, ds_type) is { failure then failure, success(_) then if generate_type(strm, ds_type) is { failure then failure, success(_) then - if generate_type_message_description(strm, ds_type) is { failure then failure, success(_) then - if generate_type_to_message(strm, ds_type) is { failure then failure, success(_) then - if generate_type_from_message(strm, ds_type) is { failure then failure, success(_) then - - success(unique)}}}}} + if generation is + { + no_message then success(unique), + message then + if generate_type_message_description(strm, ds_type) is { failure then failure, success(_) then + if generate_type_to_message(strm, ds_type) is { failure then failure, success(_) then + if generate_type_from_message(strm, ds_type) is { failure then failure, success(_) then + success(unique)}}} + }}} } . @@ -61,7 +65,7 @@ public define One List(DS_Type) types, String destination_dir )= - map_forget((DS_Type type) |-> since type is ds_type(type_name, ds_alts), + map_forget((DS_Type type) |-> since type is ds_type(type_name, _, ds_alts), println("generating type file for Type ["+type_name+"]"); make_type_file(type, destination_dir), types) . diff --git a/src/generation/types_messages.anubis b/src/generation/types_messages.anubis index 12b8628..bbc91ad 100644 --- a/src/generation/types_messages.anubis +++ b/src/generation/types_messages.anubis @@ -29,7 +29,7 @@ public define Maybe(One) Stream stream, DS_Type ds_type //type description )= - since ds_type is ds_type(type_name, alternatives), + since ds_type is ds_type(type_name, _, alternatives), with title = type_name+" message format", write_string(stream, "\n"+ @@ -159,7 +159,7 @@ public define Maybe(One) Stream stream, DS_Type ds_type //type description )= - since ds_type is ds_type(type_name, alternatives), + since ds_type is ds_type(type_name, _, alternatives), with lower_type_name = "_"+to_lower(type_name), type_msg = lower_type_name+"_message", write_string(stream, @@ -377,7 +377,7 @@ public define Maybe(One) Stream stream, DS_Type ds_type //type description )= - since ds_type is ds_type(type_name, alternatives), + since ds_type is ds_type(type_name, _, alternatives), with lower_type_name = "_"+to_lower(type_name), type_msg = lower_type_name+"_message", write_string(stream, diff --git a/src/main.anubis b/src/main.anubis index d81c8f2..ac23cce 100644 --- a/src/main.anubis +++ b/src/main.anubis @@ -84,7 +84,21 @@ public define List(DS_Type) the_types_list = ds_type("HK_Icon", [ enum("no_icon"), alternative("icon16", [component(string, "name")]) - ]), + ]), + + ds_type("HK_Form", no_message, [ + alternative("hk_form_in_list", [ + component(string, "table_name", comment("database table name which belonging this form")), + component(string, "view_name", comment("name of the view")), + component(list, extern_type("HK_Form_Entry", "hk_form_entry.anubis"), "list"), + component(list, extern_type("HK_Form_Tab", "hk_form_tab.anubis"), "tabs") + ]), + alternative("hk_form_in_table", [ + component(string, "table_name", comment("database table name which belonging this form")), + component(string, "view_name", comment("name of the view")), + component(extern_type("HK_Form_Table", "hk_form_table.anubis"), "form_in_table") + ]) + ]) ]. diff --git a/src/types_checking.anubis b/src/types_checking.anubis index 9633b4c..2493f5b 100644 --- a/src/types_checking.anubis +++ b/src/types_checking.anubis @@ -39,7 +39,7 @@ define Maybe(One) { [] then return, [h . t] then - since h is ds_type(type_name, tk_alts), + since h is ds_type(type_name, _, tk_alts), if is_upper_case_start(type_name) then check_name(t, [], return) else -- libgit2 0.21.4