| 168 | } |
| 169 | |
| 170 | static void emit_method(UdlBuf *b, const char *ms, const char *me) { |
| 171 | char mn[MAX_NAME]; |
| 172 | extract_attr(ms, me, "name", mn, sizeof(mn)); |
| 173 | if (!mn[0]) |
| 174 | return; |
| 175 | bool cm = tag_is_one(ms, me, "ClassMethod"); |
| 176 | char formal[1024] = ""; |
| 177 | elem_content(ms, me, "FormalSpec", formal, sizeof(formal)); |
| 178 | char ret[MAX_NAME] = ""; |
| 179 | elem_content(ms, me, "ReturnType", ret, sizeof(ret)); |
| 180 | char desc[4096] = ""; |
| 181 | elem_content(ms, me, "Description", desc, sizeof(desc)); |
| 182 | if (desc[0]) { |
| 183 | ub_app(b, "/// "); |
| 184 | for (char *c = desc; *c; c++) { |
| 185 | if (*c == '\n') |
| 186 | ub_app(b, "\n/// "); |
| 187 | else { |
| 188 | char t[2] = {*c, 0}; |
| 189 | ub_app(b, t); |
| 190 | } |
| 191 | } |
| 192 | ub_app(b, "\n"); |
| 193 | } |
| 194 | ub_app(b, cm ? "ClassMethod " : "Method "); |
| 195 | ub_app(b, mn); |
| 196 | ub_app(b, "("); |
| 197 | ub_app(b, formal); |
| 198 | ub_app(b, ")"); |
| 199 | if (ret[0]) { |
| 200 | ub_app(b, " As "); |
| 201 | ub_app(b, ret); |
| 202 | } |
| 203 | ub_app(b, "\n{\n"); |
| 204 | char impl[1024 * 32] = ""; |
| 205 | elem_content(ms, me, "Implementation", impl, sizeof(impl)); |
| 206 | ub_app(b, impl); |
| 207 | ub_app(b, "}\n\n"); |
| 208 | } |
| 209 | |
| 210 | static void emit_property(UdlBuf *b, const char *ps, const char *pe) { |
| 211 | char pn[MAX_NAME]; |
no test coverage detected