Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
module Blocks | ||
implicit none | ||
|
||
integer :: i | ||
|
||
contains | ||
|
||
function MyFunc(thing) | ||
integer, intent(in) :: thing | ||
integer :: myfunc | ||
|
||
block | ||
! these obviously won't show up, because variables inside functions inside modules don't anyway | ||
! and that's fine | ||
integer :: tempint | ||
tempint = 1 | ||
if (tempint == 1) then | ||
tempint = 2 | ||
end if | ||
myfunc = tempint | ||
end block | ||
|
||
end function MyFunc | ||
|
||
end module Blocks | ||
|
||
program Main | ||
use Blocks | ||
|
||
implicit none | ||
|
||
! these variable declarations should definitely show up in the symbol list | ||
integer :: otherint, moreint | ||
|
||
otherint = 3 | ||
|
||
block | ||
! These shouldn't, because... | ||
integer :: newtempint | ||
|
||
newtempint = 2 | ||
block | ||
! ...the damn things can be arbitrarily nested! | ||
integer :: newer_int | ||
|
||
newer_int = 3 | ||
end block | ||
newtempint = 2 * newtempint | ||
end block | ||
|
||
end program Main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# format=tagmanager | ||
Blocks�256�0 | ||
Main�2048�0 | ||
MyFunc�16�Blocks�0 | ||
i�16384�Blocks�0 | ||
moreint�16384�Main�0 | ||
otherint�16384�Main�0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
module HasInterfaces | ||
! INTERFACE blocks can have names | ||
! usually only used for when overloading, but good practice anyway! | ||
interface MyFunc | ||
function Func1(arg) | ||
integer :: arg | ||
end function Func1 | ||
|
||
function Func2(arg) | ||
integer :: arg | ||
end function Func2 | ||
end interface MyFunc | ||
|
||
! without a name we just use a generic one | ||
interface | ||
subroutine CHEEV(...) | ||
! ... | ||
end subroutine CHEEV | ||
end interface | ||
|
||
contains | ||
|
||
function Func1(arg) | ||
integer :: arg, func1 | ||
func1 = arg | ||
end function Func1 | ||
|
||
function Func2(arg) | ||
integer :: arg, func2 | ||
func2 = arg | ||
end function Func2 | ||
|
||
end module HasInterfaces | ||
|
||
program Main | ||
use HasInterfaces | ||
|
||
! can also occur in PROGRAMs | ||
interface MySubroutine | ||
subroutine Sub1(arg) | ||
! ... | ||
end subroutine Sub1 | ||
end interface MySubroutine | ||
|
||
end program Main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# format=tagmanager | ||
Func1�16�HasInterfaces�0 | ||
Func2�16�HasInterfaces�0 | ||
HasInterfaces�256�0 | ||
Interface#0�32�HasInterfaces�0 | ||
Main�2048�0 | ||
MyFunc�32�HasInterfaces�0 | ||
MySubroutine�32�Main�0 |