Commit dece46a 1 parent bf1a0bc commit dece46a Copy full SHA for dece46a
File tree 4 files changed +18
-0
lines changed
4 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 42
42
43
43
### Fixed
44
44
45
+ - Fixed end of scope errors raised by trailing semicolon in native parser
46
+ ([ #265 ] ( https://github.com/fortran-lang/fortls/issues/265 ) )
45
47
- Fixed bug where parent scope for includes in AST could be ` None `
46
48
([ #329 ] ( https://github.com/fortran-lang/fortls/issues/329 ) )
47
49
- Fixed preprocessor bug with ` if ` and ` elif ` conditionals
Original file line number Diff line number Diff line change @@ -1350,6 +1350,7 @@ def parse(
1350
1350
multi_lines .extendleft (line_stripped .split (";" ))
1351
1351
line = multi_lines .pop ()
1352
1352
line_stripped = line
1353
+ line_no_comment = line
1353
1354
# Test for scope end
1354
1355
if file_ast .end_scope_regex is not None :
1355
1356
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():
39
39
err_str , _ = file .load_from_disk ()
40
40
file .parse ()
41
41
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