summaryrefslogtreecommitdiffstatshomepage
path: root/macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-01-12 17:26:42 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-01-12 17:26:42 +0000
commitd5b18a2eadce9a79cc1dc6c39b74d5bb41bfb6b5 (patch)
tree48056bbbc32f18aa6e8e4ec283dee16dc8d93bd7 /macro.c
parentc719ec85550f1763968d4ff729b4269511f07ad6 (diff)
downloadmandoc-d5b18a2eadce9a79cc1dc6c39b74d5bb41bfb6b5.tar.gz
mandoc-d5b18a2eadce9a79cc1dc6c39b74d5bb41bfb6b5.tar.zst
mandoc-d5b18a2eadce9a79cc1dc6c39b74d5bb41bfb6b5.zip
*** empty log message ***
Diffstat (limited to 'macro.c')
-rw-r--r--macro.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/macro.c b/macro.c
index 0ed6f173..55c6f89d 100644
--- a/macro.c
+++ b/macro.c
@@ -1,4 +1,4 @@
-/* $Id: macro.c,v 1.33 2009/01/12 16:39:57 kristaps Exp $ */
+/* $Id: macro.c,v 1.34 2009/01/12 17:26:42 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -68,6 +68,8 @@ rewind_last(struct mdoc *mdoc, struct mdoc_node *to)
return(0);
if ( ! mdoc_action_post(mdoc))
return(0);
+ mdoc_msg(mdoc, "rewound to %s",
+ mdoc_macronames[mdoc->last->tok]);
return(1);
}
@@ -78,6 +80,8 @@ rewind_last(struct mdoc *mdoc, struct mdoc_node *to)
return(0);
if ( ! mdoc_action_post(mdoc))
return(0);
+ mdoc_msg(mdoc, "rewound to %s",
+ mdoc_macronames[mdoc->last->tok]);
} while (mdoc->last != to);
return(1);
@@ -109,11 +113,10 @@ rewind_body(struct mdoc *mdoc, int tok)
/* LINTED */
for (n = mdoc->last; n; n = n->parent) {
- if (MDOC_BODY != n->type)
- continue;
- if (tok == (t = n->tok))
+ t = n->tok;
+ if (MDOC_BODY == n->type && tok == t)
break;
- if ( ! (MDOC_EXPLICIT & mdoc_macros[t].flags))
+ if (MDOC_NESTED & mdoc_macros[t].flags)
continue;
return(mdoc_verr(mdoc, n, ERR_SCOPE_BREAK));
}
@@ -133,11 +136,10 @@ rewind_head(struct mdoc *mdoc, int tok)
/* LINTED */
for (n = mdoc->last; n; n = n->parent) {
- if (MDOC_HEAD != n->type)
- continue;
- if (tok == (t = n->tok))
+ t = n->tok;
+ if (MDOC_HEAD == n->type && tok == t)
break;
- if ( ! (MDOC_EXPLICIT & mdoc_macros[t].flags))
+ if (MDOC_NESTED & mdoc_macros[t].flags)
continue;
return(mdoc_verr(mdoc, n, ERR_SCOPE_BREAK));
}
@@ -157,9 +159,8 @@ rewind_expblock(struct mdoc *mdoc, int tok)
/* LINTED */
for ( ; n; n = n->parent) {
- if (MDOC_BLOCK != n->type)
- continue;
- if (tok == (t = n->tok))
+ t = n->tok;
+ if (MDOC_BLOCK == n->type && tok == t)
break;
if (MDOC_NESTED & mdoc_macros[t].flags)
continue;
@@ -181,9 +182,8 @@ rewind_impblock(struct mdoc *mdoc, int tok)
/* LINTED */
for ( ; n; n = n->parent) {
- if (MDOC_BLOCK != n->type)
- continue;
- if (tok == (t = n->tok))
+ t = n->tok;
+ if (MDOC_BLOCK == n->type && tok == t)
break;
if ( ! (MDOC_EXPLICIT & mdoc_macros[t].flags))
continue;