From owner-p4-projects@FreeBSD.ORG Fri Jul 7 17:54:33 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C0BAE16A4E5; Fri, 7 Jul 2006 17:54:33 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8473C16A4E1 for ; Fri, 7 Jul 2006 17:54:33 +0000 (UTC) (envelope-from swhitman@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4640B43D45 for ; Fri, 7 Jul 2006 17:54:33 +0000 (GMT) (envelope-from swhitman@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k67HsXSk055295 for ; Fri, 7 Jul 2006 17:54:33 GMT (envelope-from swhitman@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k67HsXcP055292 for perforce@freebsd.org; Fri, 7 Jul 2006 17:54:33 GMT (envelope-from swhitman@FreeBSD.org) Date: Fri, 7 Jul 2006 17:54:33 GMT Message-Id: <200607071754.k67HsXcP055292@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to swhitman@FreeBSD.org using -f From: Spencer Whitman To: Perforce Change Reviews Cc: Subject: PERFORCE change 100908 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jul 2006 17:54:34 -0000 http://perforce.freebsd.org/chv.cgi?CH=100908 Change 100908 by swhitman@swhitman_joethecat on 2006/07/07 17:53:55 Added hooks for other preprocessor # functions Affected files ... .. //depot/projects/soc2006/swhitman-K_Kernel_Meta-Language/k/cpp.c#9 edit .. //depot/projects/soc2006/swhitman-K_Kernel_Meta-Language/k/lexer.c#7 edit .. //depot/projects/soc2006/swhitman-K_Kernel_Meta-Language/k/test.h#2 edit Differences ... ==== //depot/projects/soc2006/swhitman-K_Kernel_Meta-Language/k/cpp.c#9 (text+ko) ==== @@ -226,6 +226,11 @@ cppfile(cfs->h, r); } +/* + * Define statment should be of the form: + * #define NAME(vars) value + * If value continues along more than one line, it should end with a \\n + */ static void cpp_define(CPP_ARGS) { @@ -235,6 +240,14 @@ } static void +cpp_undef(CPP_ARGS) +{ + /* struct cppfilestate *cfs __unused, const char *h __unused, + const char *b __unused, const char *e __unused */ + printf("#undef of %V\n",String(b,e)); +} + +static void cppchunk(struct cppfilestate *cfs, const char *s, const char *e) { /* NOTE: cfs-> is uninitalized for first call to cppchunk */ @@ -255,7 +268,13 @@ cpp_func *func; } cpp_kw[] = { { "define", 0, cpp_define }, - { "ifdef", 0, NULL }, + { "undef", 0, cpp_undef }, + /* { "ifdef", 0, NULL }, */ + /* { "ifndef", 0, NULL }, */ + /* { "endif", 0, NULL }, */ + /* { "if defined", 0, NULL }, */ + /* { "else", 0, NULL }, */ + /* { "elif", 0, NULL }, */ { "error", 0, cpp_error }, { "include", 0, cpp_include }, { "pragma", 0, cpp_pragma }, ==== //depot/projects/soc2006/swhitman-K_Kernel_Meta-Language/k/lexer.c#7 (text+ko) ==== ==== //depot/projects/soc2006/swhitman-K_Kernel_Meta-Language/k/test.h#2 (text+ko) ==== @@ -1,5 +1,5 @@ #define HI 10 -#define ' +char * bla = "one" # "two" typedef void * void_star;