comparison src/parse.y @ 5775:ace8d8d26933

[project @ 2006-04-24 19:13:06 by jwe]
author jwe
date Mon, 24 Apr 2006 19:13:11 +0000
parents e7af222e98b0
children faafc2d98b8d
comparison
equal deleted inserted replaced
5774:e7af222e98b0 5775:ace8d8d26933
1728 else 1728 else
1729 { 1729 {
1730 e->preserve_base (); 1730 e->preserve_base ();
1731 delete e; 1731 delete e;
1732 1732
1733 // XXX FIXME XXX -- need to attempt constant folding here 1733 // FIXME -- need to attempt constant folding here
1734 // too (we need a generic way to do that). 1734 // too (we need a generic way to do that).
1735 retval = base; 1735 retval = base;
1736 } 1736 }
1737 } 1737 }
1738 1738
1801 // Make an anonymous function handle. 1801 // Make an anonymous function handle.
1802 1802
1803 static tree_constant * 1803 static tree_constant *
1804 make_anon_fcn_handle (tree_parameter_list *param_list, tree_statement *stmt) 1804 make_anon_fcn_handle (tree_parameter_list *param_list, tree_statement *stmt)
1805 { 1805 {
1806 // XXX FIXME XXX -- need to get these from the location of the @ symbol. 1806 // FIXME -- need to get these from the location of the @ symbol.
1807 1807
1808 int l = -1; 1808 int l = -1;
1809 int c = -1; 1809 int c = -1;
1810 1810
1811 tree_parameter_list *ret_list = 0; 1811 tree_parameter_list *ret_list = 0;
1822 1822
1823 stmt->set_expression (asn); 1823 stmt->set_expression (asn);
1824 1824
1825 stmt->set_print_flag (false); 1825 stmt->set_print_flag (false);
1826 1826
1827 // XXX FIXME XXX -- would like to delete old_stmt here or 1827 // FIXME -- would like to delete old_stmt here or
1828 // replace expression inside it with the new expression we just 1828 // replace expression inside it with the new expression we just
1829 // created so we don't have to create a new statement at all. 1829 // created so we don't have to create a new statement at all.
1830 1830
1831 id = new tree_identifier (sr); 1831 id = new tree_identifier (sr);
1832 1832
2949 } 2949 }
2950 2950
2951 static void 2951 static void
2952 safe_fclose (void *f) 2952 safe_fclose (void *f)
2953 { 2953 {
2954 // XXX FIXME XXX -- comments at the end of an input file are 2954 // FIXME -- comments at the end of an input file are
2955 // discarded (otherwise, they would be appended to the next 2955 // discarded (otherwise, they would be appended to the next
2956 // statement, possibly from the command line or another file, which 2956 // statement, possibly from the command line or another file, which
2957 // can be quite confusing). 2957 // can be quite confusing).
2958 2958
2959 octave_comment_list *tc = octave_comment_buffer::get_comment (); 2959 octave_comment_list *tc = octave_comment_buffer::get_comment ();
3045 // grab them all at once. If UPDATE_POS is TRUE, line and column 3045 // grab them all at once. If UPDATE_POS is TRUE, line and column
3046 // number information is updated. If SAVE_COPYRIGHT is TRUE, then 3046 // number information is updated. If SAVE_COPYRIGHT is TRUE, then
3047 // comments that are recognized as a copyright notice are saved in the 3047 // comments that are recognized as a copyright notice are saved in the
3048 // comment buffer. 3048 // comment buffer.
3049 3049
3050 // XXX FIXME XXX -- grab_help_text() in lex.l duplicates some of this 3050 // FIXME -- grab_help_text() in lex.l duplicates some of this
3051 // code! 3051 // code!
3052 3052
3053 static std::string 3053 static std::string
3054 gobble_leading_white_space (FILE *ffile, bool in_parts, 3054 gobble_leading_white_space (FILE *ffile, bool in_parts,
3055 bool update_pos, bool save_copyright) 3055 bool update_pos, bool save_copyright)
3290 // Check to see if this file defines a function or is just a 3290 // Check to see if this file defines a function or is just a
3291 // list of commands. 3291 // list of commands.
3292 3292
3293 if (! force_script && is_function_file (ffile)) 3293 if (! force_script && is_function_file (ffile))
3294 { 3294 {
3295 // XXX FIXME XXX -- we shouldn't need both the 3295 // FIXME -- we shouldn't need both the
3296 // command_history object and the 3296 // command_history object and the
3297 // Vsaving_history variable... 3297 // Vsaving_history variable...
3298 command_history::ignore_entries (); 3298 command_history::ignore_entries ();
3299 3299
3300 unwind_protect::add (restore_command_history, 0); 3300 unwind_protect::add (restore_command_history, 0);
3328 3328
3329 help_buf.push (txt); 3329 help_buf.push (txt);
3330 3330
3331 octave_comment_buffer::append (txt); 3331 octave_comment_buffer::append (txt);
3332 3332
3333 // XXX FIXME XXX -- this should not be necessary. 3333 // FIXME -- this should not be necessary.
3334 gobble_leading_white_space (ffile, false, true, false); 3334 gobble_leading_white_space (ffile, false, true, false);
3335 3335
3336 int status = yyparse (); 3336 int status = yyparse ();
3337 3337
3338 if (status != 0) 3338 if (status != 0)
3346 { 3346 {
3347 // The value of `reading_fcn_file' will be restored to the 3347 // The value of `reading_fcn_file' will be restored to the
3348 // proper value when we unwind from this frame. 3348 // proper value when we unwind from this frame.
3349 reading_fcn_file = old_reading_fcn_file_state; 3349 reading_fcn_file = old_reading_fcn_file_state;
3350 3350
3351 // XXX FIXME XXX -- we shouldn't need both the 3351 // FIXME -- we shouldn't need both the
3352 // command_history object and the 3352 // command_history object and the
3353 // Vsaving_history variable... 3353 // Vsaving_history variable...
3354 command_history::ignore_entries (); 3354 command_history::ignore_entries ();
3355 3355
3356 unwind_protect::add (restore_command_history, 0); 3356 unwind_protect::add (restore_command_history, 0);