File tree Expand file tree Collapse file tree 4 files changed +18
-0
lines changed Expand file tree Collapse file tree 4 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 4242
4343### Fixed
4444
45+ - Fixed end of scope errors raised by trailing semicolon in native parser
46+ ([ #265 ] ( https://github.com/fortran-lang/fortls/issues/265 ) )
4547- Fixed bug where parent scope for includes in AST could be ` None `
4648 ([ #329 ] ( https://github.com/fortran-lang/fortls/issues/329 ) )
4749- Fixed preprocessor bug with ` if ` and ` elif ` conditionals
Original file line number Diff line number Diff line change @@ -1350,6 +1350,7 @@ def parse(
13501350 multi_lines .extendleft (line_stripped .split (";" ))
13511351 line = multi_lines .pop ()
13521352 line_stripped = line
1353+ line_no_comment = line
13531354 # Test for scope end
13541355 if file_ast .end_scope_regex is not None :
13551356 match = FRegex .END_WORD .match (line_no_comment )
Original file line number Diff line number Diff line change @@ -39,3 +39,12 @@ def test_private_visibility_interfaces():
3939 err_str , _ = file .load_from_disk ()
4040 file .parse ()
4141 assert err_str is None
42+
43+
44+ def test_end_scopes_semicolon ():
45+ file_path = test_dir / "parse" / "trailing_semicolon.f90"
46+ file = FortranFile (str (file_path ))
47+ err_str , _ = file .load_from_disk ()
48+ ast = file .parse ()
49+ assert err_str is None
50+ assert not ast .end_errors
Original file line number Diff line number Diff line change 1+ program trailing_semicolon_in_end_scope
2+ integer :: i
3+ do i= 1 , 3
4+ print * , " Hello World!"
5+ end do ;
6+ end program trailing_semicolon_in_end_scope
You can’t perform that action at this time.
0 commit comments