aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Potortì2007-07-17 15:13:24 +0000
committerFrancesco Potortì2007-07-17 15:13:24 +0000
commit172aa4c11b0f2dbe9efcc042a7fed9f35a5cf169 (patch)
treefe5e7821024eab80fc05c5eac61b56013fdc00f3
parent21b2cdc7defc70d39cf85367ce4413e673195398 (diff)
downloademacs-172aa4c11b0f2dbe9efcc042a7fed9f35a5cf169.tar.gz
emacs-172aa4c11b0f2dbe9efcc042a7fed9f35a5cf169.zip
* etags.c (C_entries): Reset the fvdef machine when out of function.
(PRINT_UNDOCUMENTED_OPTIONS_HELP): #define as FALSE if undefined. (print_help): Use it in if() rather than #if. (print_help): Conditionally print help about --no-line-directive.
-rw-r--r--lib-src/etags.c40
1 files changed, 31 insertions, 9 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c
index f3534e02d7c..fded69c50b0 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -80,7 +80,7 @@ University of California, as described above. */
80 * configuration file containing regexp definitions for etags. 80 * configuration file containing regexp definitions for etags.
81 */ 81 */
82 82
83char pot_etags_version[] = "@(#) pot revision number is 17.31"; 83char 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
@@ -882,7 +882,7 @@ etags --help --lang=ada.");
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
887static void 887static void
888print_version () 888print_version ()
@@ -897,6 +897,10 @@ print_version ()
897 exit (EXIT_SUCCESS); 897 exit (EXIT_SUCCESS);
898} 898}
899 899
900#ifndef PRINT_UNDOCUMENTED_OPTIONS_HELP
901# define PRINT_UNDOCUMENTED_OPTIONS_HELP FALSE
902#endif
903
900static void 904static void
901print_help (argbuffer) 905print_help (argbuffer)
902 argument *argbuffer; 906 argument *argbuffer;
@@ -979,6 +983,11 @@ Relative ones are stored relative to the output file's directory.\n");
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.");
@@ -999,13 +1008,17 @@ Relative ones are stored relative to the output file's directory.\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
@@ -1033,13 +1046,16 @@ Relative ones are stored relative to the output file's directory.\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\
@@ -3982,10 +3998,16 @@ C_entries (c_ext, inf)
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. */