The name of `class Name~T~["Label"] {`, its label in *label. */
| 775 | |
| 776 | /* The name of `class Name~T~["Label"] {`, its label in *label. */ |
| 777 | static dg_str_t dg_class_decl(dg_str_t rest, dg_str_t *label) { |
| 778 | size_t j = 0; |
| 779 | while (j < rest.n && (dg_id_char(rest.p[j]) || rest.p[j] == '.')) { |
| 780 | j++; |
| 781 | } |
| 782 | dg_str_t name = dg_s(rest.p, j); |
| 783 | *label = dg_s(NULL, 0); |
| 784 | const char *lb = memchr(rest.p + j, '[', rest.n - j); |
| 785 | const char *rb = lb ? memchr(lb, ']', (size_t)(rest.p + rest.n - lb)) : NULL; |
| 786 | if (lb && rb) { |
| 787 | *label = dg_s(lb + SKIP_ONE, (size_t)(rb - lb) - SKIP_ONE); |
| 788 | } |
| 789 | return name; |
| 790 | } |
| 791 | |
| 792 | static void dg_classdiagram(dg_t *dg, dg_lines_t *it) { |
| 793 | dg_str_t ln; |
no test coverage detected