namespace Fortran::evaluate {
-extern bool formatForPGF90;
-
template<typename A>
auto operator<<(std::ostream &o, const A &x) -> decltype(x.AsFortran(o)) {
return x.AsFortran(o);
namespace Fortran::evaluate {
-bool formatForPGF90{false};
-
static void ShapeAsFortran(std::ostream &o, const ConstantSubscripts &shape) {
if (GetRank(shape) > 1) {
o << ",shape=";
if (j > 0) {
o << ',';
}
- if (Result::kind != 1 || !formatForPGF90) {
+ if (Result::kind != 1) {
o << Result::kind << '_';
}
o << parser::QuoteCharacterLiteral(value);
!Expect: m.mod
!module m
-! character(2_4,1),parameter::prefix=1_"c_"
-! integer(4),bind(c, name=1_"c_a")::a
-! procedure(sub),bind(c, name=1_"c_b"),pointer::b
+! character(2_4,1),parameter::prefix="c_"
+! integer(4),bind(c, name="c_a")::a
+! procedure(sub),bind(c, name="c_b"),pointer::b
! type,bind(c)::t
! real(4)::c
! end type
-! procedure(real(4)),bind(c, name=1_"dd")::d
-! procedure(real(4)),bind(c, name=1_"ee")::e
-! procedure(real(4)),bind(c, name=1_"ff")::f
+! procedure(real(4)),bind(c, name="dd")::d
+! procedure(real(4)),bind(c, name="ee")::e
+! procedure(real(4)),bind(c, name="ff")::f
!contains
-! subroutine sub() bind(c, name=1_"sub")
+! subroutine sub() bind(c, name="sub")
! end
!end
! integer(8),parameter::i=2_8
! real(4)::r
! character(10_4,1)::c
-! character(10_4,1),parameter::c2=1_"qwer "
+! character(10_4,1),parameter::c2="qwer "
! complex(8),parameter::z=(1._8,2._8)
! complex(8),parameter::zn=(-1._8,2._8)
! type::t
! bind(c)::/cb2/
! common//t,w,u,v
! common/cb/x,y,z
-! bind(c, name=1_"CB")::/cb/
+! bind(c, name="CB")::/cb/
! common/b/cb
!end
!character(1_4,int(k,kind=8))::a
!character(3_4,int(k,kind=8))::b
!end type
-!type(t(k=1_4)),parameter::p=t(k=1_4)(a=1_"x",b=1_"xx ")
-!character(2_4,1),parameter::c2(1_8:3_8)=[CHARACTER(KIND=1,LEN=2)::1_"x ",1_"xx",1_"xx"]
+!type(t(k=1_4)),parameter::p=t(k=1_4)(a="x",b="xx ")
+!character(2_4,1),parameter::c2(1_8:3_8)=[CHARACTER(KIND=1,LEN=2)::"x ","xx","xx"]
!end
!Expect: m.mod
!module m
!character(*,4),parameter::c4=4_"Hi! \344\275\240\345\245\275!"
-!character(*,1),parameter::c1=1_"Hi! \344\275\240\345\245\275!"
+!character(*,1),parameter::c1="Hi! \344\275\240\345\245\275!"
!character(*,4),parameter::c4a(1_8:*)=[CHARACTER(KIND=4,LEN=1)::4_"\344\270\200",4_"\344\272\214",4_"\344\270\211",4_"\345\233\233",4_"\344\272\224"]
!integer(4),parameter::lc4=7_4
!intrinsic::len
!Expect: m4a.mod
!module m4a
-! character(1_4,1),parameter::a=1_"\001"
+! character(1_4,1),parameter::a="\001"
! intrinsic::achar
!end
!module m4b
! use m4a,only:a
! use m4a,only:achar
-! character(1_4,1),parameter::b=1_"\001"
+! character(1_4,1),parameter::b="\001"
!end
{
std::ofstream tmpSource;
tmpSource.open(tmpSourcePath);
- Fortran::evaluate::formatForPGF90 = true;
Unparse(tmpSource, parseTree, driver.encoding, true /*capitalize*/,
options.features.IsEnabled(
Fortran::common::LanguageFeature::BackslashEscapes),
nullptr /* action before each statement */,
driver.unparseTypedExprsToPGF90 ? &asFortran : nullptr);
- Fortran::evaluate::formatForPGF90 = false;
}
if (ParentProcess()) {