GNU bug report logs -
#46055
[PATCH] Add rust lang to etags
Previous Next
Reported by: Pierre-Antoine Rouby <contact <at> parouby.fr>
Date: Sat, 23 Jan 2021 19:03:01 UTC
Severity: normal
Tags: fixed
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 46055 in the body.
You can then email your comments to 46055 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Sat, 23 Jan 2021 19:03:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Pierre-Antoine Rouby <contact <at> parouby.fr>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 23 Jan 2021 19:03:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
* lib-src/etags.c (Rust_functions): New function to make tags for rust
files.
(Rust_help, Rust_suffixes): New constant.
---
lib-src/etags.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/lib-src/etags.c b/lib-src/etags.c
index b5c18e0e01..8243861c69 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -366,6 +366,7 @@ #define xrnew(op, n, m) ((op) = xnrealloc (op, n, (m) * sizeof *(op)))
static void Prolog_functions (FILE *);
static void Python_functions (FILE *);
static void Ruby_functions (FILE *);
+static void Rust_functions (FILE *);
static void Scheme_functions (FILE *);
static void TeX_commands (FILE *);
static void Texinfo_nodes (FILE *);
@@ -752,6 +753,12 @@ #define STDIN 0x1001 /* returned by getopt_long on --parse-stdin */
static const char *Ruby_interpreters [] =
{ "ruby", NULL };
+static const char *Rust_suffixes [] =
+ { "rs", NULL };
+static const char Rust_help [] =
+ "In Rust code, tags anything defined with 'fn', 'enum', \n\
+'struct' or 'macro_rules!'.";
+
/* Can't do the `SCM' or `scm' prefix with a version number. */
static const char *Scheme_suffixes [] =
{ "oak", "sch", "scheme", "SCM", "scm", "SM", "sm", "ss", "t", NULL };
@@ -836,6 +843,7 @@ #define STDIN 0x1001 /* returned by getopt_long on --parse-stdin */
NULL, Python_interpreters },
{ "ruby", Ruby_help, Ruby_functions, Ruby_suffixes,
Ruby_filenames, Ruby_interpreters },
+ { "rust", Rust_help, Rust_functions, Rust_suffixes },
{ "scheme", Scheme_help, Scheme_functions, Scheme_suffixes },
{ "tex", TeX_help, TeX_commands, TeX_suffixes },
{ "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes },
@@ -5019,6 +5027,47 @@ Ruby_functions (FILE *inf)
}
}
+
+/*
+ * Rust support
+ * Look for:
+ * - fn: Function
+ * - struct: Structure
+ * - enum: Enumeration
+ * - macro_rules!: Macro
+ */
+static void
+Rust_functions (FILE *inf)
+{
+ char *cp, *name;
+
+ LOOP_ON_INPUT_LINES(inf, lb, cp)
+ {
+ cp = skip_spaces(cp);
+ name = cp;
+
+ // Skip 'pub' keyworld
+ (void)LOOKING_AT (cp, "pub");
+
+ // Look for define
+ if (LOOKING_AT (cp, "fn")
+ || LOOKING_AT (cp, "enum")
+ || LOOKING_AT (cp, "struct")
+ || LOOKING_AT (cp, "macro_rules!"))
+ {
+ cp = skip_spaces (cp);
+ name = cp;
+
+ while (!notinname (*cp))
+ cp++;
+
+ make_tag (name, cp - name, true,
+ lb.buffer, cp - lb.buffer + 1,
+ lineno, linecharno);
+ }
+ }
+}
+
/*
* PHP support
--
2.29.2
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Sat, 23 Jan 2021 20:01:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 46055 <at> debbugs.gnu.org (full text, mbox):
Pierre-Antoine Rouby <contact <at> parouby.fr> writes:
> * lib-src/etags.c (Rust_functions): New function to make tags for rust
> files.
> (Rust_help, Rust_suffixes): New constant.
Thanks; looks good to me.
This patch is too big to apply without an FSF copyright assignment,
though. Would you be willing to sign such paperwork?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Sat, 23 Jan 2021 20:24:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 46055 <at> debbugs.gnu.org (full text, mbox):
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Sat, 23 Jan 2021 20:59:56 +0100
> Cc: 46055 <at> debbugs.gnu.org
>
> Pierre-Antoine Rouby <contact <at> parouby.fr> writes:
>
> > * lib-src/etags.c (Rust_functions): New function to make tags for rust
> > files.
> > (Rust_help, Rust_suffixes): New constant.
>
> Thanks; looks good to me.
>
> This patch is too big to apply without an FSF copyright assignment,
> though. Would you be willing to sign such paperwork?
Please don't forget to update etags.1 as well.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Mon, 25 Jan 2021 10:09:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 46055 <at> debbugs.gnu.org (full text, mbox):
Hi,
Thanks for review.
On 23/01/2021 21:23, Eli Zaretskii wrote:
>> From: Lars Ingebrigtsen <larsi <at> gnus.org>
>> Date: Sat, 23 Jan 2021 20:59:56 +0100
>> Cc: 46055 <at> debbugs.gnu.org
>>
>> Pierre-Antoine Rouby <contact <at> parouby.fr> writes:
>>
>>> * lib-src/etags.c (Rust_functions): New function to make tags for rust
>>> files.
>>> (Rust_help, Rust_suffixes): New constant.
>>
>> Thanks; looks good to me.
>>
>> This patch is too big to apply without an FSF copyright assignment,
>> though. Would you be willing to sign such paperwork?
Yes, no problem, who can I sign it ?
> Please don't forget to update etags.1 as well.
Ok, I have update 'etags.1' and 'maintaining.texi'. Updated patch coming
soon.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Mon, 25 Jan 2021 10:10:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 46055 <at> debbugs.gnu.org (full text, mbox):
parouby <contact <at> parouby.fr> writes:
>>> This patch is too big to apply without an FSF copyright assignment,
>>> though. Would you be willing to sign such paperwork?
>
> Yes, no problem, who can I sign it ?
Great; here's the form to get started:
Please email the following information to assign <at> gnu.org, and we
will send you the assignment form for your past and future changes.
Please use your full legal name (in ASCII characters) as the subject
line of the message.
----------------------------------------------------------------------
REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES
[What is the name of the program or package you're contributing to?]
Emacs
[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]
[Do you have an employer who might have a basis to claim to own
your changes? Do you attend a school which might make such a claim?]
[For the copyright registration, what country are you a citizen of?]
[What year were you born?]
[Please write your email address here.]
[Please write your postal address here.]
[Which files have you changed so far, and which new files have you written
so far?]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Mon, 25 Jan 2021 10:19:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 46055 <at> debbugs.gnu.org (full text, mbox):
* lib-src/etags.c (Rust_functions): New function to make tags for rust
files.
(Rust_help, Rust_suffixes): New constant.
* doc/emacs/maintaining.texi (Tag Syntax): Add Rust item.
* doc/man/etags.1: Add Rust.
---
doc/emacs/maintaining.texi | 4 ++++
doc/man/etags.1 | 2 +-
lib-src/etags.c | 49 ++++++++++++++++++++++++++++++++++++++
3 files changed, 54 insertions(+), 1 deletion(-)
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 415815473e..0f96dc65d1 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -2639,6 +2639,10 @@ Tag Syntax
@item
In Ruby code, @code{def} or @code{class} or @code{module} at the
beginning of a line generate a tag. Constants also generate tags.
+
+@item
+In Rust code, tags anything defined with @code{fn}, @code{enum},
+@code{struct} or @code{macro_rules!}.
@end itemize
You can also generate tags based on regexp matching (@pxref{Etags
diff --git a/doc/man/etags.1 b/doc/man/etags.1
index c5c15fb182..354f6ca88b 100644
--- a/doc/man/etags.1
+++ b/doc/man/etags.1
@@ -51,7 +51,7 @@ format understood by
\&. Both forms of the program understand
the syntax of C, Objective C, C++, Java, Fortran, Ada, Cobol, Erlang,
Forth, Go, HTML, LaTeX, Emacs Lisp/Common Lisp, Lua, Makefile, Pascal, Perl,
-Ruby, PHP, PostScript, Python, Prolog, Scheme and
+Ruby, Rust, PHP, PostScript, Python, Prolog, Scheme and
most assembler\-like syntaxes.
Both forms read the files specified on the command line, and write a tag
table (defaults: \fBTAGS\fP for \fBetags\fP, \fBtags\fP for
diff --git a/lib-src/etags.c b/lib-src/etags.c
index b5c18e0e01..8243861c69 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -366,6 +366,7 @@ #define xrnew(op, n, m) ((op) = xnrealloc (op, n, (m) * sizeof *(op)))
static void Prolog_functions (FILE *);
static void Python_functions (FILE *);
static void Ruby_functions (FILE *);
+static void Rust_functions (FILE *);
static void Scheme_functions (FILE *);
static void TeX_commands (FILE *);
static void Texinfo_nodes (FILE *);
@@ -752,6 +753,12 @@ #define STDIN 0x1001 /* returned by getopt_long on --parse-stdin */
static const char *Ruby_interpreters [] =
{ "ruby", NULL };
+static const char *Rust_suffixes [] =
+ { "rs", NULL };
+static const char Rust_help [] =
+ "In Rust code, tags anything defined with 'fn', 'enum', \n\
+'struct' or 'macro_rules!'.";
+
/* Can't do the `SCM' or `scm' prefix with a version number. */
static const char *Scheme_suffixes [] =
{ "oak", "sch", "scheme", "SCM", "scm", "SM", "sm", "ss", "t", NULL };
@@ -836,6 +843,7 @@ #define STDIN 0x1001 /* returned by getopt_long on --parse-stdin */
NULL, Python_interpreters },
{ "ruby", Ruby_help, Ruby_functions, Ruby_suffixes,
Ruby_filenames, Ruby_interpreters },
+ { "rust", Rust_help, Rust_functions, Rust_suffixes },
{ "scheme", Scheme_help, Scheme_functions, Scheme_suffixes },
{ "tex", TeX_help, TeX_commands, TeX_suffixes },
{ "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes },
@@ -5019,6 +5027,47 @@ Ruby_functions (FILE *inf)
}
}
+
+/*
+ * Rust support
+ * Look for:
+ * - fn: Function
+ * - struct: Structure
+ * - enum: Enumeration
+ * - macro_rules!: Macro
+ */
+static void
+Rust_functions (FILE *inf)
+{
+ char *cp, *name;
+
+ LOOP_ON_INPUT_LINES(inf, lb, cp)
+ {
+ cp = skip_spaces(cp);
+ name = cp;
+
+ // Skip 'pub' keyworld
+ (void)LOOKING_AT (cp, "pub");
+
+ // Look for define
+ if (LOOKING_AT (cp, "fn")
+ || LOOKING_AT (cp, "enum")
+ || LOOKING_AT (cp, "struct")
+ || LOOKING_AT (cp, "macro_rules!"))
+ {
+ cp = skip_spaces (cp);
+ name = cp;
+
+ while (!notinname (*cp))
+ cp++;
+
+ make_tag (name, cp - name, true,
+ lb.buffer, cp - lb.buffer + 1,
+ lineno, linecharno);
+ }
+ }
+}
+
/*
* PHP support
--
2.29.2
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Mon, 25 Jan 2021 14:35:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 46055 <at> debbugs.gnu.org (full text, mbox):
* lib-src/etags.c (Rust_functions): New function to make tags for rust
files.
(Rust_help, Rust_suffixes): New constant.
* doc/emacs/maintaining.texi (Tag Syntax): Add Rust item.
* doc/man/etags.1: Add Rust.
---
doc/emacs/maintaining.texi | 4 +++
doc/man/etags.1 | 2 +-
lib-src/etags.c | 51 ++++++++++++++++++++++++++++++++++++++
3 files changed, 56 insertions(+), 1 deletion(-)
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 415815473e..0f96dc65d1 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -2639,6 +2639,10 @@ Tag Syntax
@item
In Ruby code, @code{def} or @code{class} or @code{module} at the
beginning of a line generate a tag. Constants also generate tags.
+
+@item
+In Rust code, tags anything defined with @code{fn}, @code{enum},
+@code{struct} or @code{macro_rules!}.
@end itemize
You can also generate tags based on regexp matching (@pxref{Etags
diff --git a/doc/man/etags.1 b/doc/man/etags.1
index c5c15fb182..354f6ca88b 100644
--- a/doc/man/etags.1
+++ b/doc/man/etags.1
@@ -51,7 +51,7 @@ format understood by
\&. Both forms of the program understand
the syntax of C, Objective C, C++, Java, Fortran, Ada, Cobol, Erlang,
Forth, Go, HTML, LaTeX, Emacs Lisp/Common Lisp, Lua, Makefile, Pascal, Perl,
-Ruby, PHP, PostScript, Python, Prolog, Scheme and
+Ruby, Rust, PHP, PostScript, Python, Prolog, Scheme and
most assembler\-like syntaxes.
Both forms read the files specified on the command line, and write a tag
table (defaults: \fBTAGS\fP for \fBetags\fP, \fBtags\fP for
diff --git a/lib-src/etags.c b/lib-src/etags.c
index b5c18e0e01..d703183cef 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -366,6 +366,7 @@ #define xrnew(op, n, m) ((op) = xnrealloc (op, n, (m) * sizeof *(op)))
static void Prolog_functions (FILE *);
static void Python_functions (FILE *);
static void Ruby_functions (FILE *);
+static void Rust_entries (FILE *);
static void Scheme_functions (FILE *);
static void TeX_commands (FILE *);
static void Texinfo_nodes (FILE *);
@@ -752,6 +753,12 @@ #define STDIN 0x1001 /* returned by getopt_long on --parse-stdin */
static const char *Ruby_interpreters [] =
{ "ruby", NULL };
+static const char *Rust_suffixes [] =
+ { "rs", NULL };
+static const char Rust_help [] =
+ "In Rust code, tags anything defined with 'fn', 'enum', \n\
+'struct' or 'macro_rules!'.";
+
/* Can't do the `SCM' or `scm' prefix with a version number. */
static const char *Scheme_suffixes [] =
{ "oak", "sch", "scheme", "SCM", "scm", "SM", "sm", "ss", "t", NULL };
@@ -836,6 +843,7 @@ #define STDIN 0x1001 /* returned by getopt_long on --parse-stdin */
NULL, Python_interpreters },
{ "ruby", Ruby_help, Ruby_functions, Ruby_suffixes,
Ruby_filenames, Ruby_interpreters },
+ { "rust", Rust_help, Rust_entries, Rust_suffixes },
{ "scheme", Scheme_help, Scheme_functions, Scheme_suffixes },
{ "tex", TeX_help, TeX_commands, TeX_suffixes },
{ "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes },
@@ -5019,6 +5027,49 @@ Ruby_functions (FILE *inf)
}
}
+
+/*
+ * Rust support
+ * Look for:
+ * - fn: Function
+ * - struct: Structure
+ * - enum: Enumeration
+ * - macro_rules!: Macro
+ */
+static void
+Rust_entries (FILE *inf)
+{
+ char *cp, *name;
+ bool is_func = false;
+
+ LOOP_ON_INPUT_LINES(inf, lb, cp)
+ {
+ cp = skip_spaces(cp);
+ name = cp;
+
+ // Skip 'pub' keyworld
+ (void)LOOKING_AT (cp, "pub");
+
+ // Look for define
+ if ((is_func = LOOKING_AT (cp, "fn"))
+ || LOOKING_AT (cp, "enum")
+ || LOOKING_AT (cp, "struct")
+ || (is_func = LOOKING_AT (cp, "macro_rules!")))
+ {
+ cp = skip_spaces (cp);
+ name = cp;
+
+ while (!notinname (*cp))
+ cp++;
+
+ make_tag (name, cp - name, is_func,
+ lb.buffer, cp - lb.buffer + 1,
+ lineno, linecharno);
+ is_func = false;
+ }
+ }
+}
+
/*
* PHP support
--
2.29.2
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Wed, 21 Apr 2021 03:20:03 GMT)
Full text and
rfc822 format available.
Message #26 received at 46055 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> parouby <contact <at> parouby.fr> writes:
>
>>>> This patch is too big to apply without an FSF copyright assignment,
>>>> though. Would you be willing to sign such paperwork?
>>
>> Yes, no problem, who can I sign it ?
>
> Great; here's the form to get started:
That was 12 weeks ago. Is this copyright assignment all processed and
finished now?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Wed, 21 Apr 2021 08:55:01 GMT)
Full text and
rfc822 format available.
Message #29 received at 46055 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Tue, 20 Apr 2021 22:19:52 -0500
> Cc: parouby <contact <at> parouby.fr>, Eli Zaretskii <eliz <at> gnu.org>, 46055 <at> debbugs.gnu.org
>
> >>>> This patch is too big to apply without an FSF copyright assignment,
> >>>> though. Would you be willing to sign such paperwork?
> >>
> >> Yes, no problem, who can I sign it ?
> >
> > Great; here's the form to get started:
>
> That was 12 weeks ago. Is this copyright assignment all processed and
> finished now?
Yes, the assignment is on file now.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Wed, 21 Apr 2021 12:40:02 GMT)
Full text and
rfc822 format available.
Message #32 received at 46055 <at> debbugs.gnu.org (full text, mbox):
Your patch looks good to me, but I didn't test it.
I have one question, though. In "test/manual/etags", we have manual
tests for etags including source code examples and which tags they
should generate. Should we add a manual test also for Rust?
Pierre-Antoine Rouby <contact <at> parouby.fr> writes:
> * lib-src/etags.c (Rust_functions): New function to make tags for rust
> files.
> (Rust_help, Rust_suffixes): New constant.
> * doc/emacs/maintaining.texi (Tag Syntax): Add Rust item.
> * doc/man/etags.1: Add Rust.
> ---
> doc/emacs/maintaining.texi | 4 +++
> doc/man/etags.1 | 2 +-
> lib-src/etags.c | 51 ++++++++++++++++++++++++++++++++++++++
> 3 files changed, 56 insertions(+), 1 deletion(-)
>
> diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
> index 415815473e..0f96dc65d1 100644
> --- a/doc/emacs/maintaining.texi
> +++ b/doc/emacs/maintaining.texi
> @@ -2639,6 +2639,10 @@ Tag Syntax
> @item
> In Ruby code, @code{def} or @code{class} or @code{module} at the
> beginning of a line generate a tag. Constants also generate tags.
> +
> +@item
> +In Rust code, tags anything defined with @code{fn}, @code{enum},
> +@code{struct} or @code{macro_rules!}.
> @end itemize
>
> You can also generate tags based on regexp matching (@pxref{Etags
> diff --git a/doc/man/etags.1 b/doc/man/etags.1
> index c5c15fb182..354f6ca88b 100644
> --- a/doc/man/etags.1
> +++ b/doc/man/etags.1
> @@ -51,7 +51,7 @@ format understood by
> \&. Both forms of the program understand
> the syntax of C, Objective C, C++, Java, Fortran, Ada, Cobol, Erlang,
> Forth, Go, HTML, LaTeX, Emacs Lisp/Common Lisp, Lua, Makefile, Pascal, Perl,
> -Ruby, PHP, PostScript, Python, Prolog, Scheme and
> +Ruby, Rust, PHP, PostScript, Python, Prolog, Scheme and
> most assembler\-like syntaxes.
> Both forms read the files specified on the command line, and write a tag
> table (defaults: \fBTAGS\fP for \fBetags\fP, \fBtags\fP for
> diff --git a/lib-src/etags.c b/lib-src/etags.c
> index b5c18e0e01..d703183cef 100644
> --- a/lib-src/etags.c
> +++ b/lib-src/etags.c
> @@ -366,6 +366,7 @@ #define xrnew(op, n, m) ((op) = xnrealloc (op, n, (m) * sizeof *(op)))
> static void Prolog_functions (FILE *);
> static void Python_functions (FILE *);
> static void Ruby_functions (FILE *);
> +static void Rust_entries (FILE *);
> static void Scheme_functions (FILE *);
> static void TeX_commands (FILE *);
> static void Texinfo_nodes (FILE *);
> @@ -752,6 +753,12 @@ #define STDIN 0x1001 /* returned by getopt_long on --parse-stdin */
> static const char *Ruby_interpreters [] =
> { "ruby", NULL };
>
> +static const char *Rust_suffixes [] =
> + { "rs", NULL };
> +static const char Rust_help [] =
> + "In Rust code, tags anything defined with 'fn', 'enum', \n\
> +'struct' or 'macro_rules!'.";
> +
> /* Can't do the `SCM' or `scm' prefix with a version number. */
> static const char *Scheme_suffixes [] =
> { "oak", "sch", "scheme", "SCM", "scm", "SM", "sm", "ss", "t", NULL };
> @@ -836,6 +843,7 @@ #define STDIN 0x1001 /* returned by getopt_long on --parse-stdin */
> NULL, Python_interpreters },
> { "ruby", Ruby_help, Ruby_functions, Ruby_suffixes,
> Ruby_filenames, Ruby_interpreters },
> + { "rust", Rust_help, Rust_entries, Rust_suffixes },
> { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes },
> { "tex", TeX_help, TeX_commands, TeX_suffixes },
> { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes },
> @@ -5019,6 +5027,49 @@ Ruby_functions (FILE *inf)
> }
> }
>
> +
> +/*
> + * Rust support
> + * Look for:
> + * - fn: Function
> + * - struct: Structure
> + * - enum: Enumeration
> + * - macro_rules!: Macro
> + */
> +static void
> +Rust_entries (FILE *inf)
> +{
> + char *cp, *name;
> + bool is_func = false;
> +
> + LOOP_ON_INPUT_LINES(inf, lb, cp)
> + {
> + cp = skip_spaces(cp);
> + name = cp;
> +
> + // Skip 'pub' keyworld
> + (void)LOOKING_AT (cp, "pub");
> +
> + // Look for define
> + if ((is_func = LOOKING_AT (cp, "fn"))
> + || LOOKING_AT (cp, "enum")
> + || LOOKING_AT (cp, "struct")
> + || (is_func = LOOKING_AT (cp, "macro_rules!")))
> + {
> + cp = skip_spaces (cp);
> + name = cp;
> +
> + while (!notinname (*cp))
> + cp++;
> +
> + make_tag (name, cp - name, is_func,
> + lb.buffer, cp - lb.buffer + 1,
> + lineno, linecharno);
> + is_func = false;
> + }
> + }
> +}
> +
>
> /*
> * PHP support
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Wed, 21 Apr 2021 15:03:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 46055 <at> debbugs.gnu.org (full text, mbox):
>I have one question, though. In "test/manual/etags", we have manual
>tests for etags including source code examples and which tags they
>should generate. Should we add a manual test also for Rust?
I'd say definitely yes. Ideally, the regression tests should be updated
every time a new feature is added or a bug is corrected.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Mon, 17 May 2021 15:22:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 46055 <at> debbugs.gnu.org (full text, mbox):
Pierre-Antoine Rouby <contact <at> parouby.fr> writes:
> * lib-src/etags.c (Rust_functions): New function to make tags for rust
> files.
> (Rust_help, Rust_suffixes): New constant.
> * doc/emacs/maintaining.texi (Tag Syntax): Add Rust item.
> * doc/man/etags.1: Add Rust.
Thanks; applied to Emacs 28.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Mon, 17 May 2021 15:24:01 GMT)
Full text and
rfc822 format available.
Message #41 received at 46055 <at> debbugs.gnu.org (full text, mbox):
Francesco Potortì <pot <at> gnu.org> writes:
>>I have one question, though. In "test/manual/etags", we have manual
>>tests for etags including source code examples and which tags they
>>should generate. Should we add a manual test also for Rust?
>
> I'd say definitely yes. Ideally, the regression tests should be updated
> every time a new feature is added or a bug is corrected.
I looked into adding a Rust test there... but it's unclear how, or what
it's checking. A "make check" in that directory fails. I looked in
admin/* for an explanation of what's supposed to be done in
test/manual/etags, but found nothing.
Perhaps a README should be added to that directory to explain how to use
it?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Removed tag(s) patch.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Mon, 17 May 2021 15:25:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Mon, 17 May 2021 15:53:02 GMT)
Full text and
rfc822 format available.
Message #46 received at 46055 <at> debbugs.gnu.org (full text, mbox):
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Mon, 17 May 2021 17:23:44 +0200
> Cc: Stefan Kangas <stefan <at> marxist.se>,
> Pierre-Antoine Rouby <contact <at> parouby.fr>, 46055 <at> debbugs.gnu.org
>
> Francesco Potortì <pot <at> gnu.org> writes:
>
> >>I have one question, though. In "test/manual/etags", we have manual
> >>tests for etags including source code examples and which tags they
> >>should generate. Should we add a manual test also for Rust?
> >
> > I'd say definitely yes. Ideally, the regression tests should be updated
> > every time a new feature is added or a bug is corrected.
>
> I looked into adding a Rust test there... but it's unclear how, or what
> it's checking. A "make check" in that directory fails. I looked in
> admin/* for an explanation of what's supposed to be done in
> test/manual/etags, but found nothing.
>
> Perhaps a README should be added to that directory to explain how to use
> it?
Just say "make" in that directory, it should finish with no errors.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Mon, 17 May 2021 16:09:01 GMT)
Full text and
rfc822 format available.
Message #49 received at 46055 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> Just say "make" in that directory, it should finish with no errors.
If I do that, I get an enormous diff in the terminal, and it then
finishes with:
y-src/parse.c,520
#define YYBISON 4,64
make[1]: *** [Makefile:63: ediff_1] Error 1
make[1]: Leaving directory '/home/larsi/src/emacs/trunk/test/manual/etags'
make: *** [Makefile:54: check] Error 2
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Mon, 17 May 2021 16:15:02 GMT)
Full text and
rfc822 format available.
Message #52 received at 46055 <at> debbugs.gnu.org (full text, mbox):
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: pot <at> gnu.org, stefan <at> marxist.se, contact <at> parouby.fr,
> 46055 <at> debbugs.gnu.org
> Date: Mon, 17 May 2021 18:08:09 +0200
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > Just say "make" in that directory, it should finish with no errors.
>
> If I do that, I get an enormous diff in the terminal, and it then
> finishes with:
>
> y-src/parse.c,520
> #define YYBISON 4,64
> make[1]: *** [Makefile:63: ediff_1] Error 1
> make[1]: Leaving directory '/home/larsi/src/emacs/trunk/test/manual/etags'
> make: *** [Makefile:54: check] Error 2
Try again, I just fixed this.
The problem is that people make mechanic changes to all our sources,
and forget that files in this particular directory shall NOT be
changed, or else if they are, the '*good*' files with expected results
should be updated at that very moment. Examples of such changes
include: yearly update of copyright years, removal of obsolete
variables across the board, spelling fixes, etc. Just do
git log test/manual/etags/c-src/abbrev.c
and you will see what I mean. Each such change breaks this test
suite, and requires manual inspection of the diffs to convince
ourselves that the new results are correct and not bugs.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Mon, 17 May 2021 16:28:01 GMT)
Full text and
rfc822 format available.
Message #55 received at 46055 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> The problem is that people make mechanic changes to all our sources,
> and forget that files in this particular directory shall NOT be
> changed, or else if they are, the '*good*' files with expected results
> should be updated at that very moment. Examples of such changes
> include: yearly update of copyright years, removal of obsolete
> variables across the board, spelling fixes, etc. Just do
>
> git log test/manual/etags/c-src/abbrev.c
>
> and you will see what I mean.
Yes, I was most puzzled when trying to find out just what was going on
in that directory. I wondered whether the test cases were somehow...
copying files from the main Emacs source directories (since many of them
have the same names and are updated in this way).
> Each such change breaks this test suite, and requires manual
> inspection of the diffs to convince ourselves that the new results are
> correct and not bugs.
Yup. So I think a README to explain what's going on in that directory
would be helpful. :-)
I've now added a test case for Rust. (Note: I don't know Rust at all.)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Mon, 17 May 2021 16:28:01 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 28.1, send any further explanations to
46055 <at> debbugs.gnu.org and Pierre-Antoine Rouby <contact <at> parouby.fr>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Mon, 17 May 2021 16:28:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Mon, 17 May 2021 16:33:02 GMT)
Full text and
rfc822 format available.
Message #62 received at 46055 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> I've now added a test case for Rust.
I spoke too soon -- I guessed that ETAGS.good_1 was to be copied over
from ETAGS after saying "make", but I have no idea what the other good_*
files are supposed to be, so now "make" complains again.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Mon, 17 May 2021 16:42:02 GMT)
Full text and
rfc822 format available.
Message #65 received at 46055 <at> debbugs.gnu.org (full text, mbox):
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: pot <at> gnu.org, stefan <at> marxist.se, contact <at> parouby.fr,
> 46055 <at> debbugs.gnu.org
> Date: Mon, 17 May 2021 18:31:53 +0200
>
> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
> > I've now added a test case for Rust.
>
> I spoke too soon -- I guessed that ETAGS.good_1 was to be copied over
> from ETAGS after saying "make", but I have no idea what the other good_*
> files are supposed to be, so now "make" complains again.
The test suite uses the same source files for 7 different runs, each
time invoking etags with different command-line switches. So whenever
you add a new source file, you need to run make, and each time it
fails, copy the left-over ETAGS file into ETAGS.good_1, ETAGS.good_2,
etc., one by one.
Which I just did.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Tue, 18 May 2021 13:46:02 GMT)
Full text and
rfc822 format available.
Message #68 received at 46055 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> The test suite uses the same source files for 7 different runs, each
> time invoking etags with different command-line switches. So whenever
> you add a new source file, you need to run make, and each time it
> fails, copy the left-over ETAGS file into ETAGS.good_1, ETAGS.good_2,
> etc., one by one.
Ah, I see. Putting this info in a README in that directory would be
helpful for the next person who wonders how it works, though.
> Which I just did.
Thanks.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46055
; Package
emacs
.
(Thu, 20 May 2021 10:05:01 GMT)
Full text and
rfc822 format available.
Message #71 received at 46055 <at> debbugs.gnu.org (full text, mbox):
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: pot <at> gnu.org, stefan <at> marxist.se, contact <at> parouby.fr,
> 46055 <at> debbugs.gnu.org
> Date: Tue, 18 May 2021 15:44:50 +0200
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > The test suite uses the same source files for 7 different runs, each
> > time invoking etags with different command-line switches. So whenever
> > you add a new source file, you need to run make, and each time it
> > fails, copy the left-over ETAGS file into ETAGS.good_1, ETAGS.good_2,
> > etc., one by one.
>
> Ah, I see. Putting this info in a README in that directory would be
> helpful for the next person who wonders how it works, though.
Done.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 17 Jun 2021 11:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 1 day ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.