@@ -245,7 +245,7 @@ module json_module
245
245
!
246
246
! SOURCE
247
247
248
- type,public :: json_value
248
+ type,public :: json_value
249
249
250
250
! force the constituents to be stored contiguously
251
251
! [note: on Intel, the order of the variables below
@@ -272,11 +272,9 @@ module json_module
272
272
273
273
integer (IK),private :: n_children = 0 ! number of children
274
274
275
- end type json_value
275
+ end type json_value
276
276
! *********************************************************
277
277
278
- ! *********************************************************
279
- type,public :: json_file
280
278
! *********************************************************
281
279
! ****c* json_module/json_file
282
280
!
@@ -306,12 +304,14 @@ module json_module
306
304
!
307
305
! SOURCE
308
306
307
+ type,public :: json_file
308
+
309
309
private
310
310
311
311
! the JSON structure read from the file:
312
312
type (json_value),pointer :: p = > null ()
313
313
314
- contains
314
+ contains
315
315
316
316
procedure ,public :: load_file = > json_file_load
317
317
procedure ,public :: load_from_string = > json_file_load_from_string
@@ -363,8 +363,7 @@ module json_module
363
363
procedure :: json_file_print_1
364
364
procedure :: json_file_print_2
365
365
366
- ! *********************************************************
367
- end type json_file
366
+ end type json_file
368
367
! *********************************************************
369
368
370
369
! *************************************************************************************
@@ -506,7 +505,7 @@ end subroutine array_callback_func
506
505
! EXAMPLE
507
506
! Consider the following example:
508
507
! type(json_value) :: p
509
- ! ...
508
+ ! ! ...
510
509
! call json_print(p,'test.json') !this is json_print_2
511
510
!
512
511
! SOURCE
@@ -1574,14 +1573,10 @@ end subroutine json_value_create
1574
1573
! DESCRIPTION
1575
1574
! Destroy a json_value linked-list structure.
1576
1575
!
1577
- ! NOTES
1578
- ! This routine does not check for exceptions.
1579
- !
1580
- ! The original version of this routine was not
1581
- ! properly freeing the memory. It has been rewritten.
1582
- !
1583
1576
! AUTHOR
1584
- ! Jacob Williams : 1/22/2014
1577
+ ! Jacob Williams : 1/22/2014 : The original version of this
1578
+ ! routine was not properly freeing the memory.
1579
+ ! It has been rewritten.
1585
1580
!
1586
1581
! SOURCE
1587
1582
@@ -2569,7 +2564,7 @@ end subroutine json_value_add_string_vec
2569
2564
!
2570
2565
! SOURCE
2571
2566
2572
- function json_count (me ) result(count)
2567
+ pure function json_count (me ) result(count)
2573
2568
2574
2569
implicit none
2575
2570
@@ -3071,7 +3066,7 @@ end subroutine json_value_print
3071
3066
! Consider the following example:
3072
3067
! type(json_value),pointer :: dat,p
3073
3068
! logical :: found
3074
- ! ...
3069
+ ! ! ...
3075
3070
! call json_get(dat,'data(2).version',p,found)
3076
3071
!
3077
3072
! NOTES
@@ -4144,7 +4139,7 @@ subroutine json_parse(file, p, unit, str)
4144
4139
iostat = istat)
4145
4140
end if
4146
4141
4147
- elseif (.not. present (unit) .and. present (file) .and. .not. present (str)) then
4142
+ else if (.not. present (unit) .and. present (file) .and. .not. present (str)) then
4148
4143
4149
4144
! open the file with a new unit number:
4150
4145
open ( newunit = iunit, &
@@ -4155,7 +4150,7 @@ subroutine json_parse(file, p, unit, str)
4155
4150
position = ' REWIND' , &
4156
4151
iostat = istat)
4157
4152
4158
- elseif (.not. present (unit) .and. .not. present (file) .and. present (str)) then
4153
+ else if (.not. present (unit) .and. .not. present (file) .and. present (str)) then
4159
4154
4160
4155
buffer = str
4161
4156
iunit = 0 ! indicates that json data will be read from buffer
@@ -5468,7 +5463,7 @@ end subroutine push_char
5468
5463
!
5469
5464
! SOURCE
5470
5465
5471
- subroutine integer_to_string (ival ,str )
5466
+ pure subroutine integer_to_string (ival ,str )
5472
5467
5473
5468
implicit none
5474
5469
@@ -5635,7 +5630,7 @@ end subroutine compact_real_string
5635
5630
!
5636
5631
! SOURCE
5637
5632
5638
- function valid_json_hex (str ) result(valid)
5633
+ pure function valid_json_hex (str ) result(valid)
5639
5634
5640
5635
implicit none
5641
5636
0 commit comments