comparison libinterp/parse-tree/pt-mat.cc @ 19435:9035a36736af

maint: Periodic merge of gui-release to default.
author Rik <rik@octave.org>
date Mon, 15 Dec 2014 21:01:45 -0800
parents 68116bea38ba 2304ddfd736f
children 4197fc428c7d
comparison
equal deleted inserted replaced
19432:9e5b64b3c1fe 19435:9035a36736af
30 #include "quit.h" 30 #include "quit.h"
31 31
32 #include "data.h" 32 #include "data.h"
33 #include "defun.h" 33 #include "defun.h"
34 #include "error.h" 34 #include "error.h"
35 #include "gripes.h"
35 #include "oct-obj.h" 36 #include "oct-obj.h"
36 #include "pt-arg-list.h" 37 #include "pt-arg-list.h"
37 #include "pt-bp.h" 38 #include "pt-bp.h"
38 #include "pt-exp.h" 39 #include "pt-exp.h"
39 #include "pt-mat.h" 40 #include "pt-mat.h"
934 octave_value 935 octave_value
935 tree_matrix::rvalue1 (int) 936 tree_matrix::rvalue1 (int)
936 { 937 {
937 octave_value retval = Matrix (); 938 octave_value retval = Matrix ();
938 939
940 bool all_strings_p = false;
939 bool all_sq_strings_p = false; 941 bool all_sq_strings_p = false;
940 bool all_dq_strings_p = false; 942 bool all_dq_strings_p = false;
941 bool all_empty_p = false; 943 bool all_empty_p = false;
942 bool all_real_p = false; 944 bool all_real_p = false;
943 bool any_sparse_p = false; 945 bool any_sparse_p = false;
947 tm_const tmp (*this); 949 tm_const tmp (*this);
948 950
949 if (tmp && ! tmp.empty ()) 951 if (tmp && ! tmp.empty ())
950 { 952 {
951 dim_vector dv = tmp.dims (); 953 dim_vector dv = tmp.dims ();
954 all_strings_p = tmp.all_strings_p ();
952 all_sq_strings_p = tmp.all_sq_strings_p (); 955 all_sq_strings_p = tmp.all_sq_strings_p ();
953 all_dq_strings_p = tmp.all_dq_strings_p (); 956 all_dq_strings_p = tmp.all_dq_strings_p ();
954 all_empty_p = tmp.all_empty_p (); 957 all_empty_p = tmp.all_empty_p ();
955 all_real_p = tmp.all_real_p (); 958 all_real_p = tmp.all_real_p ();
956 any_sparse_p = tmp.any_sparse_p (); 959 any_sparse_p = tmp.any_sparse_p ();
991 } 994 }
992 else if (result_type == "char") 995 else if (result_type == "char")
993 { 996 {
994 char type = all_dq_strings_p ? '"' : '\''; 997 char type = all_dq_strings_p ? '"' : '\'';
995 998
996 maybe_warn_string_concat (all_dq_strings_p, all_sq_strings_p); 999 if (! all_strings_p)
1000 gripe_implicit_conversion ("Octave:num-to-str",
1001 "numeric", result_type);
1002 else
1003 maybe_warn_string_concat (all_dq_strings_p, all_sq_strings_p);
997 1004
998 charNDArray result (dv, Vstring_fill_char); 1005 charNDArray result (dv, Vstring_fill_char);
999 1006
1000 single_type_concat<charNDArray> (result, tmp); 1007 single_type_concat<charNDArray> (result, tmp);
1001 1008