Lines Matching refs:tok

208 mdoc_macro(enum roff_tok tok)  in mdoc_macro()  argument
210 assert(tok >= MDOC_Dd && tok < MDOC_MAX); in mdoc_macro()
211 return mdoc_macros + (tok - MDOC_Dd); in mdoc_macro()
231 mdoc_macro(n->tok)->flags & MDOC_EXPLICIT) in mdoc_endparse()
233 n->line, n->pos, "%s", roff_name[n->tok]); in mdoc_endparse()
298 n->tok); in rew_pending()
299 if (n->tok == MDOC_Ss) in rew_pending()
332 rew_alt(enum roff_tok tok) in rew_alt() argument
334 switch (tok) { in rew_alt()
368 return tok; in rew_alt()
373 rew_elem(struct roff_man *mdoc, enum roff_tok tok) in rew_elem() argument
381 assert(tok == n->tok); in rew_elem()
405 find_pending(struct roff_man *mdoc, enum roff_tok tok, int line, int ppos, in find_pending() argument
419 mdoc_macro(n->tok)->flags & MDOC_EXPLICIT) { in find_pending()
427 roff_name[tok], roff_name[n->tok]); in find_pending()
429 tok, target); in find_pending()
469 mdoc->last->parent->tok != MDOC_Fd) in dword()
522 lookup(mdoc, tok, line, ppos, p); in macro_or_word()
525 dword(mdoc, line, ppos, p, DELIM_MAX, tok == TOKEN_NONE || in macro_or_word()
526 mdoc_macro(tok)->flags & MDOC_JOIN); in macro_or_word()
529 if (tok != TOKEN_NONE && in macro_or_word()
530 mdoc_macro(tok)->fp == in_line_eoln) in macro_or_word()
531 rew_elem(mdoc, tok); in macro_or_word()
533 if (tok == TOKEN_NONE) in macro_or_word()
559 switch (tok) { in blk_exp_close()
573 atok = rew_alt(tok); in blk_exp_close()
576 if (n->flags & NODE_ENDED || n->tok != atok || in blk_exp_close()
606 if (n->tok == MDOC_Nm) { in blk_exp_close()
612 if (n->tok == MDOC_It) { in blk_exp_close()
617 if (atok == n->tok) { in blk_exp_close()
626 (tok == MDOC_El && itblk == NULL)) in blk_exp_close()
639 roff_name[atok], roff_name[later->tok]); in blk_exp_close()
644 if (tok == MDOC_El) in blk_exp_close()
663 if (n->tok == MDOC_Nd) { in blk_exp_close()
681 "%s", roff_name[tok]); in blk_exp_close()
696 if ((mdoc_macro(tok)->flags & MDOC_PARSED) == 0) { in blk_exp_close()
699 "%s %s", roff_name[tok], buf + *pos); in blk_exp_close()
709 if (tok == MDOC_Ed && body != NULL) { in blk_exp_close()
728 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in blk_exp_close()
732 ntok = lookup(mdoc, tok, line, lastarg, p); in blk_exp_close()
736 mdoc_macro(tok)->flags & MDOC_JOIN); in blk_exp_close()
784 switch (tok) { in in_line()
798 mdoc_argv(mdoc, line, tok, &arg, pos, buf); in in_line()
805 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in in_line()
827 if (cnt == 0 && (nc == 0 || tok == MDOC_An)) in in_line()
832 ntok = (tok == MDOC_Fn && !cnt) ? in in_line()
833 TOKEN_NONE : lookup(mdoc, tok, line, la, p); in in_line()
844 rew_elem(mdoc, tok); in in_line()
846 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line()
851 line, ppos, "%s", roff_name[tok]); in in_line()
875 (d == DELIM_MIDDLE && tok == MDOC_Fl)) && in in_line()
877 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line()
880 if (tok == MDOC_Nm) in in_line()
887 if (scope && tok != MDOC_Lk) { in in_line()
888 rew_elem(mdoc, tok); in in_line()
890 if (tok == MDOC_Fn) in in_line()
894 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line()
900 mdoc_macro(tok)->flags & MDOC_JOIN); in in_line()
919 if (scope && tok == MDOC_Fl) { in in_line()
920 rew_elem(mdoc, tok); in in_line()
925 if (scope && tok != MDOC_Lk) { in in_line()
926 rew_elem(mdoc, tok); in in_line()
938 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line()
943 line, ppos, "%s", roff_name[tok]); in in_line()
949 rew_elem(mdoc, tok); in in_line()
967 if (buf[*pos] == '\0' && (tok == MDOC_Sh || tok == MDOC_Ss)) { in blk_full()
969 line, ppos, "%s", roff_name[tok]); in blk_full()
973 if ((mdoc_macro(tok)->flags & MDOC_EXPLICIT) == 0) { in blk_full()
987 if (tok == MDOC_It && n->tok == MDOC_Bl) { in blk_full()
991 roff_name[blk->tok]); in blk_full()
997 if (mdoc_macro(n->tok)->flags & MDOC_EXPLICIT) { in blk_full()
998 switch (tok) { in blk_full()
1003 "%s breaks %s", roff_name[tok], in blk_full()
1004 roff_name[n->tok]); in blk_full()
1020 if (tok != MDOC_Sh && (n->tok == MDOC_Sh || in blk_full()
1021 (tok != MDOC_Ss && (n->tok == MDOC_Ss || in blk_full()
1022 (tok != MDOC_It && n->tok == MDOC_It))))) in blk_full()
1029 "It breaks %s", roff_name[blk->tok]); in blk_full()
1041 if (tok == MDOC_It && (n == NULL || n->tok != MDOC_Bl)) { in blk_full()
1059 switch (tok) { in blk_full()
1069 mdoc_argv(mdoc, line, tok, &arg, pos, buf); in blk_full()
1070 blk = mdoc_block_alloc(mdoc, line, ppos, tok, arg); in blk_full()
1078 parsed = tok != MDOC_It || in blk_full()
1079 mdoc->last->parent->tok != MDOC_Bl || in blk_full()
1087 if (tok == MDOC_Nd) { in blk_full()
1088 head = roff_head_alloc(mdoc, line, ppos, tok); in blk_full()
1090 body = roff_body_alloc(mdoc, line, ppos, tok); in blk_full()
1093 if (tok == MDOC_Bk) in blk_full()
1111 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in blk_full()
1124 body = roff_body_alloc(mdoc, line, ppos, tok); in blk_full()
1129 if (tok == MDOC_Bd || tok == MDOC_Bk) { in blk_full()
1131 "%s ... %s", roff_name[tok], buf + la); in blk_full()
1136 if (tok == MDOC_Rs) { in blk_full()
1163 head = roff_head_alloc(mdoc, line, ppos, tok); in blk_full()
1173 body = roff_body_alloc(mdoc, line, ppos, tok); in blk_full()
1188 done = macro_or_word(mdoc, tok, line, la, pos, buf, p, parsed); in blk_full()
1198 head = roff_head_alloc(mdoc, line, ppos, tok); in blk_full()
1199 if (nl && tok != MDOC_Bd && tok != MDOC_Bl && tok != MDOC_Rs) in blk_full()
1203 if (find_pending(mdoc, tok, line, ppos, head)) in blk_full()
1209 body = roff_body_alloc(mdoc, line, ppos, tok); in blk_full()
1210 if (tok == MDOC_Ss) in blk_full()
1219 if (tok == MDOC_Bd && arg != NULL) { in blk_full()
1266 blk = mdoc_block_alloc(mdoc, line, ppos, tok, NULL); in blk_part_imp()
1267 rew_last(mdoc, roff_head_alloc(mdoc, line, ppos, tok)); in blk_part_imp()
1277 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in blk_part_imp()
1289 body = roff_body_alloc(mdoc, line, ppos, tok); in blk_part_imp()
1291 done = macro_or_word(mdoc, tok, line, la, pos, buf, p, 1); in blk_part_imp()
1298 body = roff_body_alloc(mdoc, line, ppos, tok); in blk_part_imp()
1300 if (find_pending(mdoc, tok, line, ppos, body)) in blk_part_imp()
1312 if (n && n->tok == MDOC_Ns) in blk_part_imp()
1332 roff_block_alloc(mdoc, line, ppos, tok); in blk_part_exp()
1336 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in blk_part_exp()
1350 head = roff_head_alloc(mdoc, line, ppos, tok); in blk_part_exp()
1351 if (tok == MDOC_Eo) /* Not parsed. */ in blk_part_exp()
1354 roff_body_alloc(mdoc, line, ppos, tok); in blk_part_exp()
1355 if (tok == MDOC_Eo) { in blk_part_exp()
1362 done = macro_or_word(mdoc, tok, line, la, pos, buf, p, 1); in blk_part_exp()
1372 rew_last(mdoc, roff_head_alloc(mdoc, line, ppos, tok)); in blk_part_exp()
1373 roff_body_alloc(mdoc, line, ppos, tok); in blk_part_exp()
1399 switch (tok) { in in_line_argn()
1415 mdoc_argv(mdoc, line, tok, &arg, pos, buf); in in_line_argn()
1421 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in in_line_argn()
1424 (mdoc_macro(tok)->flags & MDOC_IGNDELIM) == 0 && in in_line_argn()
1432 if (state == -1 && tok != MDOC_In && in in_line_argn()
1433 tok != MDOC_St && tok != MDOC_Xr) { in in_line_argn()
1434 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line_argn()
1439 if (abs(state) < 2 && tok == MDOC_Pf) in in_line_argn()
1447 rew_elem(mdoc, tok); in in_line_argn()
1451 ntok = (tok == MDOC_Pf && state == 0) ? in in_line_argn()
1452 TOKEN_NONE : lookup(mdoc, tok, line, la, p); in in_line_argn()
1456 rew_elem(mdoc, tok); in in_line_argn()
1466 if (mdoc_macro(tok)->flags & MDOC_IGNDELIM || in in_line_argn()
1469 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line_argn()
1474 rew_elem(mdoc, tok); in in_line_argn()
1479 mdoc_macro(tok)->flags & MDOC_JOIN); in in_line_argn()
1487 line, ppos, "%s", roff_name[tok]); in in_line_argn()
1491 if (state == 0 && tok == MDOC_Pf) in in_line_argn()
1494 rew_elem(mdoc, tok); in in_line_argn()
1505 if ((tok == MDOC_Pp || tok == MDOC_Lp) && in in_line_eoln()
1510 if (n->tok == MDOC_Nm) in in_line_eoln()
1515 (tok == MDOC_Fd || *roff_name[tok] == '%')) { in in_line_eoln()
1517 line, ppos, "%s", roff_name[tok]); in in_line_eoln()
1521 mdoc_argv(mdoc, line, tok, &arg, pos, buf); in in_line_eoln()
1522 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line_eoln()
1523 if (parse_rest(mdoc, tok, line, pos, buf)) in in_line_eoln()
1525 rew_elem(mdoc, tok); in in_line_eoln()
1534 parse_rest(struct roff_man *mdoc, enum roff_tok tok, in parse_rest() argument
1543 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in parse_rest()
1546 done = macro_or_word(mdoc, tok, line, la, pos, buf, p, 1); in parse_rest()
1559 in_line(mdoc, tok, line, ppos, pos, buf); in ctx_synopsis()
1560 else if (tok == MDOC_Nm) in ctx_synopsis()
1561 blk_full(mdoc, tok, line, ppos, pos, buf); in ctx_synopsis()
1563 assert(tok == MDOC_Vt); in ctx_synopsis()
1564 blk_part_imp(mdoc, tok, line, ppos, pos, buf); in ctx_synopsis()
1584 if (n->tok == MDOC_It && n->type == ROFFT_BODY) in phrase_ta()
1586 if (n->tok == MDOC_Bl && n->end == ENDBODY_NOT) in phrase_ta()