From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: "'Eli Zaretskii'" <eliz@gnu.org>
Cc: <gdb-patches@sourceware.org>
Subject: [PATCH] gdbadmin/ss/gdb_ari.sh modify editCase/UCASE rules
Date: Mon, 20 Apr 2009 16:01:00 -0000 [thread overview]
Message-ID: <000c01c9c1d1$2cffd860$86ff8920$@u-strasbg.fr> (raw)
In-Reply-To: <83bpqyml9s.fsf@gnu.org>
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
next prev parent reply other threads:[~2009-04-20 16:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-14 21:49 [RFA] gdbadmin/ss/gdb_ari.sh update UCASE rule Pierre Muller
2009-04-15 7:25 ` Eli Zaretskii
2009-04-20 16:01 ` Pierre Muller [this message]
2009-04-20 17:15 ` [PATCH] gdbadmin/ss/gdb_ari.sh modify editCase/UCASE rules Andreas Schwab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000c01c9c1d1$2cffd860$86ff8920$@u-strasbg.fr' \
--to=muller@ics.u-strasbg.fr \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox