From owner-cvs-src@FreeBSD.ORG Mon Apr 11 07:20:10 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C33E316A4CE; Mon, 11 Apr 2005 07:20:10 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A337A43D1D; Mon, 11 Apr 2005 07:20:10 +0000 (GMT) (envelope-from harti@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j3B7KApY034956; Mon, 11 Apr 2005 07:20:10 GMT (envelope-from harti@repoman.freebsd.org) Received: (from harti@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j3B7KAIx034955; Mon, 11 Apr 2005 07:20:10 GMT (envelope-from harti) Message-Id: <200504110720.j3B7KAIx034955@repoman.freebsd.org> From: Hartmut Brandt Date: Mon, 11 Apr 2005 07:20:10 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/usr.bin/make cond.c cond.h for.c for.h parse.c parse.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2005 07:20:10 -0000 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