version 1.63, 2015/03/05 15:18:13 |
version 1.64, 2015/03/07 11:49:32 |
Line 61 static void doitemize(struct texi *, enum texicmd, siz |
|
Line 61 static void doitemize(struct texi *, enum texicmd, siz |
|
static void dolink(struct texi *, enum texicmd, size_t *); |
static void dolink(struct texi *, enum texicmd, size_t *); |
static void domacro(struct texi *, enum texicmd, size_t *); |
static void domacro(struct texi *, enum texicmd, size_t *); |
static void domath(struct texi *, enum texicmd, size_t *); |
static void domath(struct texi *, enum texicmd, size_t *); |
|
#if 0 |
|
static void domenu(struct texi *, enum texicmd, size_t *); |
|
#endif |
static void domultitable(struct texi *, enum texicmd, size_t *); |
static void domultitable(struct texi *, enum texicmd, size_t *); |
static void doquotation(struct texi *, enum texicmd, size_t *); |
static void doquotation(struct texi *, enum texicmd, size_t *); |
static void dotable(struct texi *, enum texicmd, size_t *); |
static void dotable(struct texi *, enum texicmd, size_t *); |
Line 1451 doquotation(struct texi *p, enum texicmd cmd, size_t * |
|
Line 1454 doquotation(struct texi *p, enum texicmd cmd, size_t * |
|
teximacro(p, "Qc"); |
teximacro(p, "Qc"); |
} |
} |
|
|
|
#if 0 |
static void |
static void |
|
domenu(struct texi *p, enum texicmd cmd, size_t *pos) |
|
{ |
|
size_t start; |
|
|
|
if (NULL != p->chapters) { |
|
doignblock(p, cmd, pos); |
|
return; |
|
} |
|
|
|
advanceeoln(p, pos, 1); |
|
|
|
teximacro(p, "Bl -tag -width Ds"); |
|
while (*pos < BUFSZ(p)) { |
|
/* Read to next menu item. */ |
|
while (*pos < BUFSZ(p) && ismspace(BUF(p)[*pos])) |
|
advance(p, pos); |
|
if ('*' != BUF(p)[*pos]) |
|
break; |
|
|
|
assert('*' == BUF(p)[*pos]); |
|
advance(p, pos); |
|
while (*pos < BUFSZ(p) && ismspace(BUF(p)[*pos])) |
|
advance(p, pos); |
|
start = *pos; |
|
while (*pos < BUFSZ(p) && ':' != BUF(p)[*pos]) |
|
advance(p, pos); |
|
if (*pos == BUFSZ(p) || *pos == start) { |
|
texiwarn(p, "empty menu name"); |
|
break; |
|
} |
|
teximacroopen(p, "It"); |
|
teximacroopen(p, "Sx"); |
|
for ( ; start < *pos; start++) |
|
texiputchar(p, BUF(p)[start]); |
|
teximacroclose(p); |
|
teximacroclose(p); |
|
|
|
advance(p, pos); |
|
if (*pos == BUFSZ(p)) { |
|
texiwarn(p, "bad menu syntax"); |
|
break; |
|
} else if (':' != BUF(p)[*pos]) { |
|
while (*pos < BUFSZ(p) && isws(BUF(p)[*pos])) |
|
advance(p, pos); |
|
start = *pos; |
|
while (*pos < BUFSZ(p)) { |
|
switch (BUF(p)[*pos]) { |
|
case ('\t'): |
|
case ('\n'): |
|
case (','): |
|
break; |
|
case ('.'): |
|
if (*pos + 1 == BUFSZ(p)) { |
|
advance(p, pos); |
|
continue; |
|
} |
|
if (' ' == BUF(p)[*pos + 1]) { |
|
advance(p, pos); |
|
break; |
|
} |
|
/* FALLTHROUGH */ |
|
default: |
|
advance(p, pos); |
|
continue; |
|
} |
|
advance(p, pos); |
|
break; |
|
} |
|
} else |
|
advance(p, pos); |
|
|
|
while (*pos < BUFSZ(p) && isws(BUF(p)[*pos])) |
|
advance(p, pos); |
|
|
|
if (*pos == BUFSZ(p)) { |
|
texiwarn(p, "bad menu syntax"); |
|
break; |
|
} |
|
|
|
while (*pos < BUFSZ(p)) { |
|
if ('*' == BUF(p)[*pos]) |
|
break; |
|
if ('\n' != BUF(p)[*pos]) { |
|
texiputchar(p, BUF(p)[*pos]); |
|
advance(p, pos); |
|
continue; |
|
} |
|
advance(p, pos); |
|
while (*pos == BUFSZ(p)) { |
|
texiwarn(p, "bad menu syntax"); |
|
break; |
|
} |
|
if ('\n' == BUF(p)[*pos]) { |
|
advance(p, pos); |
|
break; |
|
} else if ('*' == BUF(p)[*pos]) { |
|
continue; |
|
} else if ('@' == BUF(p)[*pos]) |
|
break; |
|
texiputchar(p, ' '); |
|
} |
|
} |
|
|
|
teximacro(p, "El"); |
|
|
|
doignblock(p, cmd, pos); |
|
} |
|
#endif |
|
|
|
static void |
domath(struct texi *p, enum texicmd cmd, size_t *pos) |
domath(struct texi *p, enum texicmd cmd, size_t *pos) |
{ |
{ |
|
|
Line 1705 doitem(struct texi *p, enum texicmd cmd, size_t *pos) |
|
Line 1819 doitem(struct texi *p, enum texicmd cmd, size_t *pos) |
|
|
|
/* Multitable is using raw tbl(7). */ |
/* Multitable is using raw tbl(7). */ |
if (TEXILIST_TABLE == p->list) { |
if (TEXILIST_TABLE == p->list) { |
texiputchar(p, '\n'); |
if (p->outcol > 0) |
|
texiputchar(p, '\n'); |
return; |
return; |
} |
} |
|
|
Line 1740 dotab(struct texi *p, enum texicmd cmd, size_t *pos) |
|
Line 1855 dotab(struct texi *p, enum texicmd cmd, size_t *pos) |
|
{ |
{ |
|
|
/* This command is only useful in @multitable. */ |
/* This command is only useful in @multitable. */ |
if (TEXILIST_TABLE == p->list) |
if (TEXILIST_TABLE == p->list && p->outcol) |
texiputchar(p, '\t'); |
texiputchar(p, '\t'); |
} |
} |
|
|
Line 1752 domultitable(struct texi *p, enum texicmd cmd, size_t |
|
Line 1867 domultitable(struct texi *p, enum texicmd cmd, size_t |
|
enum texicmd type; |
enum texicmd type; |
size_t i, end, columns; |
size_t i, end, columns; |
|
|
|
texivspace(p); |
p->list = TEXILIST_TABLE; |
p->list = TEXILIST_TABLE; |
/* |
/* |
* TS/TE blocks aren't "in mdoc(7)", so we can disregard the |
* TS/TE blocks aren't "in mdoc(7)", so we can disregard the |
Line 1805 domultitable(struct texi *p, enum texicmd cmd, size_t |
|
Line 1921 domultitable(struct texi *p, enum texicmd cmd, size_t |
|
texiputchar(p, ' '); |
texiputchar(p, ' '); |
texiputchar(p, 'l'); |
texiputchar(p, 'l'); |
} |
} |
texiputchars(p, ".\n"); |
|
|
texiputchar(p, '.'); |
|
texiputchar(p, '\n'); |
p->outmacro++; |
p->outmacro++; |
parseto(p, pos, texitoks[cmd].tok); |
parseto(p, pos, texitoks[cmd].tok); |
p->outmacro--; |
p->outmacro--; |