Date: Mon, 11 Apr 2005 07:20:10 +0000 (UTC) From: Hartmut Brandt <harti@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.bin/make cond.c cond.h for.c for.h parse.c parse.h Message-ID: <200504110720.j3B7KAIx034955@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
harti 2005-04-11 07:20:10 UTC FreeBSD src repository Modified files: usr.bin/make cond.c cond.h for.c for.h parse.c parse.h Log: 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. Revision Changes Path 1.46 +155 -163 src/usr.bin/make/cond.c 1.3 +20 -1 src/usr.bin/make/cond.h 1.41 +105 -107 src/usr.bin/make/for.c 1.2 +4 -1 src/usr.bin/make/for.h 1.95 +387 -324 src/usr.bin/make/parse.c 1.3 +0 -1 src/usr.bin/make/parse.h
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504110720.j3B7KAIx034955>