... and code ... of one line; true when the line holds one. */
| 281 | |
| 282 | /* {@link ...} and {@linkcode ...} of one line; true when the line holds one. */ |
| 283 | static bool ts_line_inline(const ts_emit_t *em, const ts_line_t *ln, const bool *mask) { |
| 284 | bool any = false; |
| 285 | static const char open[] = "{@link"; |
| 286 | size_t ol = sizeof(open) - SKIP_ONE; |
| 287 | for (size_t i = 0; i + ol <= ln->n; i++) { |
| 288 | if (mask[i] || memcmp(ln->p + i, open, ol) != 0) { |
| 289 | continue; |
| 290 | } |
| 291 | size_t j = i + ol; |
| 292 | int syntax = CBM_DOCLINK_TS_LINK; |
| 293 | if (j + CBM_SZ_4 <= ln->n && memcmp(ln->p + j, "code", CBM_SZ_4) == 0) { |
| 294 | syntax = CBM_DOCLINK_TS_LINKCODE; |
| 295 | j += CBM_SZ_4; |
| 296 | } |
| 297 | if (j < ln->n && ln->p[j] != '}' && !isspace((unsigned char)ln->p[j])) { |
| 298 | continue; /* {@linkplain} or another word */ |
| 299 | } |
| 300 | any = true; |
| 301 | j = ts_skip_space(ln->p, j, ln->n); |
| 302 | ts_push(em, ln->p + j, ts_ref_len(ln->p + j, ln->n - j), syntax, ln->line); |
| 303 | i = j; |
| 304 | } |
| 305 | return any; |
| 306 | } |
| 307 | |
| 308 | /* `@see Ref` at the start of a tag line. */ |
| 309 | static void ts_line_see(const ts_emit_t *em, const ts_line_t *ln) { |
no test coverage detected