comparison src/parse.y @ 5931:25da9a7d5f6d

[project @ 2006-08-16 06:52:19 by jwe]
author jwe
date Wed, 16 Aug 2006 06:52:19 +0000
parents 27771d9cd4f4
children 51cbaa2539f4
comparison
equal deleted inserted replaced
5930:a703198cb8b8 5931:25da9a7d5f6d
3139 return help_txt; 3139 return help_txt;
3140 } 3140 }
3141 3141
3142 std::string 3142 std::string
3143 get_help_from_file (const std::string& nm, bool& symbol_found, 3143 get_help_from_file (const std::string& nm, bool& symbol_found,
3144 bool include_file_info) 3144 std::string& file)
3145 { 3145 {
3146 std::string retval; 3146 std::string retval;
3147 3147
3148 std::string file = fcn_file_in_path (nm); 3148 file = fcn_file_in_path (nm);
3149 3149
3150 if (! file.empty ()) 3150 if (! file.empty ())
3151 { 3151 {
3152 symbol_found = true; 3152 symbol_found = true;
3153 3153
3157 { 3157 {
3158 unwind_protect::add (safe_fclose, fptr); 3158 unwind_protect::add (safe_fclose, fptr);
3159 3159
3160 retval = gobble_leading_white_space (fptr, true, true, false); 3160 retval = gobble_leading_white_space (fptr, true, true, false);
3161 3161
3162 if (! retval.empty () && include_file_info)
3163 retval = nm + " is the file: " + file + "\n\n" + retval;
3164
3165 unwind_protect::run (); 3162 unwind_protect::run ();
3166 } 3163 }
3167 } 3164 }
3168 3165
3169 return retval; 3166 return retval;
3167 }
3168
3169 std::string
3170 get_help_from_file (const std::string& nm, bool& symbol_found)
3171 {
3172 std::string file;
3173 return get_help_from_file (nm, symbol_found, file);
3170 } 3174 }
3171 3175
3172 static int 3176 static int
3173 is_function_file (FILE *ffile) 3177 is_function_file (FILE *ffile)
3174 { 3178 {