version 1.56, 2015/03/01 13:39:51 |
version 1.57, 2015/03/01 16:57:39 |
|
|
dodisplay(struct texi *p, enum texicmd cmd, size_t *pos) |
dodisplay(struct texi *p, enum texicmd cmd, size_t *pos) |
{ |
{ |
|
|
|
advanceeoln(p, pos, 1); |
|
|
switch (cmd) { |
switch (cmd) { |
case (TEXICMD_FORMAT): |
case (TEXICMD_FORMAT): |
case (TEXICMD_SMALLFORMAT): |
case (TEXICMD_SMALLFORMAT): |
Line 953 dodisplay(struct texi *p, enum texicmd cmd, size_t *po |
|
Line 955 dodisplay(struct texi *p, enum texicmd cmd, size_t *po |
|
} |
} |
|
|
p->seenvs = 1; |
p->seenvs = 1; |
/* FIXME: ignore and parseeoln. */ |
|
advanceeoln(p, pos, 1); |
|
parseto(p, pos, texitoks[cmd].tok); |
parseto(p, pos, texitoks[cmd].tok); |
teximacro(p, "Ed"); |
teximacro(p, "Ed"); |
} |
} |
|
|
doexample(struct texi *p, enum texicmd cmd, size_t *pos) |
doexample(struct texi *p, enum texicmd cmd, size_t *pos) |
{ |
{ |
|
|
teximacro(p, "Bd -literal -offset indent"); |
|
/* FIXME: ignore and parseeoln. */ |
|
advanceeoln(p, pos, 1); |
advanceeoln(p, pos, 1); |
|
|
|
teximacro(p, "Bd -literal -offset indent"); |
p->literal++; |
p->literal++; |
parseto(p, pos, texitoks[cmd].tok); |
parseto(p, pos, texitoks[cmd].tok); |
p->literal--; |
p->literal--; |
Line 983 dobye(struct texi *p, enum texicmd cmd, size_t *pos) |
|
Line 983 dobye(struct texi *p, enum texicmd cmd, size_t *pos) |
|
static void |
static void |
dotitle(struct texi *p, enum texicmd cmd, size_t *pos) |
dotitle(struct texi *p, enum texicmd cmd, size_t *pos) |
{ |
{ |
size_t start, end; |
size_t start; |
|
|
while (*pos < BUFSZ(p) && isws(BUF(p)[*pos])) |
while (*pos < BUFSZ(p) && isws(BUF(p)[*pos])) |
advance(p, pos); |
advance(p, pos); |
start = end = *pos; |
|
while (end < BUFSZ(p) && '\n' != BUF(p)[end]) |
/* We want to suck down the entire line, inclusive \n. */ |
end++; |
start = *pos; |
if (end < BUFSZ(p)) |
while (*pos < BUFSZ(p) && '\n' != BUF(p)[*pos]) { |
end++; |
if ('@' == BUF(p)[*pos]) |
advanceeoln(p, pos, 1); |
advance(p, pos); |
|
advance(p, pos); |
|
} |
|
if (*pos < BUFSZ(p)) |
|
advance(p, pos); |
|
|
|
/* Copy this into a buffer. */ |
free(p->subtitle); |
free(p->subtitle); |
p->subtitle = malloc(end - start + 1); |
if (NULL == (p->subtitle = malloc(*pos - start + 1))) |
if (NULL == p->subtitle) |
|
texiabort(p, NULL); |
texiabort(p, NULL); |
memcpy(p->subtitle, &BUF(p)[start], end - start); |
memcpy(p->subtitle, &BUF(p)[start], *pos - start); |
p->subtitle[end - start] = '\0'; |
p->subtitle[*pos - start] = '\0'; |
} |
} |
|
|
static void |
static void |
|
|
dosp(struct texi *p, enum texicmd cmd, size_t *pos) |
dosp(struct texi *p, enum texicmd cmd, size_t *pos) |
{ |
{ |
|
|
|
advanceeoln(p, pos, 1); |
if (p->literal) |
if (p->literal) |
texiputchar(p, '\n'); |
texiputchar(p, '\n'); |
else |
else |
texivspace(p); |
texivspace(p); |
/* FIXME: ignore and parseeoln. */ |
|
advanceeoln(p, pos, 1); |
|
} |
} |
|
|
static void |
static void |
Line 1681 domultitable(struct texi *p, enum texicmd cmd, size_t |
|
Line 1685 domultitable(struct texi *p, enum texicmd cmd, size_t |
|
|
|
/* Make sure we don't print anything when scanning. */ |
/* Make sure we don't print anything when scanning. */ |
p->ign++; |
p->ign++; |
if ('@' == BUF(p)[*pos]) { |
if (*pos < BUFSZ(p) && '@' == BUF(p)[*pos]) { |
/* |
/* |
* Look for @columnfractions. |
* Look for @columnfractions. |
* We ignore these, but we do use the number of |
* We ignore these, but we do use the number of |
Line 1733 dotable(struct texi *p, enum texicmd cmd, size_t *pos) |
|
Line 1737 dotable(struct texi *p, enum texicmd cmd, size_t *pos) |
|
{ |
{ |
enum texilist sv = p->list; |
enum texilist sv = p->list; |
|
|
|
advanceeoln(p, pos, 1); |
|
|
p->list = TEXILIST_ITEM; |
p->list = TEXILIST_ITEM; |
teximacro(p, "Bl -tag -width Ds"); |
teximacro(p, "Bl -tag -width Ds"); |
/* FIXME: ignore and parseeoln. */ |
|
advanceeoln(p, pos, 1); |
|
p->seenvs = 1; |
p->seenvs = 1; |
parseto(p, pos, texitoks[cmd].tok); |
parseto(p, pos, texitoks[cmd].tok); |
teximacro(p, "El"); |
teximacro(p, "El"); |
Line 1764 doenumerate(struct texi *p, enum texicmd cmd, size_t * |
|
Line 1768 doenumerate(struct texi *p, enum texicmd cmd, size_t * |
|
{ |
{ |
enum texilist sv = p->list; |
enum texilist sv = p->list; |
|
|
|
advanceeoln(p, pos, 1); |
|
|
p->list = TEXILIST_NOITEM; |
p->list = TEXILIST_NOITEM; |
teximacro(p, "Bl -enum"); |
teximacro(p, "Bl -enum"); |
p->seenvs = 1; |
p->seenvs = 1; |
/* FIXME: ignore and parseeoln. */ |
parseto(p, pos, texitoks[cmd].tok); |
advanceeoln(p, pos, 1); |
|
parseto(p, pos, "enumerate"); |
|
teximacro(p, "El"); |
teximacro(p, "El"); |
p->list = sv; |
p->list = sv; |
} |
} |
Line 1779 doitemize(struct texi *p, enum texicmd cmd, size_t *po |
|
Line 1783 doitemize(struct texi *p, enum texicmd cmd, size_t *po |
|
{ |
{ |
enum texilist sv = p->list; |
enum texilist sv = p->list; |
|
|
|
advanceeoln(p, pos, 1); |
|
|
p->list = TEXILIST_NOITEM; |
p->list = TEXILIST_NOITEM; |
teximacro(p, "Bl -bullet"); |
teximacro(p, "Bl -bullet"); |
p->seenvs = 1; |
p->seenvs = 1; |
/* FIXME: ignore and parseeoln. */ |
parseto(p, pos, texitoks[cmd].tok); |
advanceeoln(p, pos, 1); |
|
parseto(p, pos, "itemize"); |
|
teximacro(p, "El"); |
teximacro(p, "El"); |
p->list = sv; |
p->list = sv; |
} |
} |
|
|
doignline(struct texi *p, enum texicmd cmd, size_t *pos) |
doignline(struct texi *p, enum texicmd cmd, size_t *pos) |
{ |
{ |
|
|
/* FIXME: ignore and parseeoln. */ |
advanceeoln(p, pos, 1); |
advanceeoln(p, pos, 1); |
|
} |
} |
|
|
/* |
/* |