From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.lisp.guile.devel Subject: [PATCH] Make guile-func-name-check handle inhibition directives. Date: Fri, 25 Jun 2010 14:23:17 +0200 Message-ID: <87tyore1xm.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1277499712 19706 80.91.229.12 (25 Jun 2010 21:01:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 25 Jun 2010 21:01:52 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jun 25 23:01:51 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OSG21-0004H9-2F for guile-devel@m.gmane.org; Fri, 25 Jun 2010 23:01:49 +0200 Original-Received: from localhost ([127.0.0.1]:37311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSFnY-0007hM-O8 for guile-devel@m.gmane.org; Fri, 25 Jun 2010 16:46:52 -0400 Original-Received: from [140.186.70.92] (port=46279 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSD2m-0003wG-JH for guile-devel@gnu.org; Fri, 25 Jun 2010 13:50:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OS820-0004WW-79 for guile-devel@gnu.org; Fri, 25 Jun 2010 08:29:17 -0400 Original-Received: from smtp209.alice.it ([82.57.200.105]:37164) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OS81z-0004Sn-RU for guile-devel@gnu.org; Fri, 25 Jun 2010 08:29:16 -0400 Original-Received: from ambire.localdomain (95.244.64.152) by smtp209.alice.it (8.5.124.08) id 4C1A275900914F15 for guile-devel@gnu.org; Fri, 25 Jun 2010 14:29:14 +0200 Original-Received: from ttn by ambire.localdomain with local (Exim 4.69) (envelope-from ) id 1OS7zd-0004wS-8P for guile-devel@gnu.org; Fri, 25 Jun 2010 14:26:49 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10574 Archived-At: --=-=-= This changes the strident warnings for pairs.c into a simple reminder (not really a warning) that the Programmer Knows Best! (Ignore that snickering sound you hear from the computer...) thi __________________________________ --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0006-maint-Make-guile-func-name-check-handle-inhibition-d.patch >From 0c94e1b8d5b80d6f5d811da77e68ede51fd98f47 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 25 Jun 2010 12:13:04 +0200 Subject: [PATCH 6/8] [maint] Make guile-func-name-check handle inhibition directives. * libguile/guile-func-name-check: Add handling for directives in the scanned file to inhibit processing. * libguile/pairs.c: Inhibit guile-func-name-check for c[ad]+r block. --- libguile/guile-func-name-check | 15 ++++++++++++++- libguile/pairs.c | 3 +++ 2 files changed, 17 insertions(+), 1 deletions(-) diff --git a/libguile/guile-func-name-check b/libguile/guile-func-name-check index 5a20275..83a08a3 100644 --- a/libguile/guile-func-name-check +++ b/libguile/guile-func-name-check @@ -24,6 +24,18 @@ BEGIN { filename = ARGV[1]; in_a_func = 0; + inhibit = 0; +} + +# By default, processing is uninhibited. In the scanned file, the comment: +# /* guile-func-name-check: TEXT */ +# inhibits processing if TEXT is anything but "ok", and displays TEXT to stderr. +# This is used in pairs.c, for example. +/^.. guile-func-name-check: / { + inhibit = ($3 != "ok"); + sub (/^.../, ""); + sub (/...$/, ""); + print filename ":" NR ": " $0 > "/dev/stderr" } # Extract the function name from "SCM_DEFINE (foo, ...". @@ -32,7 +44,8 @@ BEGIN { func_name = $0; sub (/^[^\(\n]*\([ \t]*/, "", func_name); sub (/[ \t]*,.*/, "", func_name); - in_a_func = 1; + if (! inhibit) + in_a_func = 1; } # Check that for "SCM_DEFINE (foo, ...)", we see: diff --git a/libguile/pairs.c b/libguile/pairs.c index da0d7b9..9a41f06 100644 --- a/libguile/pairs.c +++ b/libguile/pairs.c @@ -143,6 +143,9 @@ SCM_DEFINE (scm_set_cdr_x, "set-cdr!", 2, 0, 0, while (pattern_var); \ return tree +/* The following comment is a directive for guile-func-name-check, q.v. */ + +/* guile-func-name-check: no thanks! (disabled for c[ad]+r (rest of file)) */ SCM_DEFINE (scm_cdr, "cdr", 1, 0, 0, (SCM x), "") { -- 1.6.3.2 --=-=-=--