Skip to content

Commit 2dd6bbb

Browse files
committed
Bug fix: parse_array should be recursive because it is called by parse_value. This resolves Issue #28.
Also added optional input to load_json_file
1 parent 1cfc389 commit 2dd6bbb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/json_module.f90

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -591,14 +591,15 @@ end subroutine move_pointer_in_json_file
591591
!
592592
! SOURCE
593593

594-
subroutine load_json_file(me, filename)
594+
subroutine load_json_file(me, filename, unit)
595595

596596
implicit none
597597

598598
class(json_file),intent(inout) :: me
599599
character(len=*),intent(in) :: filename
600+
integer,intent(in),optional :: unit
600601

601-
call json_parse(filename, me%p)
602+
call json_parse(file=filename, p=me%p, unit=unit)
602603

603604
end subroutine load_json_file
604605
!*****************************************************************************************
@@ -1285,7 +1286,7 @@ end subroutine json_value_destroy
12851286
!****f* json_module/json_value_remove
12861287
!
12871288
! NAME
1288-
! json_value_destroy
1289+
! json_value_remove
12891290
!
12901291
! DESCRIPTION
12911292
! Remove a json_value (and all its children)
@@ -4206,7 +4207,7 @@ end subroutine parse_object
42064207
!
42074208
! SOURCE
42084209

4209-
subroutine parse_array(unit, array)
4210+
recursive subroutine parse_array(unit, array)
42104211

42114212
implicit none
42124213

0 commit comments

Comments
 (0)