summaryrefslogtreecommitdiff
path: root/buttress.h
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 /buttress.h
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 'buttress.h')
-rw-r--r--buttress.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/buttress.h b/buttress.h
index b059322..1ce39d7 100644
--- a/buttress.h
+++ b/buttress.h
@@ -99,22 +99,41 @@ enum {
struct word_Tag {
word *next, *alt;
int type;
+ int aux;
wchar_t *text;
filepos fpos;
};
enum {
+ /* ORDERING CONSTRAINT: these normal-word types ... */
word_Normal,
word_Emph,
word_Code, /* monospaced; `quoted' in text */
word_WeakCode, /* monospaced, normal in text */
+ /* ... must be in the same order as these space types ... */
+ word_WhiteSpace, /* text is NULL or ignorable */
+ word_EmphSpace, /* WhiteSpace when emphasised */
+ word_CodeSpace, /* WhiteSpace when code */
+ word_WkCodeSpace, /* WhiteSpace when weak code */
+ /* END ORDERING CONSTRAINT */
+ word_internal_endattrs,
word_UpperXref, /* \K */
word_LowerXref, /* \k */
word_XrefEnd, /* (invisible; no text) */
word_IndexRef, /* (always an invisible one) */
- word_WhiteSpace, /* text is NULL or ignorable */
word_HyperLink, /* (invisible) */
word_HyperEnd /* (also invisible; no text) */
};
+/* aux values for attributed words */
+enum {
+ attr_Only, /* a lone word with the attribute */
+ attr_First, /* the first of a series */
+ attr_Last, /* the last of a series */
+ attr_Always /* any other part of a series */
+};
+#define isattr(x) ( ( (x) > word_Normal && (x) < word_WhiteSpace ) || \
+ ( (x) > word_WhiteSpace && (x) < word_internal_endattrs ) )
+#define sameattr(x,y) ( (x)-(y) == 0 || (x)-(y) == 4 || (x)-(y) == -4 )
+#define tospacestyle(x) ( (x) + 4 )
/*
* error.c
@@ -231,6 +250,8 @@ char *rdtrimc(rdstringc *rs);
int compare_wordlists(word *a, word *b);
+void mark_attr_ends(paragraph *sourceform);
+
typedef struct tagWrappedLine wrappedline;
struct tagWrappedLine {
wrappedline *next;