Lines Matching refs:tok

206 mdoc_macro(enum roff_tok tok)  in mdoc_macro()  argument
208 assert(tok >= MDOC_Dd && tok < MDOC_MAX); in mdoc_macro()
209 return mdoc_macros + (tok - MDOC_Dd); in mdoc_macro()
229 mdoc_macro(n->tok)->flags & MDOC_EXPLICIT) in mdoc_endparse()
231 n->line, n->pos, "%s", roff_name[n->tok]); in mdoc_endparse()
296 n->tok); in rew_pending()
297 if (n->tok == MDOC_Ss) in rew_pending()
330 rew_alt(enum roff_tok tok) in rew_alt() argument
332 switch (tok) { in rew_alt()
366 return tok; in rew_alt()
371 rew_elem(struct roff_man *mdoc, enum roff_tok tok) in rew_elem() argument
379 assert(tok == n->tok); in rew_elem()
403 find_pending(struct roff_man *mdoc, enum roff_tok tok, int line, int ppos, in find_pending() argument
417 mdoc_macro(n->tok)->flags & MDOC_EXPLICIT) { in find_pending()
425 roff_name[tok], roff_name[n->tok]); in find_pending()
427 tok, target); in find_pending()
467 mdoc->last->parent->tok != MDOC_Fd) in dword()
520 lookup(mdoc, tok, line, ppos, p); in macro_or_word()
523 dword(mdoc, line, ppos, p, DELIM_MAX, tok == TOKEN_NONE || in macro_or_word()
524 mdoc_macro(tok)->flags & MDOC_JOIN); in macro_or_word()
527 if (tok != TOKEN_NONE && in macro_or_word()
528 mdoc_macro(tok)->fp == in_line_eoln) in macro_or_word()
529 rew_elem(mdoc, tok); in macro_or_word()
531 if (tok == TOKEN_NONE) in macro_or_word()
557 switch (tok) { in blk_exp_close()
571 atok = rew_alt(tok); in blk_exp_close()
574 if (n->flags & NODE_ENDED || n->tok != atok || in blk_exp_close()
604 if (n->tok == MDOC_Nm) { in blk_exp_close()
610 if (n->tok == MDOC_It) { in blk_exp_close()
615 if (atok == n->tok) { in blk_exp_close()
624 (tok == MDOC_El && itblk == NULL)) in blk_exp_close()
637 roff_name[atok], roff_name[later->tok]); in blk_exp_close()
642 if (tok == MDOC_El) in blk_exp_close()
661 if (n->tok == MDOC_Nd) { in blk_exp_close()
679 "%s", roff_name[tok]); in blk_exp_close()
694 if ((mdoc_macro(tok)->flags & MDOC_PARSED) == 0) { in blk_exp_close()
697 "%s %s", roff_name[tok], buf + *pos); in blk_exp_close()
707 if (tok == MDOC_Ed && body != NULL) { in blk_exp_close()
726 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in blk_exp_close()
730 ntok = lookup(mdoc, tok, line, lastarg, p); in blk_exp_close()
734 mdoc_macro(tok)->flags & MDOC_JOIN); in blk_exp_close()
782 switch (tok) { in in_line()
796 mdoc_argv(mdoc, line, tok, &arg, pos, buf); in in_line()
803 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in in_line()
825 if (cnt == 0 && (nc == 0 || tok == MDOC_An)) in in_line()
830 ntok = (tok == MDOC_Fn && !cnt) ? in in_line()
831 TOKEN_NONE : lookup(mdoc, tok, line, la, p); in in_line()
842 rew_elem(mdoc, tok); in in_line()
844 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line()
849 line, ppos, "%s", roff_name[tok]); in in_line()
873 (d == DELIM_MIDDLE && tok == MDOC_Fl)) && in in_line()
875 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line()
878 if (tok == MDOC_Nm) in in_line()
885 if (scope && tok != MDOC_Lk) { in in_line()
886 rew_elem(mdoc, tok); in in_line()
888 if (tok == MDOC_Fn) in in_line()
892 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line()
898 mdoc_macro(tok)->flags & MDOC_JOIN); in in_line()
917 if (scope && tok == MDOC_Fl) { in in_line()
918 rew_elem(mdoc, tok); in in_line()
923 if (scope && tok != MDOC_Lk) { in in_line()
924 rew_elem(mdoc, tok); in in_line()
936 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line()
941 line, ppos, "%s", roff_name[tok]); in in_line()
947 rew_elem(mdoc, tok); in in_line()
965 if (buf[*pos] == '\0' && (tok == MDOC_Sh || tok == MDOC_Ss)) { in blk_full()
967 line, ppos, "%s", roff_name[tok]); in blk_full()
971 if ((mdoc_macro(tok)->flags & MDOC_EXPLICIT) == 0) { in blk_full()
985 if (tok == MDOC_It && n->tok == MDOC_Bl) { in blk_full()
989 roff_name[blk->tok]); in blk_full()
995 if (mdoc_macro(n->tok)->flags & MDOC_EXPLICIT) { in blk_full()
996 switch (tok) { in blk_full()
1001 "%s breaks %s", roff_name[tok], in blk_full()
1002 roff_name[n->tok]); in blk_full()
1018 if (tok != MDOC_Sh && (n->tok == MDOC_Sh || in blk_full()
1019 (tok != MDOC_Ss && (n->tok == MDOC_Ss || in blk_full()
1020 (tok != MDOC_It && n->tok == MDOC_It))))) in blk_full()
1027 "It breaks %s", roff_name[blk->tok]); in blk_full()
1039 if (tok == MDOC_It && (n == NULL || n->tok != MDOC_Bl)) { in blk_full()
1057 switch (tok) { in blk_full()
1067 mdoc_argv(mdoc, line, tok, &arg, pos, buf); in blk_full()
1068 blk = mdoc_block_alloc(mdoc, line, ppos, tok, arg); in blk_full()
1076 parsed = tok != MDOC_It || in blk_full()
1077 mdoc->last->parent->tok != MDOC_Bl || in blk_full()
1085 if (tok == MDOC_Nd) { in blk_full()
1086 head = roff_head_alloc(mdoc, line, ppos, tok); in blk_full()
1088 body = roff_body_alloc(mdoc, line, ppos, tok); in blk_full()
1091 if (tok == MDOC_Bk) in blk_full()
1109 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in blk_full()
1122 body = roff_body_alloc(mdoc, line, ppos, tok); in blk_full()
1127 if (tok == MDOC_Bd || tok == MDOC_Bk) { in blk_full()
1129 "%s ... %s", roff_name[tok], buf + la); in blk_full()
1134 if (tok == MDOC_Rs) { in blk_full()
1161 head = roff_head_alloc(mdoc, line, ppos, tok); in blk_full()
1171 body = roff_body_alloc(mdoc, line, ppos, tok); in blk_full()
1186 done = macro_or_word(mdoc, tok, line, la, pos, buf, p, parsed); in blk_full()
1196 head = roff_head_alloc(mdoc, line, ppos, tok); in blk_full()
1197 if (nl && tok != MDOC_Bd && tok != MDOC_Bl && tok != MDOC_Rs) in blk_full()
1201 if (find_pending(mdoc, tok, line, ppos, head)) in blk_full()
1207 body = roff_body_alloc(mdoc, line, ppos, tok); in blk_full()
1208 if (tok == MDOC_Ss) in blk_full()
1217 if (tok == MDOC_Bd && arg != NULL) { in blk_full()
1264 blk = mdoc_block_alloc(mdoc, line, ppos, tok, NULL); in blk_part_imp()
1265 rew_last(mdoc, roff_head_alloc(mdoc, line, ppos, tok)); in blk_part_imp()
1275 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in blk_part_imp()
1287 body = roff_body_alloc(mdoc, line, ppos, tok); in blk_part_imp()
1289 done = macro_or_word(mdoc, tok, line, la, pos, buf, p, 1); in blk_part_imp()
1296 body = roff_body_alloc(mdoc, line, ppos, tok); in blk_part_imp()
1298 if (find_pending(mdoc, tok, line, ppos, body)) in blk_part_imp()
1310 if (n && n->tok == MDOC_Ns) in blk_part_imp()
1330 roff_block_alloc(mdoc, line, ppos, tok); in blk_part_exp()
1334 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in blk_part_exp()
1348 head = roff_head_alloc(mdoc, line, ppos, tok); in blk_part_exp()
1349 if (tok == MDOC_Eo) /* Not parsed. */ in blk_part_exp()
1352 roff_body_alloc(mdoc, line, ppos, tok); in blk_part_exp()
1353 if (tok == MDOC_Eo) { in blk_part_exp()
1360 done = macro_or_word(mdoc, tok, line, la, pos, buf, p, 1); in blk_part_exp()
1370 rew_last(mdoc, roff_head_alloc(mdoc, line, ppos, tok)); in blk_part_exp()
1371 roff_body_alloc(mdoc, line, ppos, tok); in blk_part_exp()
1397 switch (tok) { in in_line_argn()
1413 mdoc_argv(mdoc, line, tok, &arg, pos, buf); in in_line_argn()
1419 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in in_line_argn()
1422 (mdoc_macro(tok)->flags & MDOC_IGNDELIM) == 0 && in in_line_argn()
1430 if (state == -1 && tok != MDOC_In && in in_line_argn()
1431 tok != MDOC_St && tok != MDOC_Xr) { in in_line_argn()
1432 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line_argn()
1437 if (abs(state) < 2 && tok == MDOC_Pf) in in_line_argn()
1445 rew_elem(mdoc, tok); in in_line_argn()
1449 ntok = (tok == MDOC_Pf && state == 0) ? in in_line_argn()
1450 TOKEN_NONE : lookup(mdoc, tok, line, la, p); in in_line_argn()
1454 rew_elem(mdoc, tok); in in_line_argn()
1464 if (mdoc_macro(tok)->flags & MDOC_IGNDELIM || in in_line_argn()
1467 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line_argn()
1472 rew_elem(mdoc, tok); in in_line_argn()
1477 mdoc_macro(tok)->flags & MDOC_JOIN); in in_line_argn()
1485 line, ppos, "%s", roff_name[tok]); in in_line_argn()
1489 if (state == 0 && tok == MDOC_Pf) in in_line_argn()
1492 rew_elem(mdoc, tok); in in_line_argn()
1503 if ((tok == MDOC_Pp || tok == MDOC_Lp) && in in_line_eoln()
1508 if (n->tok == MDOC_Nm) in in_line_eoln()
1513 (tok == MDOC_Fd || *roff_name[tok] == '%')) { in in_line_eoln()
1515 line, ppos, "%s", roff_name[tok]); in in_line_eoln()
1519 mdoc_argv(mdoc, line, tok, &arg, pos, buf); in in_line_eoln()
1520 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line_eoln()
1521 if (parse_rest(mdoc, tok, line, pos, buf)) in in_line_eoln()
1523 rew_elem(mdoc, tok); in in_line_eoln()
1532 parse_rest(struct roff_man *mdoc, enum roff_tok tok, in parse_rest() argument
1541 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in parse_rest()
1544 done = macro_or_word(mdoc, tok, line, la, pos, buf, p, 1); in parse_rest()
1557 in_line(mdoc, tok, line, ppos, pos, buf); in ctx_synopsis()
1558 else if (tok == MDOC_Nm) in ctx_synopsis()
1559 blk_full(mdoc, tok, line, ppos, pos, buf); in ctx_synopsis()
1561 assert(tok == MDOC_Vt); in ctx_synopsis()
1562 blk_part_imp(mdoc, tok, line, ppos, pos, buf); in ctx_synopsis()
1582 if (n->tok == MDOC_It && n->type == ROFFT_BODY) in phrase_ta()
1584 if (n->tok == MDOC_Bl && n->end == ENDBODY_NOT) in phrase_ta()