Skip to content

Commit 064bd20

Browse files
committed
Adds unittest for #207 and updates CHANGELOG
1 parent d214d53 commit 064bd20

3 files changed

+441
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2323
- Fixes preprocessor syntax highlighting with derived type and conditionals
2424
([#249](https://github.com/krvajal/vscode-fortran-support/issues/249))
2525
- Fixes the general preprocessor syntax highlighting and adds testing
26+
- Fixes using function/subroutine as parameter in functions/subroutines
27+
([#207](https://github.com/krvajal/vscode-fortran-support/issues/207))
2628

2729
### Added
2830

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
interface function_subroutine_definitions
2+
3+
! Normal subroutine
4+
subroutine sub( arg )
5+
integer, intent(inout) :: arg
6+
end subroutine
7+
8+
! Normal functions
9+
integer function fun_integer( arg ) result(val)
10+
integer, intent(inout) :: arg
11+
end function fun_integer
12+
13+
real function fun_real( arg ) result(val)
14+
integer, intent(inout) :: arg
15+
end function fun_real
16+
17+
logical function fun_logical( arg ) result(val)
18+
integer, intent(inout) :: arg
19+
end function fun_logical
20+
21+
character(kind=1, len=100) function fun_character( arg ) result(val)
22+
integer, intent(inout) :: arg
23+
end function fun_character
24+
25+
double precision function fun_double_precision( arg ) result(val)
26+
integer, intent(inout) :: arg
27+
end function fun_double_precision
28+
29+
double complex function fun_double_complex( arg ) result(val)
30+
integer, intent(inout) :: arg
31+
end function fun_double_complex
32+
33+
! Weird edge cases where the keyword function/subroutine is also used as arguments
34+
function fun_with_fun( function )
35+
integer, intent(inout) :: function
36+
end function fun_with_fun
37+
38+
function fun_with_sub( subroutine )
39+
integer, intent(inout) :: subroutine
40+
end function fun_with_sub
41+
42+
subroutine sub_with_sub( subroutine )
43+
integer, intent(inout) :: subroutine
44+
end subroutine sub_with_sub
45+
46+
subroutine sub_with_fun( function )
47+
integer, intent(inout) :: function
48+
end subroutine sub_with_fun
49+
50+
end interface function_subroutine_definitions

0 commit comments

Comments
 (0)