version 1.79, 2010/05/31 23:49:16 |
version 1.81, 2010/06/26 16:07:08 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> |
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
Line 50 static int append_delims(struct mdoc *, |
|
Line 50 static int append_delims(struct mdoc *, |
|
int, int *, char *); |
int, int *, char *); |
static enum mdoct lookup(enum mdoct, const char *); |
static enum mdoct lookup(enum mdoct, const char *); |
static enum mdoct lookup_raw(const char *); |
static enum mdoct lookup_raw(const char *); |
static int phrase(struct mdoc *, int, int, char *); |
static int phrase(struct mdoc *, |
|
const struct regset *, |
|
int, int, char *); |
static enum mdoct rew_alt(enum mdoct); |
static enum mdoct rew_alt(enum mdoct); |
static int rew_dobreak(enum mdoct, |
static int rew_dobreak(enum mdoct, |
const struct mdoc_node *); |
const struct mdoc_node *); |
Line 739 blk_exp_close(MACRO_PROT_ARGS) |
|
Line 741 blk_exp_close(MACRO_PROT_ARGS) |
|
return(0); |
return(0); |
flushed = 1; |
flushed = 1; |
} |
} |
if ( ! mdoc_macro(m, ntok, line, lastarg, pos, buf)) |
if ( ! mdoc_macro(m, regs, ntok, line, lastarg, pos, buf)) |
return(0); |
return(0); |
break; |
break; |
} |
} |
Line 840 in_line(MACRO_PROT_ARGS) |
|
Line 842 in_line(MACRO_PROT_ARGS) |
|
if ( ! mdoc_pmsg(m, line, ppos, MANDOCERR_MACROEMPTY)) |
if ( ! mdoc_pmsg(m, line, ppos, MANDOCERR_MACROEMPTY)) |
return(0); |
return(0); |
} |
} |
if ( ! mdoc_macro(m, ntok, line, la, pos, buf)) |
if ( ! mdoc_macro(m, regs, ntok, line, la, pos, buf)) |
return(0); |
return(0); |
if ( ! nl) |
if ( ! nl) |
return(1); |
return(1); |
Line 1086 blk_full(MACRO_PROT_ARGS) |
|
Line 1088 blk_full(MACRO_PROT_ARGS) |
|
if (ARGS_PEND == ac && ARGS_PPHRASE == lac) |
if (ARGS_PEND == ac && ARGS_PPHRASE == lac) |
m->flags |= MDOC_PPHRASE; |
m->flags |= MDOC_PPHRASE; |
|
|
if ( ! phrase(m, line, la, buf)) |
if ( ! phrase(m, regs, line, la, buf)) |
return(0); |
return(0); |
|
|
m->flags &= ~MDOC_PPHRASE; |
m->flags &= ~MDOC_PPHRASE; |
Line 1101 blk_full(MACRO_PROT_ARGS) |
|
Line 1103 blk_full(MACRO_PROT_ARGS) |
|
continue; |
continue; |
} |
} |
|
|
if ( ! mdoc_macro(m, ntok, line, la, pos, buf)) |
if ( ! mdoc_macro(m, regs, ntok, line, la, pos, buf)) |
return(0); |
return(0); |
break; |
break; |
} |
} |
Line 1229 blk_part_imp(MACRO_PROT_ARGS) |
|
Line 1231 blk_part_imp(MACRO_PROT_ARGS) |
|
continue; |
continue; |
} |
} |
|
|
if ( ! mdoc_macro(m, ntok, line, la, pos, buf)) |
if ( ! mdoc_macro(m, regs, ntok, line, la, pos, buf)) |
return(0); |
return(0); |
break; |
break; |
} |
} |
Line 1374 blk_part_exp(MACRO_PROT_ARGS) |
|
Line 1376 blk_part_exp(MACRO_PROT_ARGS) |
|
continue; |
continue; |
} |
} |
|
|
if ( ! mdoc_macro(m, ntok, line, la, pos, buf)) |
if ( ! mdoc_macro(m, regs, ntok, line, la, pos, buf)) |
return(0); |
return(0); |
break; |
break; |
} |
} |
Line 1493 in_line_argn(MACRO_PROT_ARGS) |
|
Line 1495 in_line_argn(MACRO_PROT_ARGS) |
|
if ( ! flushed && ! rew_elem(m, tok)) |
if ( ! flushed && ! rew_elem(m, tok)) |
return(0); |
return(0); |
flushed = 1; |
flushed = 1; |
if ( ! mdoc_macro(m, ntok, line, la, pos, buf)) |
if ( ! mdoc_macro(m, regs, ntok, line, la, pos, buf)) |
return(0); |
return(0); |
j++; |
j++; |
break; |
break; |
Line 1599 in_line_eoln(MACRO_PROT_ARGS) |
|
Line 1601 in_line_eoln(MACRO_PROT_ARGS) |
|
|
|
if ( ! rew_elem(m, tok)) |
if ( ! rew_elem(m, tok)) |
return(0); |
return(0); |
return(mdoc_macro(m, ntok, line, la, pos, buf)); |
return(mdoc_macro(m, regs, ntok, line, la, pos, buf)); |
} |
} |
|
|
/* Close out (no delimiters). */ |
/* Close out (no delimiters). */ |
Line 1618 ctx_synopsis(MACRO_PROT_ARGS) |
|
Line 1620 ctx_synopsis(MACRO_PROT_ARGS) |
|
|
|
/* If we're not in the SYNOPSIS, go straight to in-line. */ |
/* If we're not in the SYNOPSIS, go straight to in-line. */ |
if (SEC_SYNOPSIS != m->lastsec) |
if (SEC_SYNOPSIS != m->lastsec) |
return(in_line(m, tok, line, ppos, pos, buf)); |
return(in_line(m, regs, tok, line, ppos, pos, buf)); |
|
|
/* If we're a nested call, same place. */ |
/* If we're a nested call, same place. */ |
if ( ! nl) |
if ( ! nl) |
return(in_line(m, tok, line, ppos, pos, buf)); |
return(in_line(m, regs, tok, line, ppos, pos, buf)); |
|
|
/* |
/* |
* XXX: this will open a block scope; however, if later we end |
* XXX: this will open a block scope; however, if later we end |
Line 1630 ctx_synopsis(MACRO_PROT_ARGS) |
|
Line 1632 ctx_synopsis(MACRO_PROT_ARGS) |
|
* the formatting. Be careful. |
* the formatting. Be careful. |
*/ |
*/ |
|
|
return(blk_part_imp(m, tok, line, ppos, pos, buf)); |
return(blk_part_imp(m, regs, tok, line, ppos, pos, buf)); |
} |
} |
|
|
|
|
Line 1649 obsolete(MACRO_PROT_ARGS) |
|
Line 1651 obsolete(MACRO_PROT_ARGS) |
|
* macro is encountered. |
* macro is encountered. |
*/ |
*/ |
static int |
static int |
phrase(struct mdoc *m, int line, int ppos, char *buf) |
phrase(struct mdoc *m, const struct regset *regs, |
|
int line, int ppos, char *buf) |
{ |
{ |
int la, pos; |
int la, pos; |
enum margserr ac; |
enum margserr ac; |
Line 1674 phrase(struct mdoc *m, int line, int ppos, char *buf) |
|
Line 1677 phrase(struct mdoc *m, int line, int ppos, char *buf) |
|
continue; |
continue; |
} |
} |
|
|
if ( ! mdoc_macro(m, ntok, line, la, &pos, buf)) |
if ( ! mdoc_macro(m, regs, ntok, line, la, &pos, buf)) |
return(0); |
return(0); |
return(append_delims(m, line, &pos, buf)); |
return(append_delims(m, line, &pos, buf)); |
} |
} |
Line 1719 phrase_ta(MACRO_PROT_ARGS) |
|
Line 1722 phrase_ta(MACRO_PROT_ARGS) |
|
continue; |
continue; |
} |
} |
|
|
if ( ! mdoc_macro(m, ntok, line, la, pos, buf)) |
if ( ! mdoc_macro(m, regs, ntok, line, la, pos, buf)) |
return(0); |
return(0); |
return(append_delims(m, line, pos, buf)); |
return(append_delims(m, line, pos, buf)); |
} |
} |