Comments (4)
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.
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.
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.
ok thanks @pseewald for the workaround
from fprettify.
Related Issues (20)
- Recursive flag does not work when input is a single file HOT 2
- Streamline and document testing mechanism
- Indenting line labels HOT 1
- config file example HOT 4
- Can comments starting in column 1 be indented? HOT 2
- Feature request: Support the letters q and Q in the expression of quadruple precision variables.
- Feature Request: add optional double colon `::`
- Support for coarray syntax
- `--enable-replacements` breaks multi-line Fortran statements HOT 1
- Variable names confused w/ relational operators
- indentation fails at multiple subroutine definitions in preprocessor directives HOT 3
- Request to vertically align code blocks via various characters HOT 3
- Allow only single indentation width for function/subroutine calls that span multiple lines HOT 2
- not possible to both --disable-whitespace and enable intrinsic case formatting
- define maximum number of empty lines
- Lower case variables? HOT 4
- Lines are split improperly with --enable-replacement HOT 3
- Deactivation doesn't disable indentation
- Indentation broken for named select case statements HOT 3
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 fprettify.