Comments (4)
Thanks for your comment about indenting continuation lines.
What you ask for is not unreasonable, but implementation in findent is problematic:
- a sloppy implementation would be to have an option to indent continuation lines, taking into account the original leading number of spaces. This method has the disadvantage that it is not reversible: once you forget to give the relevant flag, your desired indentation cannot be restored. This method would also not work with your original, very ill indented source.
- a better implementation would be to let findent recognize all patterns that are candidate for your proposed indentation: decralartions like LOGICAL or REAL, DIMENSION(N), INTENT(IN) :: or WRITE(COMPLICATED EXPRESSION TO COMPUTE UNIT NUMBER,*). As it is now, findent only recognizes structures that are amenable for changing the indent, it does not know about LOGICAL, WRITE and so on. So, implementation of this method would be difficult.
However, I see two solutions for you:
- The most easy: change
LOGICAL A,B,C, &
D,E
into:
LOGICAL &
A,B,C, &
D,E
findent will indent this thusly:
LOGICAL &
A,B,C, &
D,E
- A better way, with somewhat more work for you, change your code into something like this:
program issue9
character(len=10) adt, speed, config, nums(5) ! to get the write(*,*) compiled
LOGICAL ALPHA , BETA200 , &
& BZT , ISOKEQP , & !added a flag for equipment
& Use_Default_V , B100 , Have_T
Write(*,*) ADT(1:2) // ' ' // ADT(3:4) // ' ' // SPEED// ' ' // Config // ' ' // &
& ADT(1:8) // ' ' // Nums(I) // '.' // Nums(J)
end program
I.e. add the continuation character (&) at the start of the continuation line, this way you have complete control about the lay out.
Hoping this helps,
Willem
from findent.
accidentally closed, re-opened it
from findent.
Yes it does help. many thanks. I think either way I have some manual tweaking to do afterwards. The codebase is not large so I'm not against doing some manual alterations after findent.
from findent.
Ok, closing now after a little edit of my answer above.
from findent.
Related Issues (13)
- first commit to github
- Cross-compilation fails at man-page generation HOT 5
- Wrong identation after one-line do loop HOT 2
- Can comments starting in column 1 be indented? HOT 2
- preprocessor issue HOT 2
- Structures (Derived Types) HOT 4
- findent 2.8.0
- Feat req: Indentation for line continuation with non-fixed ammout HOT 3
- Bug: Refactor procedures ignores interface keyword HOT 2
- Contains different types of indentation HOT 1
- Bug: end procedure in submodule not indented HOT 1
- Feat req: Trim whitespaces between characters
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from findent.