diff src/parse.y @ 5765:7ba9ad1fec11

[project @ 2006-04-17 05:05:15 by jwe]
author jwe
date Mon, 17 Apr 2006 05:05:17 +0000
parents 8d7162924bd3
children e7af222e98b0
line wrap: on
line diff
--- a/src/parse.y
+++ b/src/parse.y
@@ -40,6 +40,7 @@
 #endif
 
 #include <map>
+#include <sstream>
 
 #include "Cell.h"
 #include "Matrix.h"
@@ -47,7 +48,6 @@
 #include "cmd-hist.h"
 #include "file-ops.h"
 #include "file-stat.h"
-#include "lo-sstream.h"
 #include "oct-env.h"
 #include "oct-time.h"
 #include "quit.h"
@@ -1409,7 +1409,7 @@
 {
   int err_col = current_input_column - 1;
 
-  OSSTREAM output_buf;
+  std::ostringstream output_buf;
 
   if (reading_fcn_file || reading_script_file)
     output_buf << "parse error near line " << input_line_number
@@ -1442,11 +1442,11 @@
       output_buf << "^";
     }
 
-  output_buf << "\n" << OSSTREAM_ENDS;
-
-  parse_error ("%s", OSSTREAM_C_STR (output_buf));
-
-  OSSTREAM_FREEZE (output_buf);
+  output_buf << "\n";
+
+  std::string msg = output_buf.str ();
+
+  parse_error ("%s", msg.c_str ());
 }
 
 // Error mesages for mismatched end tokens.
@@ -1612,17 +1612,13 @@
 	{
 	  tree_constant *tc_retval = new tree_constant (tmp);
 
-	  OSSTREAM buf;
+	  std::ostringstream buf;
 
 	  tree_print_code tpc (buf);
 
 	  e->accept (tpc);
 
-	  buf << OSSTREAM_ENDS;
-
-	  tc_retval->stash_original_text (OSSTREAM_STR (buf));
-
-	  OSSTREAM_FREEZE (buf);
+	  tc_retval->stash_original_text (buf.str ());
 
 	  delete e;
 
@@ -1661,17 +1657,13 @@
 	{
 	  tree_constant *tc_retval = new tree_constant (tmp);
 
-	  OSSTREAM buf;
+	  std::ostringstream buf;
 
 	  tree_print_code tpc (buf);
 
 	  e->accept (tpc);
 
-	  buf << OSSTREAM_ENDS;
-
-	  tc_retval->stash_original_text (OSSTREAM_STR (buf));
-
-	  OSSTREAM_FREEZE (buf);
+	  tc_retval->stash_original_text (buf.str ());
 
 	  delete e;
 
@@ -1719,17 +1711,13 @@
 		{
 		  tree_constant *tc_retval = new tree_constant (tmp);
 
-		  OSSTREAM buf;
+		  std::ostringstream buf;
 
 		  tree_print_code tpc (buf);
 
 		  e->accept (tpc);
 
-		  buf << OSSTREAM_ENDS;
-
-		  tc_retval->stash_original_text (OSSTREAM_STR (buf));
-
-		  OSSTREAM_FREEZE (buf);
+		  tc_retval->stash_original_text (buf.str ());
 
 		  delete e;
 
@@ -2818,17 +2806,13 @@
 	{
 	  tree_constant *tc_retval = new tree_constant (tmp);
 
-	  OSSTREAM buf;
+	  std::ostringstream buf;
 
 	  tree_print_code tpc (buf);
 
 	  m->accept (tpc);
 
-	  buf << OSSTREAM_ENDS;
-
-	  tc_retval->stash_original_text (OSSTREAM_STR (buf));
-
-	  OSSTREAM_FREEZE (buf);
+	  tc_retval->stash_original_text (buf.str ());
 
 	  delete m;