aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorYuuki Harano2021-05-19 22:02:06 +0900
committerYuuki Harano2021-05-19 22:02:06 +0900
commite48372f8e5722643e37185b004469acd174663f7 (patch)
treeb77ec71bb51856f98d34182eca56322750533017 /lib-src
parentd0fa569b7303c2d893b54d0a7af7a521308a5ed4 (diff)
parent61291e06cc804de2075305c220d31ef6072f28c8 (diff)
downloademacs-e48372f8e5722643e37185b004469acd174663f7.tar.gz
emacs-e48372f8e5722643e37185b004469acd174663f7.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/Makefile.in5
-rw-r--r--lib-src/etags.c51
2 files changed, 53 insertions, 3 deletions
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index 923d0cf5e72..7af89eb380d 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -315,7 +315,7 @@ $(DESTDIR)${archlibdir}: all
315 fi 315 fi
316 316
317.PHONY: install uninstall mostlyclean clean distclean maintainer-clean 317.PHONY: install uninstall mostlyclean clean distclean maintainer-clean
318.PHONY: bootstrap-clean extraclean check tags 318.PHONY: bootstrap-clean check tags
319 319
320install: $(DESTDIR)${archlibdir} 320install: $(DESTDIR)${archlibdir}
321 @echo 321 @echo
@@ -343,6 +343,7 @@ mostlyclean:
343 rm -f core ./*.o ./*.res 343 rm -f core ./*.o ./*.res
344 344
345clean: mostlyclean 345clean: mostlyclean
346 -rm -f seccomp-filter.bpf seccomp-filter.pfc seccomp-filter-exec.bpf seccomp-filter-exec.pfc
346 rm -f ${EXE_FILES} 347 rm -f ${EXE_FILES}
347 348
348distclean: clean 349distclean: clean
@@ -350,8 +351,6 @@ distclean: clean
350 351
351bootstrap-clean maintainer-clean: distclean 352bootstrap-clean maintainer-clean: distclean
352 353
353extraclean: maintainer-clean
354 rm -f ./*~ \#*
355 354
356## Test the contents of the directory. 355## Test the contents of the directory.
357check: 356check:
diff --git a/lib-src/etags.c b/lib-src/etags.c
index b5c18e0e019..d703183cef7 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -366,6 +366,7 @@ static void PS_functions (FILE *);
366static void Prolog_functions (FILE *); 366static void Prolog_functions (FILE *);
367static void Python_functions (FILE *); 367static void Python_functions (FILE *);
368static void Ruby_functions (FILE *); 368static void Ruby_functions (FILE *);
369static void Rust_entries (FILE *);
369static void Scheme_functions (FILE *); 370static void Scheme_functions (FILE *);
370static void TeX_commands (FILE *); 371static void TeX_commands (FILE *);
371static void Texinfo_nodes (FILE *); 372static void Texinfo_nodes (FILE *);
@@ -752,6 +753,12 @@ a line generate a tag. Constants also generate a tag.";
752static const char *Ruby_interpreters [] = 753static const char *Ruby_interpreters [] =
753 { "ruby", NULL }; 754 { "ruby", NULL };
754 755
756static const char *Rust_suffixes [] =
757 { "rs", NULL };
758static const char Rust_help [] =
759 "In Rust code, tags anything defined with 'fn', 'enum', \n\
760'struct' or 'macro_rules!'.";
761
755/* Can't do the `SCM' or `scm' prefix with a version number. */ 762/* Can't do the `SCM' or `scm' prefix with a version number. */
756static const char *Scheme_suffixes [] = 763static const char *Scheme_suffixes [] =
757 { "oak", "sch", "scheme", "SCM", "scm", "SM", "sm", "ss", "t", NULL }; 764 { "oak", "sch", "scheme", "SCM", "scm", "SM", "sm", "ss", "t", NULL };
@@ -836,6 +843,7 @@ static language lang_names [] =
836 NULL, Python_interpreters }, 843 NULL, Python_interpreters },
837 { "ruby", Ruby_help, Ruby_functions, Ruby_suffixes, 844 { "ruby", Ruby_help, Ruby_functions, Ruby_suffixes,
838 Ruby_filenames, Ruby_interpreters }, 845 Ruby_filenames, Ruby_interpreters },
846 { "rust", Rust_help, Rust_entries, Rust_suffixes },
839 { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes }, 847 { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes },
840 { "tex", TeX_help, TeX_commands, TeX_suffixes }, 848 { "tex", TeX_help, TeX_commands, TeX_suffixes },
841 { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes }, 849 { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes },
@@ -5021,6 +5029,49 @@ Ruby_functions (FILE *inf)
5021 5029
5022 5030
5023/* 5031/*
5032 * Rust support
5033 * Look for:
5034 * - fn: Function
5035 * - struct: Structure
5036 * - enum: Enumeration
5037 * - macro_rules!: Macro
5038 */
5039static void
5040Rust_entries (FILE *inf)
5041{
5042 char *cp, *name;
5043 bool is_func = false;
5044
5045 LOOP_ON_INPUT_LINES(inf, lb, cp)
5046 {
5047 cp = skip_spaces(cp);
5048 name = cp;
5049
5050 // Skip 'pub' keyworld
5051 (void)LOOKING_AT (cp, "pub");
5052
5053 // Look for define
5054 if ((is_func = LOOKING_AT (cp, "fn"))
5055 || LOOKING_AT (cp, "enum")
5056 || LOOKING_AT (cp, "struct")
5057 || (is_func = LOOKING_AT (cp, "macro_rules!")))
5058 {
5059 cp = skip_spaces (cp);
5060 name = cp;
5061
5062 while (!notinname (*cp))
5063 cp++;
5064
5065 make_tag (name, cp - name, is_func,
5066 lb.buffer, cp - lb.buffer + 1,
5067 lineno, linecharno);
5068 is_func = false;
5069 }
5070 }
5071}
5072
5073
5074/*
5024 * PHP support 5075 * PHP support
5025 * Look for: 5076 * Look for:
5026 * - /^[ \t]*function[ \t\n]+[^ \t\n(]+/ 5077 * - /^[ \t]*function[ \t\n]+[^ \t\n(]+/