=================================================================== RCS file: /cvs/mandoc/Attic/validate.c,v retrieving revision 1.13 retrieving revision 1.22 diff -u -p -r1.13 -r1.22 --- mandoc/Attic/validate.c 2009/01/02 14:06:16 1.13 +++ mandoc/Attic/validate.c 2009/01/09 15:07:04 1.22 @@ -1,4 +1,4 @@ -/* $Id: validate.c,v 1.13 2009/01/02 14:06:16 kristaps Exp $ */ +/* $Id: validate.c,v 1.22 2009/01/09 15:07:04 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -21,406 +21,339 @@ #include "private.h" -/* FIXME: `.St' can only have one argument set. */ -typedef int (*v_args_sz)(struct mdoc *, int, int, int); -typedef int (*v_args)(struct mdoc *, int, int, int, - const char *[], int, const struct mdoc_arg *); -typedef int (*v_post)(struct mdoc *, int, int); +typedef int (*v_pre)(struct mdoc *, struct mdoc_node *); +typedef int (*v_post)(struct mdoc *); -static int need_head_child(struct mdoc *, int, int); -static int no_head_child(struct mdoc *, int, int); -static int assert_eq0(struct mdoc *, int, int, int); -static int assert_le1(struct mdoc *, int, int, int); -static int need_eq0(struct mdoc *, int, int, int); -static int need_eq1(struct mdoc *, int, int, int); -static int need_ge1(struct mdoc *, int, int, int); -static int need_le2(struct mdoc *, int, int, int); -static int want_eq0(struct mdoc *, int, int, int); -static int want_ge1(struct mdoc *, int, int, int); - -static int args_ref(struct mdoc *, int, int, int, - const char *[], int, const struct mdoc_arg *); -static int args_bool(struct mdoc *, int, int, int, - const char *[], int, const struct mdoc_arg *); -static int args_Sh(struct mdoc *, int, int, int, - const char *[], int, const struct mdoc_arg *); -static int args_blocknest(struct mdoc *, int, int, int, - const char *[], int, const struct mdoc_arg *); -static int args_At(struct mdoc *, int, int, int, - const char *[], int, const struct mdoc_arg *); -static int args_Xr(struct mdoc *, int, int, int, - const char *[], int, const struct mdoc_arg *); - struct valids { - v_args_sz sz; - v_args args; - v_post post; + v_pre pre; + v_post *post; }; -/* - * FIXME: have arrays of function pointers in case we want multiple - * check callbacks per macro. - */ +static int pre_prologue(struct mdoc *, struct mdoc_node *); +static int pre_prologue(struct mdoc *, struct mdoc_node *); +static int pre_prologue(struct mdoc *, struct mdoc_node *); +static int post_headchild_err_ge1(struct mdoc *); +static int post_elemchild_err_ge1(struct mdoc *); +static int post_elemchild_warn_eq0(struct mdoc *); +static int post_bodychild_warn_ge1(struct mdoc *); +static int post_sh(struct mdoc *); +static v_post posts_sh[] = { post_headchild_err_ge1, + post_bodychild_warn_ge1, post_sh, NULL }; +static v_post posts_ss[] = { post_headchild_err_ge1, NULL }; +static v_post posts_pp[] = { post_elemchild_warn_eq0, NULL }; +static v_post posts_dd[] = { post_elemchild_err_ge1, NULL }; + + const struct valids mdoc_valids[MDOC_MAX] = { - { NULL, NULL, NULL }, /* \" */ - { NULL, NULL, NULL }, /* Dd */ /* TODO */ - { NULL, NULL, NULL }, /* Dt */ /* TODO */ - { NULL, NULL, NULL }, /* Os */ /* TODO */ - { NULL, args_Sh, NULL }, /* Sh */ - { NULL, NULL, NULL }, /* Ss */ - { want_eq0, NULL, NULL }, /* Pp */ - { NULL, args_blocknest, need_head_child }, /* D1 */ - { NULL, args_blocknest, need_head_child }, /* Dl */ - { NULL, args_blocknest, NULL }, /* Bd */ - { NULL, NULL, no_head_child }, /* Ed */ - { NULL, NULL, NULL }, /* Bl */ - { NULL, NULL, no_head_child }, /* El */ - { NULL, NULL, NULL }, /* It */ - { need_ge1, NULL, NULL }, /* Ad */ - { NULL, NULL, NULL }, /* An */ /* FIXME: no args & argv. */ - { NULL, NULL, NULL }, /* Ar */ - { need_ge1, NULL, NULL }, /* Cd */ - { NULL, NULL, NULL }, /* Cm */ - { need_ge1, NULL, NULL }, /* Dv */ - { need_ge1, NULL, NULL }, /* Er */ - { need_ge1, NULL, NULL }, /* Ev */ - { NULL, NULL, NULL }, /* Ex */ - { need_ge1, NULL, NULL }, /* Fa */ - { NULL, NULL, NULL }, /* Fd */ - { NULL, NULL, NULL }, /* Fl */ - { need_ge1, NULL, NULL }, /* Fn */ - { want_ge1, NULL, NULL }, /* Ft */ - { need_ge1, NULL, NULL }, /* Ic */ - { need_eq1, NULL, NULL }, /* In */ - { want_ge1, NULL, NULL }, /* Li */ - { want_ge1, NULL, NULL }, /* Nd */ - { NULL, NULL, NULL }, /* Nm */ - { NULL, NULL, NULL }, /* Op */ - { NULL, NULL, NULL }, /* Ot */ - { want_ge1, NULL, NULL }, /* Pa */ - { NULL, NULL, NULL }, /* Rv */ - { NULL, NULL, NULL }, /* St */ - { need_ge1, NULL, NULL }, /* Va */ - { need_ge1, NULL, NULL }, /* Vt */ - { need_le2, args_Xr, NULL }, /* Xr */ - { need_ge1, args_ref, NULL }, /* %A */ - { need_ge1, args_ref, NULL }, /* %B */ - { need_ge1, args_ref, NULL }, /* %D */ - { need_ge1, args_ref, NULL }, /* %I */ - { need_ge1, args_ref, NULL }, /* %J */ - { need_ge1, args_ref, NULL }, /* %N */ - { need_ge1, args_ref, NULL }, /* %O */ - { need_ge1, args_ref, NULL }, /* %P */ - { need_ge1, args_ref, NULL }, /* %R */ - { need_ge1, args_ref, NULL }, /* %T */ - { need_ge1, args_ref, NULL }, /* %V */ - { NULL, NULL, NULL }, /* Ac */ - { NULL, NULL, NULL }, /* Ao */ - { NULL, NULL, NULL }, /* Aq */ - { need_le2, args_At, NULL }, /* At */ - { NULL, NULL, NULL }, /* Bc */ - { NULL, NULL, NULL }, /* Bf */ - { NULL, NULL, NULL }, /* Bo */ - { NULL, NULL, NULL }, /* Bq */ - { assert_le1, NULL, NULL }, /* Bsx */ - { assert_le1, NULL, NULL }, /* Bx */ - { need_eq1, args_bool, NULL }, /* Db */ - { NULL, NULL, NULL }, /* Dc */ - { NULL, NULL, NULL }, /* Do */ - { NULL, NULL, NULL }, /* Dq */ - { NULL, NULL, NULL }, /* Ec */ - { NULL, NULL, NULL }, /* Ef */ /* -symbolic, etc. */ - { need_ge1, NULL, NULL }, /* Em */ - { NULL, NULL, NULL }, /* Eo */ - { assert_le1, NULL, NULL }, /* Fx */ - { want_ge1, NULL, NULL }, /* Ms */ - { NULL, NULL, NULL }, /* No */ - { NULL, NULL, NULL }, /* Ns */ - { assert_le1, NULL, NULL }, /* Nx */ - { assert_le1, NULL, NULL }, /* Ox */ - { NULL, NULL, NULL }, /* Pc */ - { NULL, NULL, NULL }, /* Pf */ /* 2 or more arguments */ - { NULL, NULL, NULL }, /* Po */ - { NULL, NULL, NULL }, /* Pq */ - { NULL, NULL, NULL }, /* Qc */ - { NULL, NULL, NULL }, /* Ql */ - { NULL, NULL, NULL }, /* Qo */ - { NULL, NULL, NULL }, /* Qq */ - { NULL, NULL, NULL }, /* Re */ - { NULL, NULL, NULL }, /* Rs */ - { NULL, NULL, NULL }, /* Sc */ - { NULL, NULL, NULL }, /* So */ - { NULL, NULL, NULL }, /* Sq */ - { need_eq1, args_bool, NULL }, /* Sm */ - { need_ge1, NULL, NULL }, /* Sx */ - { need_ge1, NULL, NULL }, /* Sy */ - { want_ge1, NULL, NULL }, /* Tn */ - { assert_eq0, NULL, NULL }, /* Ux */ - { NULL, NULL, NULL }, /* Xc */ - { NULL, NULL, NULL }, /* Xo */ - { NULL, NULL, NULL }, /* Fo */ - { NULL, NULL, NULL }, /* Fc */ - { NULL, NULL, NULL }, /* Oo */ - { NULL, NULL, NULL }, /* Oc */ - { NULL, NULL, NULL }, /* Bk */ - { NULL, NULL, NULL }, /* Ek */ - { need_eq0, NULL, NULL }, /* Bt */ - { need_eq1, NULL, NULL }, /* Hf */ - { NULL, NULL, NULL }, /* Fr */ - { need_eq0, NULL, NULL }, /* Ud */ + { NULL, NULL }, /* \" */ + { pre_prologue, posts_dd }, /* Dd */ + { pre_prologue, NULL }, /* Dt */ + { pre_prologue, NULL }, /* Os */ + { NULL, posts_sh }, /* Sh */ /* FIXME: preceding Pp. */ + { NULL, posts_ss }, /* Ss */ /* FIXME: preceding Pp. */ + { NULL, posts_pp }, /* Pp */ /* FIXME: proceeding... */ + { NULL, NULL }, /* D1 */ + { NULL, NULL }, /* Dl */ + { NULL, NULL }, /* Bd */ /* FIXME: preceding Pp. */ + { NULL, NULL }, /* Ed */ + { NULL, NULL }, /* Bl */ /* FIXME: preceding Pp. */ + { NULL, NULL }, /* El */ + { NULL, NULL }, /* It */ + { NULL, NULL }, /* Ad */ + { NULL, NULL }, /* An */ + { NULL, NULL }, /* Ar */ + { NULL, NULL }, /* Cd */ + { NULL, NULL }, /* Cm */ + { NULL, NULL }, /* Dv */ + { NULL, NULL }, /* Er */ + { NULL, NULL }, /* Ev */ + { NULL, NULL }, /* Ex */ + { NULL, NULL }, /* Fa */ + { NULL, NULL }, /* Fd */ + { NULL, NULL }, /* Fl */ + { NULL, NULL }, /* Fn */ + { NULL, NULL }, /* Ft */ + { NULL, NULL }, /* Ic */ + { NULL, NULL }, /* In */ + { NULL, NULL }, /* Li */ + { NULL, NULL }, /* Nd */ + { NULL, NULL }, /* Nm */ + { NULL, NULL }, /* Op */ + { NULL, NULL }, /* Ot */ + { NULL, NULL }, /* Pa */ + { NULL, NULL }, /* Rv */ + { NULL, NULL }, /* St */ + { NULL, NULL }, /* Va */ + { NULL, NULL }, /* Vt */ + { NULL, NULL }, /* Xr */ + { NULL, NULL }, /* %A */ + { NULL, NULL }, /* %B */ + { NULL, NULL }, /* %D */ + { NULL, NULL }, /* %I */ + { NULL, NULL }, /* %J */ + { NULL, NULL }, /* %N */ + { NULL, NULL }, /* %O */ + { NULL, NULL }, /* %P */ + { NULL, NULL }, /* %R */ + { NULL, NULL }, /* %T */ + { NULL, NULL }, /* %V */ + { NULL, NULL }, /* Ac */ + { NULL, NULL }, /* Ao */ + { NULL, NULL }, /* Aq */ + { NULL, NULL }, /* At */ /* FIXME */ + { NULL, NULL }, /* Bc */ + { NULL, NULL }, /* Bf */ + { NULL, NULL }, /* Bo */ + { NULL, NULL }, /* Bq */ + { NULL, NULL }, /* Bsx */ + { NULL, NULL }, /* Bx */ + { NULL, NULL }, /* Db */ + { NULL, NULL }, /* Dc */ + { NULL, NULL }, /* Do */ + { NULL, NULL }, /* Dq */ + { NULL, NULL }, /* Ec */ + { NULL, NULL }, /* Ef */ /* -symbolic, etc. */ + { NULL, NULL }, /* Em */ + { NULL, NULL }, /* Eo */ + { NULL, NULL }, /* Fx */ + { NULL, NULL }, /* Ms */ + { NULL, NULL }, /* No */ + { NULL, NULL }, /* Ns */ + { NULL, NULL }, /* Nx */ + { NULL, NULL }, /* Ox */ + { NULL, NULL }, /* Pc */ + { NULL, NULL }, /* Pf */ /* 2 or more arguments */ + { NULL, NULL }, /* Po */ + { NULL, NULL }, /* Pq */ /* FIXME: ignore following Sh/Ss */ + { NULL, NULL }, /* Qc */ + { NULL, NULL }, /* Ql */ + { NULL, NULL }, /* Qo */ + { NULL, NULL }, /* Qq */ + { NULL, NULL }, /* Re */ + { NULL, NULL }, /* Rs */ + { NULL, NULL }, /* Sc */ + { NULL, NULL }, /* So */ + { NULL, NULL }, /* Sq */ + { NULL, NULL }, /* Sm */ + { NULL, NULL }, /* Sx */ + { NULL, NULL }, /* Sy */ + { NULL, NULL }, /* Tn */ + { NULL, NULL }, /* Ux */ + { NULL, NULL }, /* Xc */ + { NULL, NULL }, /* Xo */ + { NULL, NULL }, /* Fo */ + { NULL, NULL }, /* Fc */ + { NULL, NULL }, /* Oo */ + { NULL, NULL }, /* Oc */ + { NULL, NULL }, /* Bk */ + { NULL, NULL }, /* Ek */ + { NULL, NULL }, /* Bt */ + { NULL, NULL }, /* Hf */ + { NULL, NULL }, /* Fr */ + { NULL, NULL }, /* Ud */ }; static int -need_le2(struct mdoc *mdoc, int tok, int pos, int sz) +post_bodychild_warn_ge1(struct mdoc *mdoc) { - if (sz <= 2) - return(1); - return(mdoc_err(mdoc, tok, pos, ERR_ARGS_LE2)); -} - -static int -want_ge1(struct mdoc *mdoc, int tok, int pos, int sz) -{ - if (sz > 0) + if (MDOC_BODY != mdoc->last->type) return(1); - return(mdoc_warn(mdoc, tok, pos, WARN_ARGS_GE1)); -} - - -static int -want_eq0(struct mdoc *mdoc, int tok, int pos, int sz) -{ - if (sz == 0) + if (mdoc->last->child) return(1); - return(mdoc_warn(mdoc, tok, pos, WARN_ARGS_EQ0)); -} - -static int -need_eq0(struct mdoc *mdoc, int tok, int pos, int sz) -{ - if (sz == 0) - return(1); - return(mdoc_err(mdoc, tok, pos, ERR_ARGS_EQ0)); + return(mdoc_warn(mdoc, WARN_ARGS_GE1)); } static int -assert_le1(struct mdoc *mdoc, int tok, int pos, int sz) +post_elemchild_warn_eq0(struct mdoc *mdoc) { - assert(sz <= 1); - return(1); + assert(MDOC_ELEM == mdoc->last->type); + if (NULL == mdoc->last->child) + return(1); + return(mdoc_warn(mdoc, WARN_ARGS_EQ0)); } static int -assert_eq0(struct mdoc *mdoc, int tok, int pos, int sz) +post_elemchild_err_ge1(struct mdoc *mdoc) { - assert(sz == 0); - return(1); -} - - -static int -need_eq1(struct mdoc *mdoc, int tok, int pos, int sz) -{ - if (sz == 1) + assert(MDOC_ELEM == mdoc->last->type); + if (mdoc->last->child) return(1); - return(mdoc_err(mdoc, tok, pos, ERR_ARGS_EQ1)); + return(mdoc_err(mdoc, ERR_ARGS_GE1)); } static int -need_ge1(struct mdoc *mdoc, int tok, int pos, int sz) +post_headchild_err_ge1(struct mdoc *mdoc) { - if (sz > 0) - return(1); - return(mdoc_err(mdoc, tok, pos, ERR_ARGS_GE1)); -} - -static int -no_head_child(struct mdoc *mdoc, int tok, int pos) -{ - - /* TODO */ - return(1); -} - - -static int -need_head_child(struct mdoc *mdoc, int tok, int pos) -{ - struct mdoc_node *n; - - assert(mdoc->last); - n = mdoc->last; - - assert(MDOC_BLOCK == n->type); - assert(n->child); - - n = n->child; - - if (MDOC_HEAD != n->type) - return(mdoc_err(mdoc, tok, pos, ERR_CHILD_HEAD)); - if (n->child) + if (MDOC_HEAD != mdoc->last->type) return(1); - return(mdoc_err(mdoc, tok, pos, ERR_CHILD_HEAD)); + if (mdoc->last->child) + return(1); + return(mdoc_err(mdoc, ERR_ARGS_GE1)); } static int -args_Sh(struct mdoc *mdoc, int tok, int pos, - int sz, const char *args[], - int argc, const struct mdoc_arg *argv) +pre_prologue(struct mdoc *mdoc, struct mdoc_node *node) { - enum mdoc_sec sec; - sec = mdoc_atosec((size_t)sz, args); - if (SEC_CUSTOM != sec && sec < mdoc->sec_lastn) - if ( ! mdoc_warn(mdoc, tok, pos, WARN_SEC_OO)) - return(0); - if (SEC_BODY == mdoc->sec_last && SEC_NAME != sec) - return(mdoc_err(mdoc, tok, pos, ERR_SEC_NAME)); + if (SEC_PROLOGUE != mdoc->sec_lastn) + return(mdoc_verr(mdoc, node, ERR_SEC_NPROLOGUE)); + assert(MDOC_ELEM == node->type); - return(1); -} + /* Check for ordering. */ + switch (node->data.elem.tok) { + case (MDOC_Os): + if (mdoc->meta.title[0] && mdoc->meta.date) + break; + return(mdoc_verr(mdoc, node, ERR_SEC_PROLOGUE_OO)); + case (MDOC_Dt): + if (0 == mdoc->meta.title[0] && mdoc->meta.date) + break; + return(mdoc_verr(mdoc, node, ERR_SEC_PROLOGUE_OO)); + case (MDOC_Dd): + if (0 == mdoc->meta.title[0] && 0 == mdoc->meta.date) + break; + return(mdoc_verr(mdoc, node, ERR_SEC_PROLOGUE_OO)); + default: + abort(); + /* NOTREACHED */ + } -static int -args_bool(struct mdoc *mdoc, int tok, int pos, - int sz, const char *args[], - int argc, const struct mdoc_arg *argv) -{ + /* Check for repetition. */ - assert(1 == sz); - if (xstrcmp(args[0], "on")) - return(1); - if (xstrcmp(args[0], "off")) - return(1); - return(mdoc_err(mdoc, tok, pos, ERR_SYNTAX_ARGBAD)); -} - - -static int -args_ref(struct mdoc *mdoc, int tok, int pos, - int sz, const char *args[], - int argc, const struct mdoc_arg *argv) -{ - struct mdoc_node *n; - - assert(mdoc->last); - for (n = mdoc->last ; n; n = n->parent) { - if (MDOC_BLOCK != n->type) - continue; - if (MDOC_Rs != n->data.block.tok) - break; - return(1); + switch (node->data.elem.tok) { + case (MDOC_Os): + if (0 == mdoc->meta.os[0]) + return(1); + break; + case (MDOC_Dd): + if (0 == mdoc->meta.date) + return(1); + break; + case (MDOC_Dt): + if (0 == mdoc->meta.title[0]) + return(1); + break; + default: + abort(); + /* NOTREACHED */ } - return(mdoc_err(mdoc, tok, pos, ERR_SCOPE_NOCTX)); + return(mdoc_verr(mdoc, node, ERR_SEC_PROLOGUE_REP)); } +/* + * Warn if sections (those that are with a known title, such as NAME, + * DESCRIPTION, and so forth) are out of the conventional order. + */ static int -args_Xr(struct mdoc *mdoc, int tok, int pos, - int sz, const char *args[], - int argc, const struct mdoc_arg *argv) +post_sh(struct mdoc *mdoc) { + enum mdoc_sec sec; + int i; + struct mdoc_node *n; + char *args[MDOC_LINEARG_MAX]; - if (1 == sz) + if (MDOC_HEAD != mdoc->last->type) return(1); - if (0 == sz) - return(mdoc_err(mdoc, tok, pos, ERR_ARGS_GE1)); + + assert(MDOC_Sh == mdoc->last->data.head.tok); - if (MSEC_DEFAULT == mdoc_atomsec(args[1])) - return(mdoc_err(mdoc, tok, pos, ERR_SYNTAX_ARGFORM)); - return(1); -} + n = mdoc->last->child; + assert(n); + for (i = 0; n && i < MDOC_LINEARG_MAX; n = n->next, i++) { + assert(MDOC_TEXT == n->type); + assert(NULL == n->child); + assert(n->data.text.string); + args[i] = n->data.text.string; + } -static int -args_At(struct mdoc *mdoc, int tok, int pos, - int sz, const char *args[], - int argc, const struct mdoc_arg *argv) -{ - int i; - - if (0 == sz) + sec = mdoc_atosec((size_t)i, (const char **)args); + if (SEC_CUSTOM == sec) return(1); + if (sec > mdoc->sec_lastn) + return(1); - i = 0; - if (ATT_DEFAULT == mdoc_atoatt(args[i])) - i++; - - for ( ; i < sz; i++) { - if ( ! mdoc_isdelim(args[i])) - continue; - return(mdoc_err(mdoc, tok, pos, ERR_SYNTAX_NOPUNCT)); - } - return(1); + if (sec == mdoc->sec_lastn) + return(mdoc_warn(mdoc, WARN_SEC_REP)); + return(mdoc_warn(mdoc, WARN_SEC_OO)); } -static int -args_blocknest(struct mdoc *mdoc, int tok, int pos, - int sz, const char *args[], - int argc, const struct mdoc_arg *argv) +int +mdoc_valid_pre(struct mdoc *mdoc, struct mdoc_node *node) { - struct mdoc_node *node; + int t; - /* - * We can't be nested within any other block displays (or really - * any other kind of display, although Bd is the only multi-line - * one that will show up). - */ - assert(mdoc->last); - - /* LINTED */ - for (node = mdoc->last; node; node = node->parent) { - if (node->type != MDOC_BLOCK) - continue; - if (node->data.block.tok != MDOC_Bd) - continue; + switch (node->type) { + case (MDOC_BODY): + t = node->data.body.tok; break; + case (MDOC_ELEM): + t = node->data.elem.tok; + break; + case (MDOC_BLOCK): + t = node->data.block.tok; + break; + case (MDOC_HEAD): + t = node->data.head.tok; + break; + default: + return(1); } - if (NULL == node) + + if (NULL == mdoc_valids[t].pre) return(1); - return(mdoc_err(mdoc, tok, pos, ERR_SCOPE_NONEST)); + return((*mdoc_valids[t].pre)(mdoc, node)); } int -mdoc_valid_pre(struct mdoc *mdoc, int tok, int pos, - int sz, const char *args[], - int argc, const struct mdoc_arg *argv) +mdoc_valid_post(struct mdoc *mdoc) { + v_post *p; + int t; - assert(tok < MDOC_MAX); - if (mdoc_valids[tok].sz) - if ( ! (*mdoc_valids[tok].sz)(mdoc, tok, pos, sz)) - return(0); + switch (mdoc->last->type) { + case (MDOC_BODY): + t = mdoc->last->data.body.tok; + break; + case (MDOC_ELEM): + t = mdoc->last->data.elem.tok; + break; + case (MDOC_BLOCK): + t = mdoc->last->data.block.tok; + break; + case (MDOC_HEAD): + t = mdoc->last->data.head.tok; + break; + default: + return(1); + } - if (NULL == mdoc_valids[tok].args) + if (NULL == mdoc_valids[t].post) return(1); - return((*mdoc_valids[tok].args)(mdoc, - tok, pos, sz, args, argc, argv)); -} + for (p = mdoc_valids[t].post; *p; p++) + if ( ! (*p)(mdoc)) + return(0); -int -mdoc_valid_post(struct mdoc *mdoc, int tok, int pos) -{ - - if (NULL == mdoc_valids[tok].post) - return(1); - return((*mdoc_valids[tok].post)(mdoc, tok, pos)); + return(1); } +