Giter VIP home page Giter VIP logo

Comments (4)

wvermin avatar wvermin commented on August 20, 2024

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.

wvermin avatar wvermin commented on August 20, 2024

accidentally closed, re-opened it

from findent.

sindizzy avatar sindizzy commented on August 20, 2024

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.

wvermin avatar wvermin commented on August 20, 2024

Ok, closing now after a little edit of my answer above.

from findent.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.