source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Remove `am', `ami', `de', `dei', and `.' from -man, as they're
@ 2010-05-15 22:44 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2010-05-15 22:44 UTC (permalink / raw)
  To: source

Log Message:
-----------
Remove `am', `ami', `de', `dei', and `.' from -man, as they're now in the roff preprocessor.

Modified Files:
--------------
    mdocml:
        libman.h
        man.c
        man.h
        man_action.c
        man_html.c
        man_macro.c
        man_term.c
        man_validate.c

Revision Data
-------------
Index: man_html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_html.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -Lman_html.c -Lman_html.c -u -p -r1.32 -r1.33
--- man_html.c
+++ man_html.c
@@ -106,11 +106,6 @@ static	const struct htmlman mans[MAN_MAX
 	{ man_br_pre, NULL }, /* Sp */
 	{ man_ign_pre, NULL }, /* Vb */
 	{ NULL, NULL }, /* Ve */
-	{ man_ign_pre, NULL }, /* de */
-	{ man_ign_pre, NULL }, /* dei */
-	{ man_ign_pre, NULL }, /* am */
-	{ man_ign_pre, NULL }, /* ami */
-	{ NULL, NULL }, /* . */
 };
 
 
Index: man.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -Lman.c -Lman.c -u -p -r1.69 -r1.70
--- man.c
+++ man.c
@@ -49,8 +49,6 @@ const	char *const __man_merrnames[WERRMA
 	"no scope context", /* WNOSCOPE */
 	"literal context already open", /* WOLITERAL */
 	"no literal context open", /* WNLITERAL */
-	"invalid nesting of roff declarations", /* WROFFNEST */
-	"scope in roff instructions broken", /* WROFFSCOPE */
 	"document title should be uppercase", /* WTITLECASE */
 	"deprecated comment style", /* WBADCOMMENT */
 };
@@ -64,8 +62,7 @@ const	char *const __man_macronames[MAN_M
 	"RI",		"na",		"i",		"sp",
 	"nf",		"fi",		"r",		"RE",
 	"RS",		"DT",		"UC",		"PD",
-	"Sp",		"Vb",		"Ve",		"de",
-	"dei",		"am",		"ami",		".",
+	"Sp",		"Vb",		"Ve",
 	};
 
 const	char * const *man_macronames = __man_macronames;
@@ -548,9 +545,6 @@ man_pmacro(struct man *m, int ln, char *
 	 * Remove prior ELINE macro, as it's being clobbering by a new
 	 * macro.  Note that NSCOPED macros do not close out ELINE
 	 * macros---they don't print text---so we let those slip by.
-	 * NOTE: we don't allow roff blocks (NOCLOSE) to be embedded
-	 * here because that would stipulate blocks as children of
-	 * elements!
 	 */
 
 	if ( ! (MAN_NSCOPED & man_macros[tok].flags) &&
Index: libman.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/libman.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -Llibman.h -Llibman.h -u -p -r1.32 -r1.33
--- libman.h
+++ libman.h
@@ -28,7 +28,6 @@ struct	man {
 	void		*data;
 	struct man_cb	 cb;
 	int		 pflags; /* parse flags (see man.h) */
-	int		 svflags; /* flags saved during roff blocks */
 	int		 flags; /* parse flags */
 #define	MAN_HALT	(1 << 0) /* badness happened: die */
 #define	MAN_ELINE	(1 << 1) /* Next-line element scope. */
@@ -37,7 +36,6 @@ struct	man {
 #define	MAN_LITERAL	(1 << 4) /* Literal input. */
 #define	MAN_BPLINE	(1 << 5)
 	enum man_next	 next;
-	enum man_next	 svnext;
 	struct man_node	*last;
 	struct man_node	*first;
 	struct man_meta	 meta;
@@ -62,8 +60,6 @@ enum	merr {
 	WNOSCOPE,
 	WOLITERAL,
 	WNLITERAL,
-	WROFFNEST,
-	WROFFSCOPE,
 	WTITLECASE,
 	WBADCOMMENT,
 	WERRMAX
Index: man_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_term.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -Lman_term.c -Lman_term.c -u -p -r1.67 -r1.68
--- man_term.c
+++ man_term.c
@@ -142,11 +142,6 @@ static	const struct termact termacts[MAN
  	{ pre_sp, NULL, MAN_NOTEXT }, /* Sp */
  	{ pre_nf, NULL, 0 }, /* Vb */
  	{ pre_fi, NULL, 0 }, /* Ve */
- 	{ pre_ign, NULL, MAN_NOTEXT }, /* de */
- 	{ pre_ign, NULL, MAN_NOTEXT }, /* dei */
- 	{ pre_ign, NULL, MAN_NOTEXT }, /* am */
- 	{ pre_ign, NULL, MAN_NOTEXT }, /* ami */
- 	{ NULL, NULL, 0 }, /* . */
 };
 
 
Index: man.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -Lman.h -Lman.h -u -p -r1.31 -r1.32
--- man.h
+++ man.h
@@ -55,11 +55,6 @@ enum	mant {
 	MAN_Sp,
 	MAN_Vb,
 	MAN_Ve,
-	MAN_de,
-	MAN_dei,
-	MAN_am,
-	MAN_ami,
-	MAN_dot,
 	MAN_MAX
 };
 
Index: man_action.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_action.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -Lman_action.c -Lman_action.c -u -p -r1.33 -r1.34
--- man_action.c
+++ man_action.c
@@ -30,7 +30,6 @@ struct	actions {
 };
 
 static	int	  post_TH(struct man *);
-static	int	  post_de(struct man *);
 static	int	  post_fi(struct man *);
 static	int	  post_nf(struct man *);
 
@@ -70,11 +69,6 @@ const	struct actions man_actions[MAN_MAX
 	{ NULL }, /* Sp */
 	{ post_nf }, /* Vb */
 	{ post_fi }, /* Ve */
-	{ post_de }, /* de */
-	{ post_de }, /* dei */
-	{ post_de }, /* am */
-	{ post_de }, /* ami */
-	{ NULL }, /* . */
 };
 
 
@@ -109,20 +103,6 @@ post_fi(struct man *m)
 		if ( ! man_nwarn(m, m->last, WNLITERAL))
 			return(0);
 	m->flags &= ~MAN_LITERAL;
-	return(1);
-}
-
-
-static int
-post_de(struct man *m)
-{
-
-	/*
-	 * XXX: for the time being, we indiscriminately remove roff
-	 * instructions from the parse stream.
-	 */
-	if (MAN_BLOCK == m->last->type)
-		man_node_delete(m, m->last);
 	return(1);
 }
 
Index: man_macro.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_macro.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -Lman_macro.c -Lman_macro.c -u -p -r1.43 -r1.44
--- man_macro.c
+++ man_macro.c
@@ -32,7 +32,6 @@ enum	rew {
 };
 
 static	int		 blk_close(MACRO_PROT_ARGS);
-static	int		 blk_dotted(MACRO_PROT_ARGS);
 static	int		 blk_exp(MACRO_PROT_ARGS);
 static	int		 blk_imp(MACRO_PROT_ARGS);
 static	int		 in_line_eoln(MACRO_PROT_ARGS);
@@ -82,11 +81,6 @@ const	struct man_macro __man_macros[MAN_
 	{ in_line_eoln, MAN_NSCOPED }, /* Sp */
 	{ in_line_eoln, 0 }, /* Vb */
 	{ in_line_eoln, 0 }, /* Ve */
-	{ blk_exp, MAN_EXPLICIT | MAN_NOCLOSE}, /* de */
-	{ blk_exp, MAN_EXPLICIT | MAN_NOCLOSE}, /* dei */
-	{ blk_exp, MAN_EXPLICIT | MAN_NOCLOSE}, /* am */
-	{ blk_exp, MAN_EXPLICIT | MAN_NOCLOSE}, /* ami */
-	{ blk_dotted, 0 }, /* . */
 };
 
 const	struct man_macro * const man_macros = __man_macros;
@@ -105,8 +99,6 @@ rew_warn(struct man *m, struct man_node 
 		return(1);
 	if ( ! (MAN_EXPLICIT & man_macros[n->tok].flags))
 		return(1);
-	if (MAN_NOCLOSE & man_macros[n->tok].flags)
-		return(1);
 	return(man_nwarn(m, n, er));
 }
 
@@ -186,24 +178,6 @@ rew_dohalt(enum mant tok, enum man_type 
 	if (type == n->type && tok == n->tok)
 		return(REW_REWIND);
 
-	/*
-	 * If we're a roff macro, then we can close out anything that
-	 * stands between us and our parent context.
-	 */
-	if (MAN_NOCLOSE & man_macros[tok].flags)
-		return(REW_NOHALT);
-
-	/* 
-	 * Don't clobber roff macros: this is a bit complicated.  If the
-	 * current macro is a roff macro, halt immediately and don't
-	 * rewind.  If it's not, and the parent is, then close out the
-	 * current scope and halt at the parent.
-	 */
-	if (MAN_NOCLOSE & man_macros[n->tok].flags)
-		return(REW_HALT);
-	if (MAN_NOCLOSE & man_macros[n->parent->tok].flags)
-		return(REW_REWIND);
-
 	/* 
 	 * Next follow the implicit scope-smashings as defined by man.7:
 	 * section, sub-section, etc.
@@ -272,59 +246,12 @@ rew_scope(enum man_type type, struct man
 	 * instruction that's mowing over explicit scopes.
 	 */
 	assert(n);
-	if (MAN_NOCLOSE & man_macros[tok].flags)
-		return(man_unscope(m, n, WROFFSCOPE));
 
 	return(man_unscope(m, n, WERRMAX));
 }
 
 
 /*
- * Closure for dotted macros (de, dei, am, ami, ign).  This must handle
- * any of these as the parent node, so it needs special handling.
- * Beyond this, it's the same as blk_close().
- */
-/* ARGSUSED */
-int
-blk_dotted(MACRO_PROT_ARGS)
-{
-	enum mant	 ntok;
-	struct man_node	*nn;
-
-	/* Check for any of the following parents... */
-
-	for (nn = m->last->parent; nn; nn = nn->parent)
-		if (nn->tok == MAN_de || nn->tok == MAN_dei ||
-				nn->tok == MAN_am ||
-				nn->tok == MAN_ami) {
-			ntok = nn->tok;
-			break;
-		}
-
-	if (NULL == nn) {
-		if ( ! man_pwarn(m, line, ppos, WNOSCOPE))
-			return(0);
-		return(1);
-	}
-
-	if ( ! rew_scope(MAN_BODY, m, ntok))
-		return(0);
-	if ( ! rew_scope(MAN_BLOCK, m, ntok))
-		return(0);
-
-	/*
-	 * Restore flags set when we got here and also stipulate that we
-	 * don't post-process the line when exiting the macro op
-	 * function in man_pmacro().  See blk_exp().
-	 */
-
-	m->flags = m->svflags | MAN_ILINE;
-	m->next = m->svnext;
-	return(1);
-}
-
-
-/*
  * Close out a generic explicit macro.
  */
 /* ARGSUSED */
@@ -372,23 +299,10 @@ blk_exp(MACRO_PROT_ARGS)
 	 * anywhere.
 	 */
 
-	if ( ! (MAN_NOCLOSE & man_macros[tok].flags)) {
-		if ( ! rew_scope(MAN_BODY, m, tok))
-			return(0);
-		if ( ! rew_scope(MAN_BLOCK, m, tok))
-			return(0);
-	} else {
-		/*
-		 * Save our state and next-scope indicator; we restore
-		 * it when exiting from the roff instruction block.  See
-		 * blk_dotted().
-		 */
-		m->svflags = m->flags;
-		m->svnext = m->next;
-		
-		/* Make sure we drop any line modes. */
-		m->flags = 0;
-	}
+	if ( ! rew_scope(MAN_BODY, m, tok))
+		return(0);
+	if ( ! rew_scope(MAN_BLOCK, m, tok))
+		return(0);
 
 	if ( ! man_block_alloc(m, line, ppos, tok))
 		return(0);
Index: man_validate.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_validate.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -Lman_validate.c -Lman_validate.c -u -p -r1.38 -r1.39
--- man_validate.c
+++ man_validate.c
@@ -46,7 +46,6 @@ static	int	  check_ge2(CHKARGS);
 static	int	  check_le5(CHKARGS);
 static	int	  check_par(CHKARGS);
 static	int	  check_part(CHKARGS);
-static	int	  check_roff(CHKARGS);
 static	int	  check_root(CHKARGS);
 static	int	  check_sec(CHKARGS);
 static	int	  check_text(CHKARGS);
@@ -59,7 +58,6 @@ static	v_check	  posts_part[] = { check_
 static	v_check	  posts_sec[] = { check_sec, NULL };
 static	v_check	  posts_le1[] = { check_le1, NULL };
 static	v_check	  pres_bline[] = { check_bline, NULL };
-static	v_check	  pres_roff[] = { check_roff, NULL };
 
 static	const struct man_valid man_valids[MAN_MAX] = {
 	{ NULL, posts_eq0 }, /* br */
@@ -97,11 +95,6 @@ static	const struct man_valid man_valids
 	{ NULL, posts_le1 }, /* Sp */
 	{ pres_bline, posts_le1 }, /* Vb */
 	{ pres_bline, posts_eq0 }, /* Ve */
-	{ pres_roff, NULL }, /* de */
-	{ pres_roff, NULL }, /* dei */
-	{ pres_roff, NULL }, /* am */
-	{ pres_roff, NULL }, /* ami */
-	{ NULL, NULL }, /* . */
 };
 
 
@@ -323,19 +316,3 @@ check_bline(CHKARGS)
 	return(1);
 }
 
-
-static int
-check_roff(CHKARGS)
-{
-
-	if (MAN_BLOCK != n->type)
-		return(1);
-
-	for (n = n->parent; n; n = n->parent)
-		if (MAN_de == n->tok || MAN_dei == n->tok ||
-				MAN_am == n->tok || 
-				MAN_ami == n->tok)
-			return(man_nerr(m, n, WROFFNEST));
-
-	return(1);
-}
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-15 22:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-15 22:44 mdocml: Remove `am', `ami', `de', `dei', and `.' from -man, as they're kristaps

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).