-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
indentation fails at multiple subroutine definitions in preprocessor directives #156
Comments
@LukasvdWiel I would like to add a suggestion. It is unrelated to the content, but to the presentation of the content: If you would like to share a snippet of code in (Gruber's) Markdown, you either use four explicit spaces, or a tab of indentation. This is why Alternatively, GitHub's flavour of Markdown additionally allows (optionally annotated) fenced blocks you likely aimed to use. Note however, this approach usually does not use single quotes (your post in the present form), but back ticks (known in French as accent grave) to enclose such a snippet. (Link to a compilation of hints about/around markdown.) In addition to an easier copy-paste of such a snippet en bloc*, the annotation can enable syntax highlighting. Optional (mutually exclusive) keywords I know to be supported here on GitHub are for i in range(5):
print(i)
#!/usr/bin/awk -f
BEGIN{
string = "this is an example";
split(string, array)
for (i = 1; i<=length(array); i++){};
print array[i]} or program test
implicit none
integer :: i
do i = 1, 5
write (*, "(2(I2, 1X))") i, i**2
end do
end program test * This copy-paste then equally preserves the indentation (useful if it is functionally relevant, e.g. for Python). |
@nbehrnd Thank you very much, I have applied your wisdom to my original message... It made the issue a lot prettier. |
@LukasvdWiel A revisit of your post, which is conceptual. That is to say, share of a specific minimal working example could illustrate, hence substantiate your point. If your observation could be replicated with source code in a single file, one option is to add an additional Else, if you already split your program into a Briefly (because of the leading number signs) I thought your examples could be an example of an accidental code-switching to Python. It is a term in natural languages (e.g. Franglais in lieu of French (Français), or English (Anglais)) when elements of one language enter an other without representing e.g. a loanword. This impression however can be an error on my side, too. |
Let me have unformatted code:
I would expect [do something] to be indented once, and both subroutine calls to be equally indented:
but what happens is that the second subroutine definition of bla is already indented.
Worse then that, all code below takes the extra indent level, and subsequent subroutines, such as bar in this example, is indented more than it should.
I hope you could find time to fix this.
Have an excellent day!
Lukas
The text was updated successfully, but these errors were encountered: