version 1.19, 2015/01/28 15:03:45 |
version 1.24, 2018/12/14 05:18:03 |
|
|
#include <string.h> |
#include <string.h> |
|
|
#include "mandoc.h" |
#include "mandoc.h" |
|
#include "tbl.h" |
#include "libmandoc.h" |
#include "libmandoc.h" |
#include "libroff.h" |
#include "tbl_int.h" |
|
|
#define KEY_DPOINT 0 |
#define KEY_DPOINT 0 |
#define KEY_DELIM 1 |
#define KEY_DELIM 1 |
Line 80 arg(struct tbl_node *tbl, int ln, const char *p, int * |
|
Line 81 arg(struct tbl_node *tbl, int ln, const char *p, int * |
|
|
|
switch (key) { |
switch (key) { |
case KEY_DELIM: |
case KEY_DELIM: |
mandoc_msg(MANDOCERR_TBLEQN, tbl->parse, ln, *pos, NULL); |
mandoc_msg(MANDOCERR_TBLOPT_EQN, |
|
ln, *pos, "%.*s", len, p + *pos); |
want = 2; |
want = 2; |
break; |
break; |
case KEY_TAB: |
case KEY_TAB: |
Line 98 arg(struct tbl_node *tbl, int ln, const char *p, int * |
|
Line 100 arg(struct tbl_node *tbl, int ln, const char *p, int * |
|
break; |
break; |
default: |
default: |
abort(); |
abort(); |
/* NOTREACHED */ |
|
} |
} |
|
|
if (len == 0) |
if (len == 0) |
mandoc_msg(MANDOCERR_TBLOPT_NOARG, |
mandoc_msg(MANDOCERR_TBLOPT_NOARG, ln, *pos, |
tbl->parse, ln, *pos, keys[key].name); |
"%s", keys[key].name); |
else if (want && len != want) |
else if (want && len != want) |
mandoc_vmsg(MANDOCERR_TBLOPT_ARGSZ, |
mandoc_msg(MANDOCERR_TBLOPT_ARGSZ, ln, *pos, |
tbl->parse, ln, *pos, "%s want %d have %d", |
"%s want %d have %d", keys[key].name, want, len); |
keys[key].name, want, len); |
|
|
|
*pos += len; |
*pos += len; |
if (p[*pos] == ')') |
if (p[*pos] == ')') |
Line 141 tbl_option(struct tbl_node *tbl, int ln, const char *p |
|
Line 141 tbl_option(struct tbl_node *tbl, int ln, const char *p |
|
len++; |
len++; |
|
|
if (len == 0) { |
if (len == 0) { |
mandoc_vmsg(MANDOCERR_TBLOPT_ALPHA, |
mandoc_msg(MANDOCERR_TBLOPT_ALPHA, |
tbl->parse, ln, pos, "%c", p[pos]); |
ln, pos, "%c", p[pos]); |
pos++; |
pos++; |
continue; |
continue; |
} |
} |
Line 156 tbl_option(struct tbl_node *tbl, int ln, const char *p |
|
Line 156 tbl_option(struct tbl_node *tbl, int ln, const char *p |
|
i++; |
i++; |
|
|
if (i == KEY_MAXKEYS) { |
if (i == KEY_MAXKEYS) { |
mandoc_vmsg(MANDOCERR_TBLOPT_BAD, tbl->parse, |
mandoc_msg(MANDOCERR_TBLOPT_BAD, |
ln, pos, "%.*s", len, p + pos); |
ln, pos, "%.*s", len, p + pos); |
pos += len; |
pos += len; |
continue; |
continue; |