From 1659f94a4c8acff1c2564226db21afbd2bc04736 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 7 Mar 2019 17:03:12 +0100 Subject: Possibility to show converted fixed form Create an easy possibility to show the Fortran source as converted from fixed form to free form. --- src/debug.cpp | 1 + src/debug.h | 3 ++- src/fortranscanner.l | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/debug.cpp b/src/debug.cpp index 2f343ac..4c7afb3 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -49,6 +49,7 @@ static LabelMap s_labels[] = { "filteroutput", Debug::FilterOutput }, { "lex", Debug::Lex }, { "plantuml", Debug::Plantuml }, + { "fortranfixed2free", Debug::FortranFixed2Free }, { 0, (Debug::DebugMask)0 } }; diff --git a/src/debug.h b/src/debug.h index 9a2070c..79bc3d8 100644 --- a/src/debug.h +++ b/src/debug.h @@ -38,7 +38,8 @@ class Debug Markdown = 0x00000800, FilterOutput = 0x00001000, Lex = 0x00002000, - Plantuml = 0x00004000 + Plantuml = 0x00004000, + FortranFixed2Free = 0x00008000 }; static void print(DebugMask mask,int prio,const char *fmt,...); static int setFlag(const char *label); diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 1f0c356..e5dc5ca 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -66,6 +66,7 @@ #include "fortrancode.h" #include "pre.h" #include "arguments.h" +#include "debug.h" // Toggle for some debugging info //#define DBG_CTX(x) fprintf x @@ -2640,6 +2641,8 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, Fortra //printf("Input fixed form string:\n%s\n", fileBuf); //printf("===========================\n"); inputString = prepassFixedForm(fileBuf, NULL); + Debug::print(Debug::FortranFixed2Free,0,"======== Fixed to Free format =========\n---- Input fixed form string ------- \n%s\n", fileBuf); + Debug::print(Debug::FortranFixed2Free,0,"---- Resulting free form string ------- \n%s\n", inputString); //printf("Resulting free form string:\n%s\n", inputString); //printf("===========================\n"); -- cgit v0.12