]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gfortran.h: Add flag_backslash compile-time option.
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>
Mon, 20 Jun 2005 20:16:59 +0000 (22:16 +0200)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Mon, 20 Jun 2005 20:16:59 +0000 (20:16 +0000)
* gfortran.h: Add flag_backslash compile-time option.
* lang.opt: Add support for -fbackslash option.
* options.c: Likewise.
* primary.c: Implement behavior for -fno-backslash.
* invoke.texi: Add doc for -fbackslash option.
* gfortran.texi: Remove mention of -fno-backslash as a
possible extension.
* gfortran.dg/backslash_1.f90: New test.
* gfortran.dg/backslash_2.f90: New test.

From-SVN: r101218

gcc/fortran/ChangeLog
gcc/fortran/gfortran.h
gcc/fortran/gfortran.texi
gcc/fortran/invoke.texi
gcc/fortran/lang.opt
gcc/fortran/options.c
gcc/fortran/primary.c
gcc/testsuite/ChangeLog

index 4397327c9366513d39471039f75e4d939edb06f4..19cd70082e16b4eb1f5357aeb479cbb52282ace9 100644 (file)
@@ -1,3 +1,13 @@
+2005-06-19  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * gfortran.h: Add flag_backslash compile-time option.
+       * lang.opt: Add support for -fbackslash option.
+       * options.c: Likewise.
+       * primary.c: Implement behavior for -fno-backslash.
+       * invoke.texi: Add doc for -fbackslash option.
+       * gfortran.texi: Remove mention of -fno-backslash as a
+       possible extension.
+
 2005-06-20 Erik Edelmann <erik.edelmann@iki.fi>
 
        * intrinsic.c (check_intrinsic_standard): Fix spelling error
index acbe3e4d76e1a6545617c287f163bf6926a02861..58b4ab0f91d5e4aa3a8b441acf7b3742bf8c2411 100644 (file)
@@ -1420,6 +1420,7 @@ typedef struct
   int flag_pack_derived;
   int flag_repack_arrays;
   int flag_f2c;
+  int flag_backslash;
 
   int q_kind;
 
index ba1e5bf866a29d1416ddae84d71de717680bd79d..9e7d38e5b67512c9f1491a49ed509fb8713cbdff 100644 (file)
@@ -512,10 +512,6 @@ module storage either on stack or heap.
 Flag to cause the compiler to distinguish between upper and lower case
 names.  The Fortran 95 standard does not distinguish them.
 
-@item
-Compile switch for changing the interpretation of a backslash from a
-character to ``C''-style escape characters.
-
 @item
 Compile flag to generate code for array conformance checking (suggest -CC).
 
index 7367242ea8a647a55542b1d0d9da1198035892f0..2ef185a95ed8287f3b710d7d9706fbcb4c54a746 100644 (file)
@@ -221,6 +221,15 @@ Do nothing if this is already the default.
 @cindex character set
 Allow @samp{$} as a valid character in a symbol name.
 
+@cindex -fno-backslash option
+@cindex options, -fno-backslash
+@item -fno-backslash
+@cindex backslash
+@cindex escape characters
+@item
+Compile switch to change the interpretation of a backslash from
+``C''-style escape characters to a single backslash character.
+
 @cindex -ffixed-line-length-@var{n} option
 @cindex options, -ffixed-line-length-@var{n}
 @item -ffixed-line-length-@var{n}
index 92afd637740b4daa6dd200049342379778a1e68c..a769842187907369a84c89fa68890380e2ad6e92 100644 (file)
@@ -85,6 +85,10 @@ fdollar-ok
 F95
 Allow dollar signs in entity names
 
+fbackslash
+F95
+Specify that backslash in string introduces an escape character
+
 fdump-parse-tree
 F95
 Display the code tree after parsing.
index 2603caa67a8c35a83b6dfc228e55eb3d1c6e9431..0045960ab1c95a97f638f252a8bcc916bc929f19 100644 (file)
@@ -70,6 +70,7 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED,
   gfc_option.flag_no_backend = 0;
   gfc_option.flag_pack_derived = 0;
   gfc_option.flag_repack_arrays = 0;
+  gfc_option.flag_backslash = 1;
 
   gfc_option.q_kind = gfc_default_double_kind;
 
@@ -229,6 +230,10 @@ gfc_handle_option (size_t scode, const char *arg, int value)
       gfc_option.flag_dollar_ok = value;
       break;
 
+    case OPT_fbackslash:
+      gfc_option.flag_backslash = value;
+      break;
+
     case OPT_fdump_parse_tree:
       gfc_option.verbose = value;
       break;
index 38f9939201f3b8ea423bbbe25577e51c015cc037..413d64e106c612e089650383c5d24a217ff2e834 100644 (file)
@@ -637,7 +637,7 @@ next_string_char (char delimiter)
   if (c == '\n')
     return -2;
 
-  if (c == '\\')
+  if (gfc_option.flag_backslash && c == '\\')
     {
       old_locus = gfc_current_locus;
 
index f831513fc08be0942dfffdaa84e43f431397afb2..8b716481836d49c8ed1ccfee705439d83055b0d2 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-19  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * gfortran.dg/backslash_1.f90: New test.
+       * gfortran.dg/backslash_2.f90: New test.
+
 2005-06-20  Jan Beulich  <jbeulich@novell.com>
 
        * g++.old-deja/g++.jason/thunk2.C: On NetWare, also account for