diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2002-06-11 21:12:12 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2002-06-11 21:12:12 +0000 |
commit | b1c15445b12ccbda5a402ec56b487665b69747ee (patch) | |
tree | 39735876bf91b2f6bf39bfb577853773ffc0f705 /usr.bin/make/cond.h | |
parent | e7478c049fc780b84e5d9267b380f93757391a22 (diff) |
This is the first step in sanitizing the conditional parser.
Change the conditional recognition algorithm:
scan for a sequence of alphabetic characters, hash it, and compare it against
a small table (using ohash functions).
This makes Cond_Eval entry more logical, and allows for some shortcuts in
recognizing .include, .for, .undef.
This also means that conditionals must have an intervening blank between
the keyword and the actual test, e.g.,
.ifA
will no longer work.
(but no-one actually uses this, and it's highly obfuscated)
Okay miod@.
Diffstat (limited to 'usr.bin/make/cond.h')
-rw-r--r-- | usr.bin/make/cond.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/make/cond.h b/usr.bin/make/cond.h index 7a98b3af0d5..8369b35462e 100644 --- a/usr.bin/make/cond.h +++ b/usr.bin/make/cond.h @@ -1,7 +1,7 @@ #ifndef COND_H #define COND_H /* $OpenPackages$ */ -/* $OpenBSD: cond.h,v 1.1 2001/05/23 12:34:41 espie Exp $ */ +/* $OpenBSD: cond.h,v 1.2 2002/06/11 21:12:11 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -36,6 +36,9 @@ #define COND_PARSE 0 /* Parse the next lines */ #define COND_SKIP 1 /* Skip the next lines */ #define COND_INVALID 2 /* Not a conditional statement */ +#define COND_ISFOR 3 +#define COND_ISUNDEF 4 +#define COND_ISINCLUDE 5 /* whattodo = Cond_Eval(line); * Parses a conditional expression (without the leading dot), |