FreeBSD-Date: 2005/04/11 08:20:09
authorMax Okumoto <okumoto@dragonflybsd.org>
Fri, 15 Apr 2005 21:01:27 +0000 (21:01 +0000)
committerMax Okumoto <okumoto@dragonflybsd.org>
Fri, 15 Apr 2005 21:01:27 +0000 (21:01 +0000)
commit311ba34d576e0faebb178ef8b8f142f0d3534a6d
treeaeeed8f9b2c7c457d2842617d018c28ebf5b56d0
parentfda2a3089c0078668edbc506783940a6a187c329
FreeBSD-Date: 2005/04/11 08:20:09
FreeBSD-Date: 2005/04/11 08:26:21
FreeBSD-Date: 2005/04/11 08:40:54

Author: harti

Rework the directive parsing code. Instead of using a lot of strcmp()s
on every line that starts with a dot use a minimal perfect hash
function and a single strcmp() on the first word after the dot
to find out whether it is really a directive call and, if yes, which
one. Then directly dispatch to a handler function for that directive
(or fall through to the dependency handling code). This makes the
directive parse a little bit more strict about the syntax: the directive
word must be followed by a character that is not alphanumerical and not
an underline (making .undefFOO illegal); .endif and .else can only be
followed by comments.
usr.bin/make/cond.c
usr.bin/make/cond.h
usr.bin/make/for.c
usr.bin/make/for.h
usr.bin/make/main.c
usr.bin/make/parse.c
usr.bin/make/parse.h