diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/etags.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index eb6d31a6607..588921bc700 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -630,6 +630,8 @@ static const char *Erlang_suffixes [] = | |||
| 630 | static const char Erlang_help [] = | 630 | static const char Erlang_help [] = |
| 631 | "In Erlang code, the tags are the functions, records and macros\n\ | 631 | "In Erlang code, the tags are the functions, records and macros\n\ |
| 632 | defined in the file."; | 632 | defined in the file."; |
| 633 | static const char *Erlang_interpreters [] = | ||
| 634 | { "escript", NULL }; | ||
| 633 | 635 | ||
| 634 | const char *Forth_suffixes [] = | 636 | const char *Forth_suffixes [] = |
| 635 | { "fth", "tok", NULL }; | 637 | { "fth", "tok", NULL }; |
| @@ -666,6 +668,8 @@ static const char *Lua_suffixes [] = | |||
| 666 | { "lua", "LUA", NULL }; | 668 | { "lua", "LUA", NULL }; |
| 667 | static const char Lua_help [] = | 669 | static const char Lua_help [] = |
| 668 | "In Lua scripts, all functions are tags."; | 670 | "In Lua scripts, all functions are tags."; |
| 671 | static const char *Lua_interpreters [] = | ||
| 672 | { "lua", NULL }; | ||
| 669 | 673 | ||
| 670 | static const char *Makefile_filenames [] = | 674 | static const char *Makefile_filenames [] = |
| 671 | { "Makefile", "makefile", "GNUMakefile", "Makefile.in", "Makefile.am", NULL}; | 675 | { "Makefile", "makefile", "GNUMakefile", "Makefile.in", "Makefile.am", NULL}; |
| @@ -721,12 +725,16 @@ static const char *Prolog_suffixes [] = | |||
| 721 | static const char Prolog_help [] = | 725 | static const char Prolog_help [] = |
| 722 | "In Prolog code, tags are predicates and rules at the beginning of\n\ | 726 | "In Prolog code, tags are predicates and rules at the beginning of\n\ |
| 723 | line."; | 727 | line."; |
| 728 | static const char *Prolog_interpreters [] = | ||
| 729 | { "gprolog", "pl", "yap", "swipl", "prolog", NULL }; | ||
| 724 | 730 | ||
| 725 | static const char *Python_suffixes [] = | 731 | static const char *Python_suffixes [] = |
| 726 | { "py", NULL }; | 732 | { "py", NULL }; |
| 727 | static const char Python_help [] = | 733 | static const char Python_help [] = |
| 728 | "In Python code, 'def' or 'class' at the beginning of a line\n\ | 734 | "In Python code, 'def' or 'class' at the beginning of a line\n\ |
| 729 | generate a tag."; | 735 | generate a tag."; |
| 736 | static const char *Python_interpreters [] = | ||
| 737 | { "python", NULL }; | ||
| 730 | 738 | ||
| 731 | static const char *Ruby_suffixes [] = | 739 | static const char *Ruby_suffixes [] = |
| 732 | { "rb", "ru", "rbw", NULL }; | 740 | { "rb", "ru", "rbw", NULL }; |
| @@ -735,6 +743,8 @@ static const char *Ruby_filenames [] = | |||
| 735 | static const char Ruby_help [] = | 743 | static const char Ruby_help [] = |
| 736 | "In Ruby code, 'def' or 'class' or 'module' at the beginning of\n\ | 744 | "In Ruby code, 'def' or 'class' or 'module' at the beginning of\n\ |
| 737 | a line generate a tag. Constants also generate a tag."; | 745 | a line generate a tag. Constants also generate a tag."; |
| 746 | static const char *Ruby_interpreters [] = | ||
| 747 | { "ruby", NULL }; | ||
| 738 | 748 | ||
| 739 | /* Can't do the `SCM' or `scm' prefix with a version number. */ | 749 | /* Can't do the `SCM' or `scm' prefix with a version number. */ |
| 740 | static const char *Scheme_suffixes [] = | 750 | static const char *Scheme_suffixes [] = |
| @@ -798,14 +808,15 @@ static language lang_names [] = | |||
| 798 | { "c++", Cplusplus_help, Cplusplus_entries, Cplusplus_suffixes }, | 808 | { "c++", Cplusplus_help, Cplusplus_entries, Cplusplus_suffixes }, |
| 799 | { "c*", no_lang_help, Cstar_entries, Cstar_suffixes }, | 809 | { "c*", no_lang_help, Cstar_entries, Cstar_suffixes }, |
| 800 | { "cobol", Cobol_help, Cobol_paragraphs, Cobol_suffixes }, | 810 | { "cobol", Cobol_help, Cobol_paragraphs, Cobol_suffixes }, |
| 801 | { "erlang", Erlang_help, Erlang_functions, Erlang_suffixes }, | 811 | { "erlang", Erlang_help, Erlang_functions, Erlang_suffixes, |
| 812 | NULL, Erlang_interpreters }, | ||
| 802 | { "forth", Forth_help, Forth_words, Forth_suffixes }, | 813 | { "forth", Forth_help, Forth_words, Forth_suffixes }, |
| 803 | { "fortran", Fortran_help, Fortran_functions, Fortran_suffixes }, | 814 | { "fortran", Fortran_help, Fortran_functions, Fortran_suffixes }, |
| 804 | { "go", Go_help, Go_functions, Go_suffixes }, | 815 | { "go", Go_help, Go_functions, Go_suffixes }, |
| 805 | { "html", HTML_help, HTML_labels, HTML_suffixes }, | 816 | { "html", HTML_help, HTML_labels, HTML_suffixes }, |
| 806 | { "java", Cjava_help, Cjava_entries, Cjava_suffixes }, | 817 | { "java", Cjava_help, Cjava_entries, Cjava_suffixes }, |
| 807 | { "lisp", Lisp_help, Lisp_functions, Lisp_suffixes }, | 818 | { "lisp", Lisp_help, Lisp_functions, Lisp_suffixes }, |
| 808 | { "lua", Lua_help, Lua_functions, Lua_suffixes }, | 819 | { "lua", Lua_help,Lua_functions,Lua_suffixes,NULL,Lua_interpreters}, |
| 809 | { "makefile", Makefile_help,Makefile_targets,NULL,Makefile_filenames}, | 820 | { "makefile", Makefile_help,Makefile_targets,NULL,Makefile_filenames}, |
| 810 | { "objc", Objc_help, plain_C_entries, Objc_suffixes }, | 821 | { "objc", Objc_help, plain_C_entries, Objc_suffixes }, |
| 811 | { "pascal", Pascal_help, Pascal_functions, Pascal_suffixes }, | 822 | { "pascal", Pascal_help, Pascal_functions, Pascal_suffixes }, |
| @@ -813,9 +824,12 @@ static language lang_names [] = | |||
| 813 | { "php", PHP_help, PHP_functions, PHP_suffixes }, | 824 | { "php", PHP_help, PHP_functions, PHP_suffixes }, |
| 814 | { "postscript",PS_help, PS_functions, PS_suffixes }, | 825 | { "postscript",PS_help, PS_functions, PS_suffixes }, |
| 815 | { "proc", no_lang_help, plain_C_entries, plain_C_suffixes }, | 826 | { "proc", no_lang_help, plain_C_entries, plain_C_suffixes }, |
| 816 | { "prolog", Prolog_help, Prolog_functions, Prolog_suffixes }, | 827 | { "prolog", Prolog_help, Prolog_functions, Prolog_suffixes, |
| 817 | { "python", Python_help, Python_functions, Python_suffixes }, | 828 | NULL, Prolog_interpreters }, |
| 818 | { "ruby", Ruby_help,Ruby_functions,Ruby_suffixes,Ruby_filenames }, | 829 | { "python", Python_help, Python_functions, Python_suffixes, |
| 830 | NULL, Python_interpreters }, | ||
| 831 | { "ruby", Ruby_help, Ruby_functions, Ruby_suffixes, | ||
| 832 | Ruby_filenames, Ruby_interpreters }, | ||
| 819 | { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes }, | 833 | { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes }, |
| 820 | { "tex", TeX_help, TeX_commands, TeX_suffixes }, | 834 | { "tex", TeX_help, TeX_commands, TeX_suffixes }, |
| 821 | { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes }, | 835 | { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes }, |
| @@ -1796,6 +1810,13 @@ find_entries (FILE *inf) | |||
| 1796 | else | 1810 | else |
| 1797 | lp = skip_spaces (lb.buffer + 2); | 1811 | lp = skip_spaces (lb.buffer + 2); |
| 1798 | cp = skip_non_spaces (lp); | 1812 | cp = skip_non_spaces (lp); |
| 1813 | /* If the "interpreter" turns out to be "env", the real interpreter is | ||
| 1814 | the next word. */ | ||
| 1815 | if (cp > lp && strneq (lp, "env", cp - lp)) | ||
| 1816 | { | ||
| 1817 | lp = skip_spaces (cp); | ||
| 1818 | cp = skip_non_spaces (lp); | ||
| 1819 | } | ||
| 1799 | *cp = '\0'; | 1820 | *cp = '\0'; |
| 1800 | 1821 | ||
| 1801 | if (strlen (lp) > 0) | 1822 | if (strlen (lp) > 0) |