Don't allow Fortran if without then, fixes #63

This commit is contained in:
Andy K. Massimino
2019-06-16 09:08:46 -04:00
parent f1a3948db9
commit 411c32ae29
2 changed files with 16 additions and 2 deletions

View File

@@ -4,8 +4,6 @@ set cpo&vim
call matchup#util#patch_match_words('\<if', '\<if\>')
call matchup#util#patch_match_words('\<end\s*if', '\<end\>\s*if')
call matchup#util#patch_match_words('then\>', '\%(then\>\)\=')
call matchup#util#patch_match_words('then\)\=\>', '\%(then\>\)\=\)\=')
call matchup#util#append_match_words(
\ '^\s*#\s*if\(\|def\|ndef\)\>'

16
test/issues/63/test.f90 Normal file
View File

@@ -0,0 +1,16 @@
program matchup_parsing
real :: x = 1.0, y = 2.0, a
if (x < y) then
if (x == 0) stop
a = y / x
else
if (y == 0) stop ! matchup sees corresponding `if - end if` pairs from HERE
a = x / y
end if ! to HERE
write(*, *) a
end program