FreeBSD/contrib/mdocml/eqn.c
/*
 * Parse the "delim" control statement.
 */
Parse the "delim" control statement.
Parse the " delim " control statement .
static void
eqn_delim(struct eqn_node *ep)
{
	const char	*start;
	size_t		 sz;
	if ((start = eqn_nextrawtok(ep, &sz)) == NULL)
		mandoc_msg(MANDOCERR_REQ_EMPTY, ep->parse,
		    ep->eqn.ln, ep->eqn.pos, "delim");
	else if (strncmp(start, "off", 3) == 0)
		ep->delim = 0;
	else if (strncmp(start, "on", 2) == 0) {
		if (ep->odelim && ep->cdelim)
			ep->delim = 1;
	} else if (start[1] != '\0') {
		ep->odelim = start[0];
		ep->cdelim = start[1];
		ep->delim = 1;
	}
}
static void eqn_delim ( struct eqn_node * ep ) { const char * start ; size_t sz ; if ( ( start = eqn_nextrawtok ( ep , & sz ) ) == NULL ) mandoc_msg ( MANDOCERR_REQ_EMPTY , ep -> parse , ep -> eqn . ln , ep -> eqn . pos , " " ) ; else if ( strncmp ( start , " " , 3 ) == 0 ) ep -> delim = 0 ; else if ( strncmp ( start , " " , 2 ) == 0 ) { if ( ep -> odelim && ep -> cdelim ) ep -> delim = 1 ; } else if ( start [ 1 ] != ' \0 ' ) { ep -> odelim = start [ 0 ] ; ep -> cdelim = start [ 1 ] ; ep -> delim = 1 ; } }
Parse the "delim" control statement.
Parse the " delim " control statement .