changeset 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 aabdc8f281f1
files doc/interpreter/strings.txi src/octave.cc src/ov.cc src/ov.h
diffstat 4 files changed, 4 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/strings.txi
+++ b/doc/interpreter/strings.txi
@@ -69,8 +69,8 @@
 In double-quoted strings, the backslash character is used to introduce
 @dfn{escape sequences} that represent other characters.  For example,
 @samp{\n} embeds a newline character in a double-quoted string and
-@samp{\"} embeds a double quote character.  In single-quoted strings, the
-backslash is not a special character.  An example showing the difference is
+@samp{\"} embeds a double quote character.  In single-quoted strings, backslash
+is not a special character.  Here is an example showing the difference:
 
 @example
 @group
@@ -81,7 +81,7 @@
 @end group
 @end example
 
-Below is a table of all escape sequences recognized by Octave (within
+Here is a table of all the escape sequences used in Octave (within
 double quoted strings).  They are the same as those used in the C 
 programming language.
 
@@ -147,21 +147,13 @@
 @end group
 @end example
 
-In scripts the two different string types can be distinguished, if necessary,
+In scripts the two different string types can be distinguished if necessary
 by using @code{is_dq_string} and @code{is_sq_string}.
 
 @DOCSTRING(is_dq_string)
 
 @DOCSTRING(is_sq_string)
 
-The use of double quotes for strings with escape sequences and single quotes
-for verbatim input is quite straightforward.  However, @sc{matlab} behavior
-is inconsistent in this regard and in certain instances will do escape sequence
-processing even within single quotes.  When absolute compatibility is essential
-Octave can perform the same processing.
-
-@DOCSTRING(single_quote_escape_processing)
-
 @node Character Arrays
 @section Character Arrays
 
--- a/src/octave.cc
+++ b/src/octave.cc
@@ -615,7 +615,6 @@
                          "%%-- %D %I:%M %p --%%");
   bind_internal_variable ("page_screen_output", false);
   bind_internal_variable ("print_empty_dimensions", false);
-  bind_internal_variable ("single_quote_escape_processing", true);
 
   disable_warning ("Octave:abbreviated-property-match");
   disable_warning ("Octave:fopen-file-in-path");
--- a/src/ov.cc
+++ b/src/ov.cc
@@ -87,9 +87,6 @@
 #include "utils.h"
 #include "variables.h"
 
-// Expand escape sequences even in single quoted strings (Matlab compatibility)
-bool Vsingle_quote_escape_processing = false;
-
 // We are likely to have a lot of octave_value objects to allocate, so
 // make the grow_size large.
 DEFINE_OCTAVE_ALLOCATOR2(octave_value, 1024);
@@ -3047,42 +3044,3 @@
 %!error is_dq_string ()
 %!error is_dq_string ("foo", 2)
 */
-
-DEFUN (single_quote_escape_processing, args, nargout,
-  "-*- texinfo -*-\n\
-@deftypefn  {Built-in Function} {@var{val} =} single_quote_escape_processing ()\n\
-@deftypefnx {Built-in Function} {@var{old_val} =} single_quote_escape_processing (@var{new_val})\n\
-@deftypefnx {Built-in Function} {} single_quote_escape_processing (@var{new_val}, \"local\")\n\
-Query or set the internal variable that controls whether Octave processes\n\
-escape sequences within single quoted strings.\n\
-\n\
-Ordinarily, escape sequences such as \"\\n\" => newline are only processed\n\
-in double quoted strings.  However, @sc{matlab} performs escape sequence\n\
-processing even for single quoted strings for certain functions.  This\n\
-variable enables @sc{matlab} compatibility for these instances:\n\
-\n\
-@table @code\n\
-@item printf\n\
-@itemx sprintf\n\
-@itemx fprintf\n\
-Process format specification string @var{template}.\n\
-\n\
-@item error\n\
-Process format specification string @var{template}.\n\
-\n\
-@item regexp\n\
-@itemx regexpi\n\
-Process pattern string @var{pat}.\n\
-\n\
-@item regexprep\n\
-Process pattern string @var{pat} and replacement string @var{repstr}.\n\
-@end table\n\
-\n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
-@seealso{printf, sprintf, fprintf, error, regexp, regexpi, regexprep}\n\
-@end deftypefn")
-{
-  return SET_INTERNAL_VARIABLE (single_quote_escape_processing);
-}
--- a/src/ov.h
+++ b/src/ov.h
@@ -1387,7 +1387,4 @@
 DEF_DUMMY_VALUE_EXTRACTOR (octave_value, octave_value ())
 #undef DEF_DUMMY_VALUE_EXTRACTOR
 
-// Expand escape sequences even in single quoted strings (Matlab compatibility)
-extern bool Vsingle_quote_escape_processing;
-
 #endif