version 1.159, 2010/07/04 22:04:04 |
version 1.162, 2010/07/17 12:01:43 |
|
|
#include "mandoc.h" |
#include "mandoc.h" |
#include "chars.h" |
#include "chars.h" |
#include "out.h" |
#include "out.h" |
#include "regs.h" |
|
#include "term.h" |
#include "term.h" |
#include "main.h" |
#include "main.h" |
|
|
Line 366 spec(struct termp *p, const char *word, size_t len) |
|
Line 365 spec(struct termp *p, const char *word, size_t len) |
|
const char *rhs; |
const char *rhs; |
size_t sz; |
size_t sz; |
|
|
rhs = chars_a2ascii(p->symtab, word, len, &sz); |
rhs = chars_spec2str(p->symtab, word, len, &sz); |
if (rhs) |
if (rhs) |
encode(p, rhs, sz); |
encode(p, rhs, sz); |
} |
} |
Line 378 res(struct termp *p, const char *word, size_t len) |
|
Line 377 res(struct termp *p, const char *word, size_t len) |
|
const char *rhs; |
const char *rhs; |
size_t sz; |
size_t sz; |
|
|
rhs = chars_a2res(p->symtab, word, len, &sz); |
rhs = chars_res2str(p->symtab, word, len, &sz); |
if (NULL == rhs) { |
|
rhs = roff_getstrn(word, len); |
|
if (rhs) |
|
sz = strlen(rhs); |
|
} |
|
if (rhs) |
if (rhs) |
encode(p, rhs, sz); |
encode(p, rhs, sz); |
} |
} |
Line 509 term_word(struct termp *p, const char *word) |
|
Line 503 term_word(struct termp *p, const char *word) |
|
|
|
p->flags &= ~TERMP_SENTENCE; |
p->flags &= ~TERMP_SENTENCE; |
|
|
/* FIXME: use strcspn. */ |
|
|
|
while (*word) { |
while (*word) { |
if ('\\' != *word) { |
if ((ssz = strcspn(word, "\\")) > 0) |
encode(p, word, 1); |
encode(p, word, ssz); |
word++; |
|
|
word += ssz; |
|
if ('\\' != *word) |
continue; |
continue; |
} |
|
|
|
seq = ++word; |
seq = ++word; |
sz = a2roffdeco(&deco, &seq, &ssz); |
sz = a2roffdeco(&deco, &seq, &ssz); |
Line 553 term_word(struct termp *p, const char *word) |
|
Line 546 term_word(struct termp *p, const char *word) |
|
* Note that we don't process the pipe: the parser sees it as |
* Note that we don't process the pipe: the parser sees it as |
* punctuation, but we don't in terms of typography. |
* punctuation, but we don't in terms of typography. |
*/ |
*/ |
if (sv[0] && 0 == sv[1]) |
if (sv[0] && '\0' == sv[1]) |
switch (sv[0]) { |
switch (sv[0]) { |
case('('): |
case('('): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |