comparison src/ov.cc @ 14528:c67822beb7a4

maint: Backed out changeset 8c988dabbe8e
author Rik <octave@nomad.inbox5.com>
date Thu, 05 Apr 2012 11:55:47 -0700
parents 8c988dabbe8e
children f7afecdd87ef
comparison
equal deleted inserted replaced
14527:8c988dabbe8e 14528:c67822beb7a4
84 #include "parse.h" 84 #include "parse.h"
85 #include "pr-output.h" 85 #include "pr-output.h"
86 #include "symtab.h" 86 #include "symtab.h"
87 #include "utils.h" 87 #include "utils.h"
88 #include "variables.h" 88 #include "variables.h"
89
90 // Expand escape sequences even in single quoted strings (Matlab compatibility)
91 bool Vsingle_quote_escape_processing = false;
92 89
93 // We are likely to have a lot of octave_value objects to allocate, so 90 // We are likely to have a lot of octave_value objects to allocate, so
94 // make the grow_size large. 91 // make the grow_size large.
95 DEFINE_OCTAVE_ALLOCATOR2(octave_value, 1024); 92 DEFINE_OCTAVE_ALLOCATOR2(octave_value, 1024);
96 93
3045 %!assert (is_dq_string ({2.0}), false) 3042 %!assert (is_dq_string ({2.0}), false)
3046 3043
3047 %!error is_dq_string () 3044 %!error is_dq_string ()
3048 %!error is_dq_string ("foo", 2) 3045 %!error is_dq_string ("foo", 2)
3049 */ 3046 */
3050
3051 DEFUN (single_quote_escape_processing, args, nargout,
3052 "-*- texinfo -*-\n\
3053 @deftypefn {Built-in Function} {@var{val} =} single_quote_escape_processing ()\n\
3054 @deftypefnx {Built-in Function} {@var{old_val} =} single_quote_escape_processing (@var{new_val})\n\
3055 @deftypefnx {Built-in Function} {} single_quote_escape_processing (@var{new_val}, \"local\")\n\
3056 Query or set the internal variable that controls whether Octave processes\n\
3057 escape sequences within single quoted strings.\n\
3058 \n\
3059 Ordinarily, escape sequences such as \"\\n\" => newline are only processed\n\
3060 in double quoted strings. However, @sc{matlab} performs escape sequence\n\
3061 processing even for single quoted strings for certain functions. This\n\
3062 variable enables @sc{matlab} compatibility for these instances:\n\
3063 \n\
3064 @table @code\n\
3065 @item printf\n\
3066 @itemx sprintf\n\
3067 @itemx fprintf\n\
3068 Process format specification string @var{template}.\n\
3069 \n\
3070 @item error\n\
3071 Process format specification string @var{template}.\n\
3072 \n\
3073 @item regexp\n\
3074 @itemx regexpi\n\
3075 Process pattern string @var{pat}.\n\
3076 \n\
3077 @item regexprep\n\
3078 Process pattern string @var{pat} and replacement string @var{repstr}.\n\
3079 @end table\n\
3080 \n\
3081 When called from inside a function with the \"local\" option, the variable is\n\
3082 changed locally for the function and any subroutines it calls. The original\n\
3083 variable value is restored when exiting the function.\n\
3084 @seealso{printf, sprintf, fprintf, error, regexp, regexpi, regexprep}\n\
3085 @end deftypefn")
3086 {
3087 return SET_INTERNAL_VARIABLE (single_quote_escape_processing);
3088 }