From: Joel Brobecker <brobecker@gnat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] Make word-break-characters language independent (1/3)
Date: Thu, 02 Oct 2003 05:22:00 -0000 [thread overview]
Message-ID: <20031002052210.GT933@gnat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1382 bytes --]
This is the first patch of a series of 3 that follow up on a discussion
about making the word_break_characters language dependent. See:
http://sources.redhat.com/ml/gdb-patches/2003-09/msg00399.html.
The plan is as follow:
1. Add a new function in language: default_word_break_characters()
2. Add a new field la_word_break_characters in struct language_defn
Update all instances of this structure to set this new field
to default_word_break_characters.
3. Remove gdb_completer_word_break_characters and
get_gdb_completer_word_break_characters. Replace them with
either default_word_break_characters or the current_language
la_word_break_characters.
In the end, GDB's behavior is entirely identical. But it will allow
Ada to define it's own set of word-break-characters, allowing it to
fine-tune the completion mechanism.
I divided this change in 3 patches to show the process I used, and
to show that the changes are mostly mechanical (and hopefully correct
:-). If necessary, I can break them up further (for instance patch3
can be broken up in two steps), or submit all 3 of them in one patch.
Let me know.
Attached is the first patch.
2003-10-01 J. Brobecker <brobecker@gnat.com>
* language.h (default_word_break_characters): Add prototype.
* language.c (default_word_break_characters): New function.
Ok to apply?
--
Joel
[-- Attachment #2: patch1.diff --]
[-- Type: text/plain, Size: 1261 bytes --]
Index: language.c
===================================================================
RCS file: /cvs/src/src/gdb/language.c,v
retrieving revision 1.38
diff -u -p -r1.38 language.c
--- language.c 25 Sep 2003 08:40:45 -0000 1.38
+++ language.c 2 Oct 2003 04:59:56 -0000
@@ -1176,6 +1176,15 @@ language_demangle (const struct language
return NULL;
}
+/* Return the default string containing the list of characters
+ delimiting words. This is a reasonable default value that
+ most languages should be able to use. */
+
+char *
+default_word_break_characters (void)
+{
+ return " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,-";
+}
/* Define the language that is no language. */
Index: language.h
===================================================================
RCS file: /cvs/src/src/gdb/language.h,v
retrieving revision 1.22
diff -u -p -r1.22 language.h
--- language.h 25 Sep 2003 08:40:45 -0000 1.22
+++ language.h 2 Oct 2003 04:59:56 -0000
@@ -502,4 +502,7 @@ extern CORE_ADDR skip_language_trampolin
extern char *language_demangle (const struct language_defn *current_language,
const char *mangled, int options);
+/* Splitting strings into words. */
+extern char *default_word_break_characters (void);
+
#endif /* defined (LANGUAGE_H) */
next reply other threads:[~2003-10-02 5:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-02 5:22 Joel Brobecker [this message]
2003-10-02 5:51 ` Andrew Cagney
2003-10-03 18:06 ` Eli Zaretskii
2003-10-06 22:42 ` Joel Brobecker
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=20031002052210.GT933@gnat.com \
--to=brobecker@gnat.com \
--cc=gdb-patches@sources.redhat.com \
/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