* [RFA] Make word-break-characters language independent (1/3)
@ 2003-10-02 5:22 Joel Brobecker
2003-10-02 5:51 ` Andrew Cagney
0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2003-10-02 5:22 UTC (permalink / raw)
To: gdb-patches
[-- 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) */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFA] Make word-break-characters language independent (1/3)
2003-10-02 5:22 [RFA] Make word-break-characters language independent (1/3) Joel Brobecker
@ 2003-10-02 5:51 ` Andrew Cagney
2003-10-03 18:06 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2003-10-02 5:51 UTC (permalink / raw)
To: Joel Brobecker, Eli Zaretskii; +Cc: gdb-patches
> 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.
Eli, I think this is really completer stuff. Ok?
(the language vector stuff works fine).
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFA] Make word-break-characters language independent (1/3)
2003-10-02 5:51 ` Andrew Cagney
@ 2003-10-03 18:06 ` Eli Zaretskii
2003-10-06 22:42 ` Joel Brobecker
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2003-10-03 18:06 UTC (permalink / raw)
To: Andrew Cagney; +Cc: brobecker, gdb-patches
> Date: Thu, 02 Oct 2003 01:50:52 -0400
> From: Andrew Cagney <ac131313@redhat.com>
>
> Eli, I think this is really completer stuff. Ok?
The completion-related patches are okay with me. Thanks, Joel.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFA] Make word-break-characters language independent (1/3)
2003-10-03 18:06 ` Eli Zaretskii
@ 2003-10-06 22:42 ` Joel Brobecker
0 siblings, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2003-10-06 22:42 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Andrew Cagney, gdb-patches
On Fri, Oct 03, 2003 at 09:02:28PM +0200, Eli Zaretskii wrote:
> > Date: Thu, 02 Oct 2003 01:50:52 -0400
> > From: Andrew Cagney <ac131313@redhat.com>
> >
> > Eli, I think this is really completer stuff. Ok?
>
> The completion-related patches are okay with me. Thanks, Joel.
Thank you Eli. The patches have been checked in.
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-10-06 22:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-02 5:22 [RFA] Make word-break-characters language independent (1/3) Joel Brobecker
2003-10-02 5:51 ` Andrew Cagney
2003-10-03 18:06 ` Eli Zaretskii
2003-10-06 22:42 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox