Commit f9e530094fb44a5cb75bf2ea9fac0b78cfea3cf9
1 parent
e0ffd963
manage the option of not generation Muscle message
Showing
5 changed files
with
31 additions
and
13 deletions
Show diff stats
densaku_lib @ aaa50241ac1
src/generation/types.anubis
| @@ -33,7 +33,7 @@ define Maybe(One) | @@ -33,7 +33,7 @@ define Maybe(One) | ||
| 33 | String dest_dir | 33 | String dest_dir |
| 34 | ) | 34 | ) |
| 35 | = | 35 | = |
| 36 | - since ds_type is ds_type(name, alternatives), | 36 | + since ds_type is ds_type(name, generation, alternatives), |
| 37 | println("Generating file for type ["+name+"]"); | 37 | println("Generating file for type ["+name+"]"); |
| 38 | with file_name = dest_dir+"types/generated/"+to_lower(name)+".anubis", | 38 | with file_name = dest_dir+"types/generated/"+to_lower(name)+".anubis", |
| 39 | 39 | ||
| @@ -47,11 +47,15 @@ define Maybe(One) | @@ -47,11 +47,15 @@ define Maybe(One) | ||
| 47 | with strm = make_stream(fd), | 47 | with strm = make_stream(fd), |
| 48 | if generate_type_header(strm, ds_type) is { failure then failure, success(_) then | 48 | if generate_type_header(strm, ds_type) is { failure then failure, success(_) then |
| 49 | if generate_type(strm, ds_type) is { failure then failure, success(_) then | 49 | if generate_type(strm, ds_type) is { failure then failure, success(_) then |
| 50 | - if generate_type_message_description(strm, ds_type) is { failure then failure, success(_) then | ||
| 51 | - if generate_type_to_message(strm, ds_type) is { failure then failure, success(_) then | ||
| 52 | - if generate_type_from_message(strm, ds_type) is { failure then failure, success(_) then | ||
| 53 | - | ||
| 54 | - success(unique)}}}}} | 50 | + if generation is |
| 51 | + { | ||
| 52 | + no_message then success(unique), | ||
| 53 | + message then | ||
| 54 | + if generate_type_message_description(strm, ds_type) is { failure then failure, success(_) then | ||
| 55 | + if generate_type_to_message(strm, ds_type) is { failure then failure, success(_) then | ||
| 56 | + if generate_type_from_message(strm, ds_type) is { failure then failure, success(_) then | ||
| 57 | + success(unique)}}} | ||
| 58 | + }}} | ||
| 55 | } | 59 | } |
| 56 | . | 60 | . |
| 57 | 61 | ||
| @@ -61,7 +65,7 @@ public define One | @@ -61,7 +65,7 @@ public define One | ||
| 61 | List(DS_Type) types, | 65 | List(DS_Type) types, |
| 62 | String destination_dir | 66 | String destination_dir |
| 63 | )= | 67 | )= |
| 64 | - map_forget((DS_Type type) |-> since type is ds_type(type_name, ds_alts), | 68 | + map_forget((DS_Type type) |-> since type is ds_type(type_name, _, ds_alts), |
| 65 | println("generating type file for Type ["+type_name+"]"); | 69 | println("generating type file for Type ["+type_name+"]"); |
| 66 | make_type_file(type, destination_dir), types) | 70 | make_type_file(type, destination_dir), types) |
| 67 | . | 71 | . |
src/generation/types_messages.anubis
| @@ -29,7 +29,7 @@ public define Maybe(One) | @@ -29,7 +29,7 @@ public define Maybe(One) | ||
| 29 | Stream stream, | 29 | Stream stream, |
| 30 | DS_Type ds_type //type description | 30 | DS_Type ds_type //type description |
| 31 | )= | 31 | )= |
| 32 | - since ds_type is ds_type(type_name, alternatives), | 32 | + since ds_type is ds_type(type_name, _, alternatives), |
| 33 | with title = type_name+" message format", | 33 | with title = type_name+" message format", |
| 34 | write_string(stream, | 34 | write_string(stream, |
| 35 | "\n"+ | 35 | "\n"+ |
| @@ -159,7 +159,7 @@ public define Maybe(One) | @@ -159,7 +159,7 @@ public define Maybe(One) | ||
| 159 | Stream stream, | 159 | Stream stream, |
| 160 | DS_Type ds_type //type description | 160 | DS_Type ds_type //type description |
| 161 | )= | 161 | )= |
| 162 | - since ds_type is ds_type(type_name, alternatives), | 162 | + since ds_type is ds_type(type_name, _, alternatives), |
| 163 | with lower_type_name = "_"+to_lower(type_name), | 163 | with lower_type_name = "_"+to_lower(type_name), |
| 164 | type_msg = lower_type_name+"_message", | 164 | type_msg = lower_type_name+"_message", |
| 165 | write_string(stream, | 165 | write_string(stream, |
| @@ -377,7 +377,7 @@ public define Maybe(One) | @@ -377,7 +377,7 @@ public define Maybe(One) | ||
| 377 | Stream stream, | 377 | Stream stream, |
| 378 | DS_Type ds_type //type description | 378 | DS_Type ds_type //type description |
| 379 | )= | 379 | )= |
| 380 | - since ds_type is ds_type(type_name, alternatives), | 380 | + since ds_type is ds_type(type_name, _, alternatives), |
| 381 | with lower_type_name = "_"+to_lower(type_name), | 381 | with lower_type_name = "_"+to_lower(type_name), |
| 382 | type_msg = lower_type_name+"_message", | 382 | type_msg = lower_type_name+"_message", |
| 383 | write_string(stream, | 383 | write_string(stream, |
src/main.anubis
| @@ -84,7 +84,21 @@ public define List(DS_Type) the_types_list = | @@ -84,7 +84,21 @@ public define List(DS_Type) the_types_list = | ||
| 84 | ds_type("HK_Icon", [ | 84 | ds_type("HK_Icon", [ |
| 85 | enum("no_icon"), | 85 | enum("no_icon"), |
| 86 | alternative("icon16", [component(string, "name")]) | 86 | alternative("icon16", [component(string, "name")]) |
| 87 | - ]), | 87 | + ]), |
| 88 | + | ||
| 89 | + ds_type("HK_Form", no_message, [ | ||
| 90 | + alternative("hk_form_in_list", [ | ||
| 91 | + component(string, "table_name", comment("database table name which belonging this form")), | ||
| 92 | + component(string, "view_name", comment("name of the view")), | ||
| 93 | + component(list, extern_type("HK_Form_Entry", "hk_form_entry.anubis"), "list"), | ||
| 94 | + component(list, extern_type("HK_Form_Tab", "hk_form_tab.anubis"), "tabs") | ||
| 95 | + ]), | ||
| 96 | + alternative("hk_form_in_table", [ | ||
| 97 | + component(string, "table_name", comment("database table name which belonging this form")), | ||
| 98 | + component(string, "view_name", comment("name of the view")), | ||
| 99 | + component(extern_type("HK_Form_Table", "hk_form_table.anubis"), "form_in_table") | ||
| 100 | + ]) | ||
| 101 | + ]) | ||
| 88 | ]. | 102 | ]. |
| 89 | 103 | ||
| 90 | 104 |
src/types_checking.anubis
| @@ -39,7 +39,7 @@ define Maybe(One) | @@ -39,7 +39,7 @@ define Maybe(One) | ||
| 39 | { | 39 | { |
| 40 | [] then return, | 40 | [] then return, |
| 41 | [h . t] then | 41 | [h . t] then |
| 42 | - since h is ds_type(type_name, tk_alts), | 42 | + since h is ds_type(type_name, _, tk_alts), |
| 43 | if is_upper_case_start(type_name) then | 43 | if is_upper_case_start(type_name) then |
| 44 | check_name(t, [], return) | 44 | check_name(t, [], return) |
| 45 | else | 45 | else |