diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-27 16:18:13 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-27 16:18:13 +0000 |
commit | dc95dcaff23f7235529d0b5d9866a252ca3f8c06 (patch) | |
tree | 33263f6d49184bc0c76b80cf9d91e5409c3d3e16 /mdoc.c | |
parent | dc649a73f967c1a61e60d2495f16d56db82eac57 (diff) | |
download | mandoc-dc95dcaff23f7235529d0b5d9866a252ca3f8c06.tar.gz mandoc-dc95dcaff23f7235529d0b5d9866a252ca3f8c06.tar.zst mandoc-dc95dcaff23f7235529d0b5d9866a252ca3f8c06.zip |
Following clue-stick applied by schwarze@, back out const-ness of regset
passed in to libmdoc and libman.
Fix mdoc.3 and man.3 EXAMPLE sections to include regset.
Add MDOC_SYNPRETTY flag cueing front-end to nicely format certain values
as if SEC_SYNOPSIS were the current section.
Diffstat (limited to 'mdoc.c')
-rw-r--r-- | mdoc.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.149 2010/06/27 15:52:41 kristaps Exp $ */ +/* $Id: mdoc.c,v 1.150 2010/06/27 16:18:13 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -192,8 +192,8 @@ mdoc_free(struct mdoc *mdoc) * Allocate volatile and non-volatile parse resources. */ struct mdoc * -mdoc_alloc(const struct regset *regs, - void *data, int pflags, mandocmsg msg) +mdoc_alloc(struct regset *regs, void *data, + int pflags, mandocmsg msg) { struct mdoc *p; @@ -368,9 +368,18 @@ node_alloc(struct mdoc *m, int line, int pos, p->pos = pos; p->tok = tok; p->type = type; + + /* Flag analysis. */ + if (MDOC_NEWLINE & m->flags) p->flags |= MDOC_LINE; m->flags &= ~MDOC_NEWLINE; + + /* Section analysis. */ + + if (SEC_SYNOPSIS == p->sec) + p->flags |= MDOC_SYNPRETTY; + return(p); } |