Git Product home page Git Product logo

Comments (4)

pseewald avatar pseewald commented on June 18, 2024 1

I don't think its related to the directives directly. it is just that when you find a subroutine/module opening you indent afterwards.

I confirm.

we would need to be able to avoid indentation if a new 'region' is open with the same type

I don't think this is general enough, as some of the 'regions' can be nested (e.g. Do, If). I don't see any other way to support this than to parse preprocessor statements, which is not worth it just to get these corner cases right, IMO.

@flokno If you really want to use the preprocessor in this way, and still want you code to be correctly formatted by fprettify, I suggest the following workaround:

#ifdef AGRESSIVE_SANITY
    module function lo_trace(m) result(tr)
#else
        module pure function lo_trace(m) result(tr)
#endif
            real(flyt), dimension(:, :), intent(in) :: m
            real(flyt) :: tr
#ifdef AGRESSIVE_SANITY
        end function
#else
    end function
#endif

from fprettify.

flokno avatar flokno commented on June 18, 2024

Comment: Maybe it's not the preprocessor per se, since apparently there are some checks: https://github.com/pseewald/fprettify/blob/master/fprettify/fparse_utils.py#L35-L46

from fprettify.

GSS79 avatar GSS79 commented on June 18, 2024

I don't think its related to the directives directly. it is just that when you find a subroutine/module opening you indent afterwards.

we would need to be able to avoid indentation if a new 'region' is open with the same type

from fprettify.

flokno avatar flokno commented on June 18, 2024

ok thanks @pseewald for the workaround

from fprettify.

Related Issues (20)

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.