summaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>1999-10-22 13:24:30 +0000
committerSimon Tatham <anakin@pobox.com>1999-10-22 13:24:30 +0000
commit8022a13d69f8f24c54df96b140bd9eb84b23a5f1 (patch)
tree5fe79100c90e3ce0c846f10653cccb40fa1f322a /input.c
parent3ea5db22e2af7b4446528de78b4c51bc3cd0559b (diff)
downloadhalibut-8022a13d69f8f24c54df96b140bd9eb84b23a5f1.zip
halibut-8022a13d69f8f24c54df96b140bd9eb84b23a5f1.tar.gz
halibut-8022a13d69f8f24c54df96b140bd9eb84b23a5f1.tar.bz2
halibut-8022a13d69f8f24c54df96b140bd9eb84b23a5f1.tar.xz
Introduce word types for attributed spaces, so backends can distinguish
between emphasis _like_ _this_ and _like this_ [originally from svn r245]
Diffstat (limited to 'input.c')
-rw-r--r--input.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/input.c b/input.c
index 32eca3b..97d732e 100644
--- a/input.c
+++ b/input.c
@@ -417,7 +417,7 @@ static void read_file(paragraph ***ret, input *in, index *idx) {
paragraph par;
word wd, **whptr, **idximplicit;
wchar_t utext[2], *wdtext;
- int style;
+ int style, spcstyle;
int already;
int iswhite, seenwhite;
int type;
@@ -618,6 +618,7 @@ static void read_file(paragraph ***ret, input *in, index *idx) {
*/
parsestk = stk_new();
style = word_Normal;
+ spcstyle = word_WhiteSpace;
indexing = FALSE;
seenwhite = TRUE;
while (t.type != tok_eop && t.type != tok_eof) {
@@ -630,7 +631,7 @@ static void read_file(paragraph ***ret, input *in, index *idx) {
if (whptr == &par.words)
break; /* strip whitespace at start of para */
wd.text = NULL;
- wd.type = word_WhiteSpace;
+ wd.type = spcstyle;
wd.alt = NULL;
wd.fpos = t.pos;
if (indexing)
@@ -672,8 +673,10 @@ static void read_file(paragraph ***ret, input *in, index *idx) {
whptr = sitem->whptr;
idximplicit = sitem->idximplicit;
}
- if (sitem->type & stack_style)
+ if (sitem->type & stack_style) {
style = word_Normal;
+ spcstyle = word_WhiteSpace;
+ }
if (sitem->type & stack_idx) {
indexword->text = ustrdup(indexstr.text);
if (index_downcase)
@@ -810,6 +813,7 @@ static void read_file(paragraph ***ret, input *in, index *idx) {
style = (t.cmd == c_c ? word_Code :
t.cmd == c_cw ? word_WeakCode :
word_Emph);
+ spcstyle = tospacestyle(style);
sitem->type |= stack_style;
}
dtor(t), t = get_token(in);
@@ -842,6 +846,7 @@ static void read_file(paragraph ***ret, input *in, index *idx) {
style = (type == c_c ? word_Code :
type == c_cw ? word_WeakCode :
word_Emph);
+ spcstyle = tospacestyle(style);
sitem = mknew(struct stack_item);
sitem->type = stack_style;
stk_push(parsestk, sitem);
@@ -874,6 +879,7 @@ static void read_file(paragraph ***ret, input *in, index *idx) {
style = (t.cmd == c_c ? word_Code :
t.cmd == c_cw ? word_WeakCode :
word_Emph);
+ spcstyle = tospacestyle(style);
sitem->type |= stack_style;
}
dtor(t), t = get_token(in);