summaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2004-04-15 14:21:10 +0000
committerSimon Tatham <anakin@pobox.com>2004-04-15 14:21:10 +0000
commitf2e716fd7036686f88c9af153a9d69ded4dc4363 (patch)
tree09712ae7de5d30484326e180de201022879aa652 /input.c
parente1c8ba107a92ccc79facb1453d297a9f89ec8dcc (diff)
downloadhalibut-f2e716fd7036686f88c9af153a9d69ded4dc4363.zip
halibut-f2e716fd7036686f88c9af153a9d69ded4dc4363.tar.gz
halibut-f2e716fd7036686f88c9af153a9d69ded4dc4363.tar.bz2
halibut-f2e716fd7036686f88c9af153a9d69ded4dc4363.tar.xz
Support the \W{...}\i\c{...} combination used in the NASM manual.
Halibut is now capable of reading the old NASM manual with only minor modifications, and probably doing a much better job of formatting it than rdsrc.pl ever did. (Certainly much _faster_!) [originally from svn r4081]
Diffstat (limited to 'input.c')
-rw-r--r--input.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/input.c b/input.c
index cb6cf9c..efce410 100644
--- a/input.c
+++ b/input.c
@@ -1189,12 +1189,43 @@ static void read_file(paragraph ***ret, input *in, indexdata *idx) {
* delimiting the text marked by the link.
*/
dtor(t), t = get_token(in);
- /*
- * Special cases: \W{}\c, \W{}\e, \W{}\cw
- */
sitem = mknew(struct stack_item);
sitem->fpos = wd.fpos;
sitem->type = stack_hyper;
+ /*
+ * Special cases: \W{}\i, \W{}\ii
+ */
+ if (t.type == tok_cmd &&
+ (t.cmd == c_i || t.cmd == c_ii)) {
+ if (indexing) {
+ error(err_nestedindex, &t.pos);
+ } else {
+ /* Add an index-reference word with no
+ * text as yet */
+ wd.type = word_IndexRef;
+ wd.text = NULL;
+ wd.alt = NULL;
+ wd.aux = 0;
+ wd.breaks = FALSE;
+ indexword = addword(wd, &whptr);
+ /* Set up a rdstring to read the
+ * index text */
+ indexstr = nullrs;
+ /* Flags so that we do the Right
+ * Things with text */
+ index_visible = (type != c_I);
+ index_downcase = (type == c_ii);
+ indexing = TRUE;
+ idxwordlist = NULL;
+ idximplicit = &idxwordlist;
+
+ sitem->type |= stack_idx;
+ }
+ dtor(t), t = get_token(in);
+ }
+ /*
+ * Special cases: \W{}\c, \W{}\e, \W{}\cw
+ */
if (t.type == tok_cmd &&
(t.cmd == c_e || t.cmd == c_c || t.cmd == c_cw)) {
if (style != word_Normal)