Skip to content

Commit 7ff6ebb

Browse files
vermaserentueda
authored andcommitted
Fixed Fortran90 output
Making sure that the updates for continuation lines in Fortran90 are not contradictory.
1 parent d9791a2 commit 7ff6ebb

2 files changed

Lines changed: 39 additions & 26 deletions

File tree

sources/notation.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,12 +968,22 @@ void PrintSubtermList(int from,int to)
968968
continuation line in fortran mode.
969969
But the next statement should start on a blank line.
970970
*/
971+
/*
971972
FiniLine();
972973
if ( AC.OutputMode == FORTRANMODE || AC.OutputMode == PFORTRANMODE ) {
973-
AO.OutFill = AO.OutputLine; /* Clear the line */
974+
AO.OutFill = AO.OutputLine;
974975
TokenToLine((UBYTE *)" ");
975976
AO.OutSkip = 7;
976977
}
978+
*/
979+
if ( AC.OutputMode == FORTRANMODE || AC.OutputMode == PFORTRANMODE ) {
980+
AO.OutSkip = 6;
981+
FiniLine();
982+
AO.OutSkip = 7;
983+
}
984+
else {
985+
FiniLine();
986+
}
977987
i += inc;
978988
} while ( i != to );
979989
}

sources/sch.c

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* You should have received a copy of the GNU General Public License along
2929
* with FORM. If not, see <http://www.gnu.org/licenses/>.
3030
*/
31-
/* #] License : */
31+
/* #] License : */
3232
/*
3333
#[ Includes : sch.c
3434
*/
@@ -59,7 +59,7 @@ static int noextralinefeed = 0;
5959
static int lowestlevel = 1;
6060

6161
/*
62-
#] Includes :
62+
#] Includes :
6363
#[ schryf-Utilities :
6464
#[ StrCopy : UBYTE *StrCopy(from,to)
6565
*/
@@ -71,7 +71,7 @@ UBYTE *StrCopy(UBYTE *from, UBYTE *to)
7171
}
7272

7373
/*
74-
#] StrCopy :
74+
#] StrCopy :
7575
#[ AddToLine : VOID AddToLine(s)
7676
7777
Puts the characters of s in the outputline. If the line becomes
@@ -175,7 +175,7 @@ VOID AddToLine(UBYTE *s)
175175
}
176176

177177
/*
178-
#] AddToLine :
178+
#] AddToLine :
179179
#[ FiniLine : VOID FiniLine()
180180
*/
181181

@@ -194,7 +194,9 @@ VOID FiniLine()
194194
if ( noextralinefeed == 0 ) {
195195
if ( AC.OutputMode == FORTRANMODE && AC.IsFortran90 == ISFORTRAN90
196196
&& Out > AO.OutputLine ) {
197+
/*
197198
*Out++ = fcontchar;
199+
*/
198200
}
199201
#ifdef WITHRETURN
200202
*Out++ = CARRIAGERETURN;
@@ -255,7 +257,7 @@ VOID FiniLine()
255257
}
256258

257259
/*
258-
#] FiniLine :
260+
#] FiniLine :
259261
#[ IniLine : VOID IniLine(extrablank)
260262
261263
Initializes the output line for the type of output
@@ -287,7 +289,7 @@ VOID IniLine(WORD extrablank)
287289
}
288290

289291
/*
290-
#] IniLine :
292+
#] IniLine :
291293
#[ LongToLine : VOID LongToLine(a,na)
292294
293295
Puts a Long integer in the output line. If it is only a single
@@ -322,7 +324,7 @@ VOID LongToLine(UWORD *a, WORD na)
322324
}
323325

324326
/*
325-
#] LongToLine :
327+
#] LongToLine :
326328
#[ RatToLine : VOID RatToLine(a,na)
327329
328330
Puts a rational number in the output line. The sign is ignored.
@@ -502,7 +504,7 @@ VOID RatToLine(UWORD *a, WORD na)
502504
}
503505

504506
/*
505-
#] RatToLine :
507+
#] RatToLine :
506508
#[ TalToLine : VOID TalToLine(x)
507509
508510
Writes the unsigned number x to the output as a single token.
@@ -527,7 +529,7 @@ VOID TalToLine(UWORD x)
527529
}
528530

529531
/*
530-
#] TalToLine :
532+
#] TalToLine :
531533
#[ TokenToLine : VOID TokenToLine(s)
532534
533535
Puts s in the output buffer. If it doesn't fit the buffer is
@@ -597,10 +599,11 @@ VOID TokenToLine(UBYTE *s)
597599
Out = AO.OutputLine;
598600
if ( AO.BlockSpaces == 0 ) {
599601
for ( j = 0; j < AO.OutSkip; j++ ) { *Out++ = ' '; }
600-
if ( ( AC.OutputMode == FORTRANMODE || AC.OutputMode == PFORTRANMODE )
601-
&& AO.OutSkip == 7 ) {
602+
if ( ( AC.OutputMode == FORTRANMODE || AC.OutputMode == PFORTRANMODE ) ) {
603+
if ( AO.OutSkip == 7 ) {
602604
Out[-2] = fcontchar;
603605
Out[-1] = ' ';
606+
}
604607
}
605608
}
606609
/*
@@ -639,7 +642,7 @@ VOID TokenToLine(UBYTE *s)
639642
}
640643

641644
/*
642-
#] TokenToLine :
645+
#] TokenToLine :
643646
#[ CodeToLine : VOID CodeToLine(name,number,mode)
644647
645648
Writes a name and possibly its number to output as a single token.
@@ -655,7 +658,7 @@ UBYTE *CodeToLine(WORD number, UBYTE *Out)
655658
}
656659

657660
/*
658-
#] CodeToLine :
661+
#] CodeToLine :
659662
#[ AddArrayIndex :
660663
*/
661664

@@ -675,7 +678,7 @@ UBYTE *AddArrayIndex(WORD num,UBYTE *out)
675678
}
676679

677680
/*
678-
#] AddArrayIndex :
681+
#] AddArrayIndex :
679682
#[ PrtTerms : VOID PrtTerms()
680683
*/
681684

@@ -697,7 +700,7 @@ VOID PrtTerms()
697700
}
698701

699702
/*
700-
#] PrtTerms :
703+
#] PrtTerms :
701704
#[ WrtPower :
702705
*/
703706

@@ -733,7 +736,7 @@ UBYTE *WrtPower(UBYTE *Out, WORD Power)
733736
}
734737

735738
/*
736-
#] WrtPower :
739+
#] WrtPower :
737740
#[ PrintTime :
738741
*/
739742

@@ -747,7 +750,7 @@ void PrintTime()
747750
}
748751

749752
/*
750-
#] PrintTime :
753+
#] PrintTime :
751754
#] schryf-Utilities :
752755
#[ schryf-Writes :
753756
#[ WriteLists : VOID WriteLists()
@@ -1202,7 +1205,7 @@ VOID WriteLists()
12021205
}
12031206

12041207
/*
1205-
#] WriteLists :
1208+
#] WriteLists :
12061209
#[ WriteArgument : VOID WriteArgument(WORD *t)
12071210
12081211
Write a single argument field. The general field goes to
@@ -1301,7 +1304,7 @@ VOID WriteArgument(WORD *t)
13011304
}
13021305

13031306
/*
1304-
#] WriteArgument :
1307+
#] WriteArgument :
13051308
#[ WriteSubTerm : WORD WriteSubTerm(sterm,first)
13061309
13071310
Writes a single subterm field to the output line.
@@ -1671,7 +1674,7 @@ WORD WriteSubTerm(WORD *sterm, WORD first)
16711674
}
16721675

16731676
/*
1674-
#] WriteSubTerm :
1677+
#] WriteSubTerm :
16751678
#[ WriteInnerTerm : WORD WriteInnerTerm(term,first)
16761679
16771680
Writes the contents of term to the output.
@@ -1822,7 +1825,7 @@ WORD WriteInnerTerm(WORD *term, WORD first)
18221825
}
18231826

18241827
/*
1825-
#] WriteInnerTerm :
1828+
#] WriteInnerTerm :
18261829
#[ WriteTerm : WORD WriteTerm(term,lbrac,first,prtf,br)
18271830
18281831
Writes a term to output. It tests the bracket information first.
@@ -2148,7 +2151,7 @@ WrtTmes: t = term;
21482151
}
21492152

21502153
/*
2151-
#] WriteTerm :
2154+
#] WriteTerm :
21522155
#[ WriteExpression : WORD WriteExpression(terms,ltot)
21532156
21542157
Writes a subexpression to output.
@@ -2182,7 +2185,7 @@ WORD WriteExpression(WORD *terms, LONG ltot)
21822185
}
21832186

21842187
/*
2185-
#] WriteExpression :
2188+
#] WriteExpression :
21862189
#[ WriteAll : WORD WriteAll()
21872190
21882191
Writes all expressions that should be written
@@ -2398,7 +2401,7 @@ WORD WriteAll()
23982401
}
23992402

24002403
/*
2401-
#] WriteAll :
2404+
#] WriteAll :
24022405
#[ WriteOne : WORD WriteOne(name,alreadyinline)
24032406
24042407
Writes one expression from the preprocessor
@@ -2552,7 +2555,7 @@ WORD WriteOne(UBYTE *name, int alreadyinline, int nosemi)
25522555
}
25532556

25542557
/*
2555-
#] WriteOne :
2558+
#] WriteOne :
25562559
#] schryf-Writes :
25572560
*/
25582561

0 commit comments

Comments
 (0)