comparison lib-src/etags.c @ 90984:a1be62cbd32a

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 814-815) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-232
author Miles Bader <miles@gnu.org>
date Wed, 18 Jul 2007 22:15:15 +0000
parents e9f94688a064 a5a2ef19d358
children f55f9811f5d7
comparison
equal deleted inserted replaced
90983:8cdd8b5fa891 90984:a1be62cbd32a
78 * If you want to add support for a new language, start by looking at the LUA 78 * If you want to add support for a new language, start by looking at the LUA
79 * language, which is the simplest. Alternatively, consider shipping a 79 * language, which is the simplest. Alternatively, consider shipping a
80 * configuration file containing regexp definitions for etags. 80 * configuration file containing regexp definitions for etags.
81 */ 81 */
82 82
83 char pot_etags_version[] = "@(#) pot revision number is 17.31"; 83 char pot_etags_version[] = "@(#) pot revision number is 17.34";
84 84
85 #define TRUE 1 85 #define TRUE 1
86 #define FALSE 0 86 #define FALSE 0
87 87
88 #ifdef DEBUG 88 #ifdef DEBUG
880 880
881 #ifndef EMACS_NAME 881 #ifndef EMACS_NAME
882 # define EMACS_NAME "standalone" 882 # define EMACS_NAME "standalone"
883 #endif 883 #endif
884 #ifndef VERSION 884 #ifndef VERSION
885 # define VERSION "17.31" 885 # define VERSION "17.34"
886 #endif 886 #endif
887 static void 887 static void
888 print_version () 888 print_version ()
889 { 889 {
890 /* Makes it easier to update automatically. */ 890 /* Makes it easier to update automatically. */
894 puts (emacs_copyright); 894 puts (emacs_copyright);
895 puts ("This program is distributed under the terms in ETAGS.README"); 895 puts ("This program is distributed under the terms in ETAGS.README");
896 896
897 exit (EXIT_SUCCESS); 897 exit (EXIT_SUCCESS);
898 } 898 }
899
900 #ifndef PRINT_UNDOCUMENTED_OPTIONS_HELP
901 # define PRINT_UNDOCUMENTED_OPTIONS_HELP FALSE
902 #endif
899 903
900 static void 904 static void
901 print_help (argbuffer) 905 print_help (argbuffer)
902 argument *argbuffer; 906 argument *argbuffer;
903 { 907 {
977 Create tag entries for global variables in some languages."); 981 Create tag entries for global variables in some languages.");
978 else 982 else
979 puts ("--no-globals\n\ 983 puts ("--no-globals\n\
980 Do not create tag entries for global variables in some\n\ 984 Do not create tag entries for global variables in some\n\
981 languages. This makes the tags file smaller."); 985 languages. This makes the tags file smaller.");
986
987 if (PRINT_UNDOCUMENTED_OPTIONS_HELP)
988 puts ("--no-line-directive\n\
989 Ignore #line preprocessor directives in C and derived languages.");
990
982 if (CTAGS) 991 if (CTAGS)
983 puts ("--members\n\ 992 puts ("--members\n\
984 Create tag entries for members of structures in some languages."); 993 Create tag entries for members of structures in some languages.");
985 else 994 else
986 puts ("--no-members\n\ 995 puts ("--no-members\n\
997 For example Tcl named tags can be created with:\n\ 1006 For example Tcl named tags can be created with:\n\
998 --regex=\"/proc[ \\t]+\\([^ \\t]+\\)/\\1/.\".\n\ 1007 --regex=\"/proc[ \\t]+\\([^ \\t]+\\)/\\1/.\".\n\
999 MODS are optional one-letter modifiers: `i' means to ignore case,\n\ 1008 MODS are optional one-letter modifiers: `i' means to ignore case,\n\
1000 `m' means to allow multi-line matches, `s' implies `m' and\n\ 1009 `m' means to allow multi-line matches, `s' implies `m' and\n\
1001 causes dot to match any character, including newline."); 1010 causes dot to match any character, including newline.");
1011
1002 puts ("-R, --no-regex\n\ 1012 puts ("-R, --no-regex\n\
1003 Don't create tags from regexps for the following files."); 1013 Don't create tags from regexps for the following files.");
1014
1004 puts ("-I, --ignore-indentation\n\ 1015 puts ("-I, --ignore-indentation\n\
1005 In C and C++ do not assume that a closing brace in the first\n\ 1016 In C and C++ do not assume that a closing brace in the first\n\
1006 column is the final brace of a function or structure definition."); 1017 column is the final brace of a function or structure definition.");
1018
1007 puts ("-o FILE, --output=FILE\n\ 1019 puts ("-o FILE, --output=FILE\n\
1008 Write the tags to FILE."); 1020 Write the tags to FILE.");
1021
1009 puts ("--parse-stdin=NAME\n\ 1022 puts ("--parse-stdin=NAME\n\
1010 Read from standard input and record tags as belonging to file NAME."); 1023 Read from standard input and record tags as belonging to file NAME.");
1011 1024
1012 if (CTAGS) 1025 if (CTAGS)
1013 { 1026 {
1031 { 1044 {
1032 puts ("-v, --vgrind\n\ 1045 puts ("-v, --vgrind\n\
1033 Print on the standard output an index of items intended for\n\ 1046 Print on the standard output an index of items intended for\n\
1034 human consumption, similar to the output of vgrind. The index\n\ 1047 human consumption, similar to the output of vgrind. The index\n\
1035 is sorted, and gives the page number of each item."); 1048 is sorted, and gives the page number of each item.");
1036 # if PRINT_UNDOCUMENTED_OPTIONS_HELP 1049
1037 puts ("-w, --no-duplicates\n\ 1050 if (PRINT_UNDOCUMENTED_OPTIONS_HELP)
1051 puts ("-w, --no-duplicates\n\
1038 Do not create duplicate tag entries, for compatibility with\n\ 1052 Do not create duplicate tag entries, for compatibility with\n\
1039 traditional ctags."); 1053 traditional ctags.");
1040 puts ("-w, --no-warn\n\ 1054
1055 if (PRINT_UNDOCUMENTED_OPTIONS_HELP)
1056 puts ("-w, --no-warn\n\
1041 Suppress warning messages about duplicate tag entries."); 1057 Suppress warning messages about duplicate tag entries.");
1042 # endif /* PRINT_UNDOCUMENTED_OPTIONS_HELP */ 1058
1043 puts ("-x, --cxref\n\ 1059 puts ("-x, --cxref\n\
1044 Like --vgrind, but in the style of cxref, rather than vgrind.\n\ 1060 Like --vgrind, but in the style of cxref, rather than vgrind.\n\
1045 The output uses line numbers instead of page numbers, but\n\ 1061 The output uses line numbers instead of page numbers, but\n\
1046 beyond that the differences are cosmetic; try both to see\n\ 1062 beyond that the differences are cosmetic; try both to see\n\
1047 which you like."); 1063 which you like.");
3980 if (bracelev != 0) 3996 if (bracelev != 0)
3981 token.valid = FALSE; 3997 token.valid = FALSE;
3982 bracelev = 0; /* reset brace level if first column */ 3998 bracelev = 0; /* reset brace level if first column */
3983 parlev = 0; /* also reset paren level, just in case... */ 3999 parlev = 0; /* also reset paren level, just in case... */
3984 } 4000 }
3985 else if (bracelev > 0)
3986 bracelev--;
3987 else 4001 else
3988 token.valid = FALSE; /* something gone amiss, token unreliable */ 4002 {
4003 if (--bracelev < 0)
4004 {
4005 bracelev = 0;
4006 token.valid = FALSE; /* something gone amiss, token unreliable */
4007 }
4008 if (bracelev == 0 && fvdef == vignore)
4009 fvdef = fvnone; /* end of function */
4010 }
3989 popclass_above (bracelev); 4011 popclass_above (bracelev);
3990 structdef = snone; 4012 structdef = snone;
3991 /* Only if typdef == tinbody is typdefbracelev significant. */ 4013 /* Only if typdef == tinbody is typdefbracelev significant. */
3992 if (typdef == tinbody && bracelev <= typdefbracelev) 4014 if (typdef == tinbody && bracelev <= typdefbracelev)
3993 { 4015 {