Commit f9e530094fb44a5cb75bf2ea9fac0b78cfea3cf9

Authored by totoro
1 parent e0ffd963

manage the option of not generation Muscle message

densaku_lib @ aaa50241ac1
1   -Subproject commit e7fa05a251e0fe746b9524e94b42b5093c4714bf
  1 +Subproject commit aaa50241ac140b5441e8cfb34bd4e884a4828af7
... ...
src/generation/types.anubis
... ... @@ -33,7 +33,7 @@ define Maybe(One)
33 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 37 println("Generating file for type ["+name+"]");
38 38 with file_name = dest_dir+"types/generated/"+to_lower(name)+".anubis",
39 39  
... ... @@ -47,11 +47,15 @@ define Maybe(One)
47 47 with strm = make_stream(fd),
48 48 if generate_type_header(strm, ds_type) is { failure then failure, success(_) then
49 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 65 List(DS_Type) types,
62 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 69 println("generating type file for Type ["+type_name+"]");
66 70 make_type_file(type, destination_dir), types)
67 71 .
... ...
src/generation/types_messages.anubis
... ... @@ -29,7 +29,7 @@ public define Maybe(One)
29 29 Stream stream,
30 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 33 with title = type_name+" message format",
34 34 write_string(stream,
35 35 "\n"+
... ... @@ -159,7 +159,7 @@ public define Maybe(One)
159 159 Stream stream,
160 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 163 with lower_type_name = "_"+to_lower(type_name),
164 164 type_msg = lower_type_name+"_message",
165 165 write_string(stream,
... ... @@ -377,7 +377,7 @@ public define Maybe(One)
377 377 Stream stream,
378 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 381 with lower_type_name = "_"+to_lower(type_name),
382 382 type_msg = lower_type_name+"_message",
383 383 write_string(stream,
... ...
src/main.anubis
... ... @@ -84,7 +84,21 @@ public define List(DS_Type) the_types_list =
84 84 ds_type("HK_Icon", [
85 85 enum("no_icon"),
86 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 39 {
40 40 [] then return,
41 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 43 if is_upper_case_start(type_name) then
44 44 check_name(t, [], return)
45 45 else
... ...