version 1.188, 2022/04/28 10:26:37 |
version 1.189, 2022/08/16 23:01:09 |
Line 76 man_hasc(char *start) |
|
Line 76 man_hasc(char *start) |
|
void |
void |
man_descope(struct roff_man *man, int line, int offs, char *start) |
man_descope(struct roff_man *man, int line, int offs, char *start) |
{ |
{ |
/* Trailing \c keeps next-line scope open. */ |
/* First close out all next-line element scopes, if any. */ |
|
|
if (start != NULL && man_hasc(start) != NULL) |
|
return; |
|
|
|
/* |
|
* Co-ordinate what happens with having a next-line scope open: |
|
* first close out the element scopes (if applicable), |
|
* then close out the block scope (also if applicable). |
|
*/ |
|
|
|
if (man->flags & MAN_ELINE) { |
if (man->flags & MAN_ELINE) { |
while (man->last->parent->type != ROFFT_ROOT && |
while (man->last->parent->type != ROFFT_ROOT && |
man_macro(man->last->parent->tok)->flags & MAN_ESCOPED) |
man_macro(man->last->parent->tok)->flags & MAN_ESCOPED) |
man_unscope(man, man->last->parent); |
man_unscope(man, man->last->parent); |
man->flags &= ~MAN_ELINE; |
man->flags &= ~MAN_ELINE; |
} |
} |
|
|
|
/* Trailing \c keeps next-line block scope open. */ |
|
|
|
if (start != NULL && man_hasc(start) != NULL) |
|
return; |
|
|
|
/* Close out the next-line block scope, if there is one. */ |
|
|
if ( ! (man->flags & MAN_BLINE)) |
if ( ! (man->flags & MAN_BLINE)) |
return; |
return; |
man_unscope(man, man->last->parent); |
man_unscope(man, man->last->parent); |