From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12100 invoked by alias); 20 Apr 2009 16:01:01 -0000 Received: (qmail 12046 invoked by uid 22791); 20 Apr 2009 16:00:59 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,HK_OBFDOM X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.157) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Apr 2009 16:00:53 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n3KG0kwS038973 ; Mon, 20 Apr 2009 18:00:46 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms3.u-strasbg.fr [IPv6:2001:660:2402:d::12]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n3KG0jgp087671 ; Mon, 20 Apr 2009 18:00:45 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (www-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n3KG0jVK060372 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Mon, 20 Apr 2009 18:00:45 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: "'Eli Zaretskii'" Cc: References: <007201c9bd4a$e64c9d20$b2e5d760$@u-strasbg.fr> <83bpqyml9s.fsf@gnu.org> In-Reply-To: <83bpqyml9s.fsf@gnu.org> Subject: [PATCH] gdbadmin/ss/gdb_ari.sh modify editCase/UCASE rules Date: Mon, 20 Apr 2009 16:01:00 -0000 Message-ID: <000c01c9c1d1$2cffd860$86ff8920$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00511.txt.bz2 Following Eli's suggestion I rewrote the editCase/UCASE awk script to only catch real function implementations. It seems to only catch real cases, at least for editCase. The only risk is that it doesn't find function, if the do not follow the rule of having the open brace at next line. Pierre Muller Pascal language support maintainer for GDB trying to improve the gdb ARI script. PS: tell me if I am wrong, but I had to use /complicated pattern/ { instructions for match } ! /same complicated pattern/ { instructions if no match } "else" does not seem to accepted at that level in gawk. Committed patch: Index: gdb_ari.sh =================================================================== RCS file: /cvs/gdbadmin/ss/gdb_ari.sh,v retrieving revision 1.88 diff -r1.88 gdb_ari.sh 181a182,183 > possible_UCASE = 0 > possible_editCase = 0 466,468c468,479 < /^[A-Z][[:alnum:]_]*[[:space:]]*\(/ { < if (is_yacc_or_lex == 0) { < fail("UCASE function") --- > /^[A-Z][[:alnum:]_]*[[:space:]]*\([^()]*\)[[:space:]]*$/ { > possible_UCASE = 1 > possible_FNR = FNR > } > ! /^[A-Z][[:alnum:]_]*[[:space:]]*\([^()]*\)[[:space:]]*$/ { > if (possible_UCASE == 1) { > if (($0 ~ /^\{/) && (is_yacc_or_lex == 0)) { > store_FNR = FNR > FNR = possible_FNR > fail("UCASE function") > FNR = store_FNR > } 469a481 > possible_UCASE = 0 476,478c488,499 < /^[a-z][a-z0-9_]*[A-Z][a-z0-9A-Z_]*[[:space:]]*\(/ { < if (is_yacc_or_lex == 0) { < fail("editCase function") --- > /^[a-z][a-z0-9_]*[A-Z][a-z0-9A-Z_]*[[:space:]]*\([^()]*\)[[:space:]]*$/ { > possible_editCase = 1 > possible_FNR = FNR > } > ! /^[a-z][a-z0-9_]*[A-Z][a-z0-9A-Z_]*[[:space:]]*\([^()]*\)[[:space:]]*$/ { > if (possible_editCase == 1) { > if (($0 ~ /^\{/) && (is_yacc_or_lex == 0)) { > store_FNR = FNR > FNR = possible_FNR > fail("editCase function") > FNR = store_FNR > } 479a501 > possible_editCase = 0