Lines Matching refs:tok
221 mdoc_macros[n->tok].flags & MDOC_EXPLICIT) in mdoc_macroend()
223 n->line, n->pos, mdoc_macronames[n->tok]); in mdoc_macroend()
291 mdoc_body_alloc(mdoc, n->line, n->pos, n->tok); in rew_pending()
322 rew_alt(enum mdoct tok) in rew_alt() argument
324 switch (tok) { in rew_alt()
358 return(tok); in rew_alt()
364 rew_elem(struct mdoc *mdoc, enum mdoct tok) in rew_elem() argument
372 assert(tok == n->tok); in rew_elem()
409 mdoc->last->parent->tok != MDOC_Fd) in dword()
462 ntok = lookup(mdoc, tok, line, ppos, p); in macro_or_word()
465 dword(mdoc, line, ppos, p, DELIM_MAX, tok == MDOC_MAX || in macro_or_word()
466 mdoc_macros[tok].flags & MDOC_JOIN); in macro_or_word()
469 if (mdoc_macros[tok].fp == in_line_eoln) in macro_or_word()
470 rew_elem(mdoc, tok); in macro_or_word()
472 if (tok == MDOC_MAX) in macro_or_word()
497 switch (tok) { in blk_exp_close()
514 atok = rew_alt(tok); in blk_exp_close()
525 if (n->type == MDOC_BODY && atok == n->tok) { in blk_exp_close()
531 if (n->type != MDOC_BLOCK || n->tok == MDOC_Nm) in blk_exp_close()
534 if (n->tok == MDOC_It) { in blk_exp_close()
539 if (atok == n->tok) { in blk_exp_close()
549 (tok == MDOC_El && itblk == NULL)) in blk_exp_close()
563 mdoc_macronames[later->tok]); in blk_exp_close()
568 if (tok == MDOC_El) in blk_exp_close()
584 if (n->tok == MDOC_Nd) { in blk_exp_close()
598 line, ppos, mdoc_macronames[tok]); in blk_exp_close()
613 if ( ! (mdoc_macros[tok].flags & MDOC_PARSED)) { in blk_exp_close()
617 "%s %s", mdoc_macronames[tok], in blk_exp_close()
634 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in blk_exp_close()
639 lookup(mdoc, tok, line, lastarg, p); in blk_exp_close()
643 MDOC_JOIN & mdoc_macros[tok].flags); in blk_exp_close()
679 switch (tok) { in in_line()
698 mdoc_argv(mdoc, line, tok, &arg, pos, buf); in in_line()
705 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in in_line()
727 if (cnt == 0 && (nc == 0 || tok == MDOC_An)) in in_line()
732 ntok = (ac == ARGS_QWORD || (tok == MDOC_Fn && !cnt)) ? in in_line()
733 MDOC_MAX : lookup(mdoc, tok, line, la, p); in in_line()
744 rew_elem(mdoc, tok); in in_line()
746 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line()
752 mdoc_macronames[tok]); in in_line()
776 (d == DELIM_MIDDLE && tok == MDOC_Fl)) && in in_line()
778 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line()
781 if (tok == MDOC_Nm) in in_line()
789 rew_elem(mdoc, tok); in in_line()
791 if (tok == MDOC_Fn) in in_line()
794 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line()
800 MDOC_JOIN & mdoc_macros[tok].flags); in in_line()
816 if (scope && tok == MDOC_Fl) { in in_line()
817 rew_elem(mdoc, tok); in in_line()
823 rew_elem(mdoc, tok); in in_line()
833 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line()
838 line, ppos, mdoc_macronames[tok]); in in_line()
859 if (buf[*pos] == '\0' && (tok == MDOC_Sh || tok == MDOC_Ss)) { in blk_full()
861 line, ppos, mdoc_macronames[tok]); in blk_full()
865 if ( ! (mdoc_macros[tok].flags & MDOC_EXPLICIT)) { in blk_full()
879 if (tok == MDOC_It && n->tok == MDOC_Bl) { in blk_full()
884 mdoc_macronames[blk->tok]); in blk_full()
890 if (mdoc_macros[n->tok].flags & MDOC_EXPLICIT) { in blk_full()
891 switch (tok) { in blk_full()
898 mdoc_macronames[tok], in blk_full()
899 mdoc_macronames[n->tok]); in blk_full()
915 if (tok != MDOC_Sh && (n->tok == MDOC_Sh || in blk_full()
916 (tok != MDOC_Ss && (n->tok == MDOC_Ss || in blk_full()
917 (tok != MDOC_It && n->tok == MDOC_It))))) in blk_full()
926 mdoc_macronames[blk->tok]); in blk_full()
938 if (tok == MDOC_It && (n == NULL || n->tok != MDOC_Bl)) { in blk_full()
956 mdoc_argv(mdoc, line, tok, &arg, pos, buf); in blk_full()
957 blk = mdoc_block_alloc(mdoc, line, ppos, tok, arg); in blk_full()
965 parsed = tok != MDOC_It || in blk_full()
966 mdoc->last->parent->tok != MDOC_Bl || in blk_full()
974 if (tok == MDOC_Nd) { in blk_full()
975 head = mdoc_head_alloc(mdoc, line, ppos, tok); in blk_full()
977 body = mdoc_body_alloc(mdoc, line, ppos, tok); in blk_full()
980 if (tok == MDOC_Bk) in blk_full()
987 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in blk_full()
1000 body = mdoc_body_alloc(mdoc, line, ppos, tok); in blk_full()
1003 if (tok == MDOC_Bd || tok == MDOC_Bk) { in blk_full()
1006 mdoc_macronames[tok], buf + la); in blk_full()
1009 if (tok == MDOC_Rs) { in blk_full()
1035 head = mdoc_head_alloc(mdoc, line, ppos, tok); in blk_full()
1047 body = mdoc_body_alloc(mdoc, line, ppos, tok); in blk_full()
1064 if (macro_or_word(mdoc, tok, line, la, pos, buf, parsed)) in blk_full()
1071 head = mdoc_head_alloc(mdoc, line, ppos, tok); in blk_full()
1072 if (nl && tok != MDOC_Bd && tok != MDOC_Bl && tok != MDOC_Rs) in blk_full()
1090 mdoc_macros[n->tok].flags & MDOC_EXPLICIT) { in blk_full()
1101 body = mdoc_body_alloc(mdoc, line, ppos, tok); in blk_full()
1131 blk = mdoc_block_alloc(mdoc, line, ppos, tok, NULL); in blk_part_imp()
1132 rew_last(mdoc, mdoc_head_alloc(mdoc, line, ppos, tok)); in blk_part_imp()
1142 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in blk_part_imp()
1153 body = mdoc_body_alloc(mdoc, line, ppos, tok); in blk_part_imp()
1155 if (macro_or_word(mdoc, tok, line, la, pos, buf, 1)) in blk_part_imp()
1159 body = mdoc_body_alloc(mdoc, line, ppos, tok); in blk_part_imp()
1175 mdoc_macros[n->tok].flags & MDOC_EXPLICIT) { in blk_part_imp()
1180 "%s breaks %s", mdoc_macronames[tok], in blk_part_imp()
1181 mdoc_macronames[n->tok]); in blk_part_imp()
1183 tok, body, ENDBODY_NOSPACE); in blk_part_imp()
1200 if (n && n->tok == MDOC_Ns) in blk_part_imp()
1220 mdoc_block_alloc(mdoc, line, ppos, tok, NULL); in blk_part_exp()
1224 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in blk_part_exp()
1237 head = mdoc_head_alloc(mdoc, line, ppos, tok); in blk_part_exp()
1238 if (tok == MDOC_Eo) /* Not parsed. */ in blk_part_exp()
1241 mdoc_body_alloc(mdoc, line, ppos, tok); in blk_part_exp()
1242 if (tok == MDOC_Eo) in blk_part_exp()
1246 if (macro_or_word(mdoc, tok, line, la, pos, buf, 1)) in blk_part_exp()
1253 rew_last(mdoc, mdoc_head_alloc(mdoc, line, ppos, tok)); in blk_part_exp()
1254 mdoc_body_alloc(mdoc, line, ppos, tok); in blk_part_exp()
1280 switch (tok) { in in_line_argn()
1300 mdoc_argv(mdoc, line, tok, &arg, pos, buf); in in_line_argn()
1306 ac = mdoc_args(mdoc, line, pos, buf, tok, &p); in in_line_argn()
1309 ! (mdoc_macros[tok].flags & MDOC_IGNDELIM) && in in_line_argn()
1315 if (state == -1 && tok != MDOC_In && in in_line_argn()
1316 tok != MDOC_St && tok != MDOC_Xr) { in in_line_argn()
1317 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line_argn()
1322 if (abs(state) < 2 && tok == MDOC_Pf) in in_line_argn()
1330 rew_elem(mdoc, tok); in in_line_argn()
1334 ntok = (ac == ARGS_QWORD || (tok == MDOC_Pf && state == 0)) ? in in_line_argn()
1335 MDOC_MAX : lookup(mdoc, tok, line, la, p); in in_line_argn()
1339 rew_elem(mdoc, tok); in in_line_argn()
1347 mdoc_macros[tok].flags & MDOC_IGNDELIM || in in_line_argn()
1350 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line_argn()
1355 rew_elem(mdoc, tok); in in_line_argn()
1360 MDOC_JOIN & mdoc_macros[tok].flags); in in_line_argn()
1365 line, ppos, mdoc_macronames[tok]); in in_line_argn()
1369 if (state == 0 && tok == MDOC_Pf) in in_line_argn()
1372 rew_elem(mdoc, tok); in in_line_argn()
1383 if ((tok == MDOC_Pp || tok == MDOC_Lp) && in in_line_eoln()
1388 if (n->tok == MDOC_Nm) in in_line_eoln()
1393 (tok == MDOC_Fd || mdoc_macronames[tok][0] == '%')) { in in_line_eoln()
1395 line, ppos, mdoc_macronames[tok]); in in_line_eoln()
1399 mdoc_argv(mdoc, line, tok, &arg, pos, buf); in in_line_eoln()
1400 mdoc_elem_alloc(mdoc, line, ppos, tok, arg); in in_line_eoln()
1401 if (parse_rest(mdoc, tok, line, pos, buf)) in in_line_eoln()
1403 rew_elem(mdoc, tok); in in_line_eoln()
1412 parse_rest(struct mdoc *mdoc, enum mdoct tok, int line, int *pos, char *buf) in parse_rest() argument
1418 if (mdoc_args(mdoc, line, pos, buf, tok, NULL) == ARGS_EOLN) in parse_rest()
1420 if (macro_or_word(mdoc, tok, line, la, pos, buf, 1)) in parse_rest()
1430 in_line(mdoc, tok, line, ppos, pos, buf); in ctx_synopsis()
1431 else if (tok == MDOC_Nm) in ctx_synopsis()
1432 blk_full(mdoc, tok, line, ppos, pos, buf); in ctx_synopsis()
1434 assert(tok == MDOC_Vt); in ctx_synopsis()
1435 blk_part_imp(mdoc, tok, line, ppos, pos, buf); in ctx_synopsis()
1455 if (n->tok == MDOC_It && n->type == MDOC_BODY) in phrase_ta()
1457 if (n->tok == MDOC_Bl) in phrase_ta()