On 01/04/2012 01:34 PM, [email protected] wrote:
Hi.
diff --git a/src/dfa.c b/src/dfa.c
index 58505bf..2386f76 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -91,6 +91,13 @@ typedef int charclass[CHARCLASS_INTS];
errors that the cast doesn't. */
static inline unsigned char to_uchar (char ch) { return ch; }
+/* Contexts tell us whether a character is a newline or a word constituent.
+ Word-constituent characters are those that satisfy iswalnum(), plus '_'. */
+
+#define CTX_NONE 1
+#define CTX_LETTER 2
+#define CTX_NEWLINE 4
+
Is there any reason, in this day and age, to still be using defines
instead of enums for something like this?
No real reason, except going along with the rest of the dfa code.
Note that you wouldn't always get meaningful names when debugging,
because more than one bit can be set.
Paolo