Skip to content
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

Match open/close statements and format them #112

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

cphyc
Copy link
Owner

@cphyc cphyc commented Nov 4, 2024

Closes #111.

Replaces

module m
  implicit none
contains
  real function twice(x)
      real, intent(in) :: x
      twice = 2 * x
  end

  subroutine sub(x, y)
      implicit none
      real, intent(in) :: x
      real, intent(out) :: y
      y = 2 * x + 4.5
  end
end

program main
use m
implicit none
real :: x, y
x = 10.0
call sub(x, y)
print *, y
print *, twice(y)
end

with

module m
    implicit none
contains
    real function twice(x)
        real, intent(in) :: x
        twice = 2 * x
    end function twice

    subroutine sub(x, y)
        implicit none
        real, intent(in) :: x
        real, intent(out) :: y
        y = 2 * x + 4.5
    end subroutine sub
end module m

program main
    use m
    implicit none
    real :: x, y
    x = 10.0
    call sub(x, y)
    print *, y
    print *, twice(y)
end program main

Verified

This commit was signed with the committer’s verified signature. The key has expired.
cphyc Corentin Cadiou
Replaces
program foo
end program

with program foo
end program foo
cphyc added 4 commits November 4, 2024 16:54

Verified

This commit was signed with the committer’s verified signature. The key has expired.
cphyc Corentin Cadiou

Verified

This commit was signed with the committer’s verified signature. The key has expired.
cphyc Corentin Cadiou

Verified

This commit was signed with the committer’s verified signature. The key has expired.
cphyc Corentin Cadiou

Verified

This commit was signed with the committer’s verified signature. The key has expired.
cphyc Corentin Cadiou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace end with end subroutine foo, end function foo, end program foo, end module foo as appropriate
1 participant