changeset 11731:cf2fc7338195 release-3-0-x

make_constant: stash original text for strings
author John W. Eaton <jwe@octave.org>
date Thu, 03 Apr 2008 14:09:49 -0400
parents 2f659a9c89f2
children 5892d5533b2b
files src/ChangeLog src/parse.y
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,7 @@
 2008-04-03  John W. Eaton  <jwe@octave.org>
 
+	* parse.y (make_constant): Also stash original text for strings.
+
 	* ov-fcn-handle.cc (octave_fcn_handle::subsref):
 	Don't call next_subsref here.
 
--- a/src/parse.y
+++ b/src/parse.y
@@ -1734,8 +1734,12 @@
     case DQ_STRING:
     case SQ_STRING:
       {
-	octave_value tmp (tok_val->text (), op == DQ_STRING ? '"' : '\'');
+	char delim = op == DQ_STRING ? '"' : '\'';
+	octave_value tmp (tok_val->text (), delim);
 	retval = new tree_constant (tmp, l, c);
+	// FIXME -- maybe this should also be handled by
+	// tok_val->text_rep () for character strings?
+	retval->stash_original_text (delim + tok_val->text () + delim);
       }
       break;