Made bad standards into an error (were a warning).
-/* $Id: libmdoc.h,v 1.16 2009/07/12 20:24:24 kristaps Exp $ */
+/* $Id: libmdoc.h,v 1.17 2009/07/12 20:30:35 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
size_t mdoc_macro2len(int);
const char *mdoc_a2att(const char *);
size_t mdoc_macro2len(int);
const char *mdoc_a2att(const char *);
+const char *mdoc_a2st(const char *);
const char *mdoc_a2arch(const char *);
const char *mdoc_a2vol(const char *);
const char *mdoc_a2msec(const char *);
const char *mdoc_a2arch(const char *);
const char *mdoc_a2vol(const char *);
const char *mdoc_a2msec(const char *);
-/* $Id: mdoc.h,v 1.63 2009/07/12 20:24:24 kristaps Exp $ */
+/* $Id: mdoc.h,v 1.64 2009/07/12 20:30:35 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
int mdoc_endparse(struct mdoc *);
const char *mdoc_a2lib(const char *);
int mdoc_endparse(struct mdoc *);
const char *mdoc_a2lib(const char *);
-const char *mdoc_a2st(const char *);
-/* $Id: mdoc_action.c,v 1.25 2009/07/12 20:24:24 kristaps Exp $ */
+/* $Id: mdoc_action.c,v 1.26 2009/07/12 20:30:35 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
static int post_os(POST_ARGS);
static int post_prol(POST_ARGS);
static int post_sh(POST_ARGS);
static int post_os(POST_ARGS);
static int post_prol(POST_ARGS);
static int post_sh(POST_ARGS);
+static int post_st(POST_ARGS);
static int post_std(POST_ARGS);
static int pre_bd(PRE_ARGS);
static int post_std(POST_ARGS);
static int pre_bd(PRE_ARGS);
{ NULL, NULL }, /* Ot */
{ NULL, NULL }, /* Pa */
{ NULL, post_std }, /* Rv */
{ NULL, NULL }, /* Ot */
{ NULL, NULL }, /* Pa */
{ NULL, post_std }, /* Rv */
- { NULL, NULL }, /* St */
+ { NULL, post_st }, /* St */
{ NULL, NULL }, /* Va */
{ NULL, NULL }, /* Vt */
{ NULL, NULL }, /* Xr */
{ NULL, NULL }, /* Va */
{ NULL, NULL }, /* Vt */
{ NULL, NULL }, /* Xr */
+static int
+post_st(POST_ARGS)
+{
+ const char *p;
+
+ assert(MDOC_TEXT == m->last->child->type);
+ p = mdoc_a2st(m->last->child->string);
+ assert(p);
+ free(m->last->child->string);
+ m->last->child->string = strdup(p);
+ if (NULL == m->last->child->string)
+ return(mdoc_nerr(m, m->last, EMALLOC));
+ return(1);
+}
+
+
static int
post_at(POST_ARGS)
{
static int
post_at(POST_ARGS)
{
-/* $Id: mdoc_term.c,v 1.35 2009/07/12 20:24:24 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.36 2009/07/12 20:30:35 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
static int termp_sm_pre(DECL_ARGS);
static int termp_sq_pre(DECL_ARGS);
static int termp_ss_pre(DECL_ARGS);
static int termp_sm_pre(DECL_ARGS);
static int termp_sq_pre(DECL_ARGS);
static int termp_ss_pre(DECL_ARGS);
-static int termp_st_pre(DECL_ARGS);
static int termp_sx_pre(DECL_ARGS);
static int termp_sy_pre(DECL_ARGS);
static int termp_ud_pre(DECL_ARGS);
static int termp_sx_pre(DECL_ARGS);
static int termp_sy_pre(DECL_ARGS);
static int termp_ud_pre(DECL_ARGS);
{ NULL, NULL }, /* Ot */
{ termp_pa_pre, NULL }, /* Pa */
{ termp_rv_pre, NULL }, /* Rv */
{ NULL, NULL }, /* Ot */
{ termp_pa_pre, NULL }, /* Pa */
{ termp_rv_pre, NULL }, /* Rv */
- { termp_st_pre, NULL }, /* St */
+ { NULL, NULL }, /* St */
{ termp_va_pre, NULL }, /* Va */
{ termp_vt_pre, termp_vt_post }, /* Vt */
{ termp_xr_pre, NULL }, /* Xr */
{ termp_va_pre, NULL }, /* Va */
{ termp_vt_pre, termp_vt_post }, /* Vt */
{ termp_xr_pre, NULL }, /* Xr */
-/* ARGSUSED */
-static int
-termp_st_pre(DECL_ARGS)
-{
- const char *cp;
-
- if (node->child && (cp = mdoc_a2st(node->child->string)))
- term_word(p, cp);
- return(0);
-}
-
-
/* ARGSUSED */
static int
termp_rs_pre(DECL_ARGS)
/* ARGSUSED */
static int
termp_rs_pre(DECL_ARGS)
-/* $Id: mdoc_validate.c,v 1.29 2009/07/12 16:41:33 kristaps Exp $ */
+/* $Id: mdoc_validate.c,v 1.30 2009/07/12 20:30:35 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
if (mdoc_a2st(mdoc->last->child->string))
return(1);
if (mdoc_a2st(mdoc->last->child->string))
return(1);
- return(mdoc_nwarn(mdoc, mdoc->last, EBADSTAND));
+ return(mdoc_nerr(mdoc, mdoc->last, EBADSTAND));