diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-08-19 09:14:50 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-08-19 09:14:50 +0000 |
commit | aade897081e194716754b33820106010e2b0ad04 (patch) | |
tree | 685ac08b6c3f40f0ad7b84d21f7c697a86909444 /man.c | |
parent | da55485ae1f9a11536b11b9af51a3964d20caa7b (diff) | |
download | mandoc-aade897081e194716754b33820106010e2b0ad04.tar.gz |
Added RS/RE macro pair (had to adjust closing rules, sec/ssec/rs/par).
Diffstat (limited to 'man.c')
-rw-r--r-- | man.c | 23 |
1 files changed, 16 insertions, 7 deletions
@@ -40,7 +40,8 @@ const char *const __man_merrnames[WERRMAX] = { "expected empty block head", /* WNHEADARGS */ "unknown macro", /* WMACRO */ "ill-formed macro", /* WMACROFORM */ - "scope open on exit" /* WEXITSCOPE */ + "scope open on exit", /* WEXITSCOPE */ + "no scope context" /* WNOSCOPE */ }; const char *const __man_macronames[MAN_MAX] = { @@ -50,7 +51,8 @@ const char *const __man_macronames[MAN_MAX] = { "BI", "IB", "BR", "RB", "R", "B", "I", "IR", "RI", "na", "i", "sp", - "nf", "fi", "r" + "nf", "fi", "r", "RE", + "RS" }; const char * const *man_macronames = __man_macronames; @@ -257,14 +259,17 @@ man_node_alloc(int line, int pos, enum man_type type, int tok) int -man_elem_alloc(struct man *man, int line, int pos, int tok) +man_elem_alloc(struct man *m, int line, int pos, int tok) { struct man_node *p; p = man_node_alloc(line, pos, MAN_ELEM, tok); if (NULL == p) return(0); - return(man_node_append(man, p)); + if ( ! man_node_append(m, p)) + return(0); + m->next = MAN_NEXT_CHILD; + return(1); } @@ -314,8 +319,7 @@ man_block_alloc(struct man *m, int line, int pos, int tok) int -man_word_alloc(struct man *man, - int line, int pos, const char *word) +man_word_alloc(struct man *m, int line, int pos, const char *word) { struct man_node *p; @@ -324,7 +328,10 @@ man_word_alloc(struct man *man, return(0); if (NULL == (p->string = strdup(word))) return(0); - return(man_node_append(man, p)); + if ( ! man_node_append(m, p)) + return(0); + m->next = MAN_NEXT_SIBLING; + return(1); } @@ -360,6 +367,8 @@ man_ptext(struct man *m, int line, char *buf) /* First allocate word. */ + /* FIXME: dechunk words! */ + if ( ! man_word_alloc(m, line, 0, buf)) return(0); m->next = MAN_NEXT_SIBLING; |