Skip to content

Commit e2c03dd

Browse files
committed
more refactoring.
1 parent 21f3745 commit e2c03dd

File tree

3 files changed

+8
-25
lines changed

3 files changed

+8
-25
lines changed

src/json_file_module.F90

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,6 @@ subroutine json_file_print_to_console(me)
299299

300300
class(json_file),intent(inout) :: me
301301

302-
!character(kind=CK,len=:),allocatable :: dummy
303-
304-
!call json_value_print(me%p,iunit=output_unit,str=dummy,indent=1,colon=.true.)
305302
call json_print(me%p,iunit=output_unit)
306303

307304
end subroutine json_file_print_to_console
@@ -320,12 +317,7 @@ subroutine json_file_print_1(me, iunit)
320317
class(json_file),intent(inout) :: me
321318
integer(IK),intent(in) :: iunit !! file unit number (must not be -1)
322319

323-
!integer(IK) :: i
324-
!character(kind=CK,len=:),allocatable :: dummy
325-
326320
if (iunit/=unit2str) then
327-
!i = iunit
328-
!call json_value_print(me%p,iunit=i,str=dummy,indent=1,colon=.true.)
329321
call json_print(me%p,iunit=iunit)
330322
else
331323
call throw_exception('Error in json_file_print_1: iunit must not be -1.')
@@ -359,18 +351,7 @@ subroutine json_file_print_2(me,filename)
359351
class(json_file),intent(inout) :: me
360352
character(kind=CDK,len=*),intent(in) :: filename !! filename to print to
361353

362-
integer(IK) :: iunit,istat
363-
364-
!...note: why not just call [[json_print_2]] here?
365-
366-
open(newunit=iunit,file=filename,status='REPLACE',iostat=istat FILE_ENCODING )
367-
if (istat==0) then
368-
call me%print_file(iunit) !call the other routine
369-
close(iunit,iostat=istat)
370-
else
371-
call throw_exception('Error in json_file_print_2: could not open file: '//&
372-
trim(filename))
373-
end if
354+
call json_print(me%p,filename)
374355

375356
end subroutine json_file_print_2
376357
!*****************************************************************************************

src/json_kinds.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
! JSON-Fortran procedures since they have been overloaded to accept ```intent(in)```
2929
! character arguments of the default (```CDK```) kind. If you find a procedure which does
3030
! not accept an ```intent(in)``` literal string argument of default kind, please
31-
! [file an issue](https://github.com/jacobwilliams/json-fortran/issues/new) on github.
31+
! [file an issue](https://github.com/jacobwilliams/json-fortran/issues/new) on GitHub.
3232

3333
module json_kinds
3434

src/json_string_utilities.F90

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ module json_string_utilities
1515
character(kind=CK,len=*),parameter,public :: star = '*' !! for invalid numbers and
1616
!! list-directed real output
1717

18-
!*************************************************************************************
18+
!******************************************************
1919
!>
20-
! Convert a 'DEFAULT' kind character input to 'ISO_10646' kind and return it
20+
! Convert a 'DEFAULT' kind character input to
21+
! 'ISO_10646' kind and return it
2122
interface to_unicode
2223
module procedure to_uni, to_uni_vec
2324
end interface
24-
!*************************************************************************************
25+
!******************************************************
2526

2627
# ifdef USE_UCS4
2728
!******************************************************
@@ -32,6 +33,7 @@ module json_string_utilities
3233
module procedure ucs4_join_default, default_join_ucs4
3334
end interface
3435
public :: operator(//)
36+
!******************************************************
3537

3638
!******************************************************
3739
!>
@@ -41,11 +43,11 @@ module json_string_utilities
4143
module procedure ucs4_comp_default, default_comp_ucs4
4244
end interface
4345
public :: operator(==)
46+
!******************************************************
4447
# endif
4548

4649
public :: integer_to_string
4750
public :: real_to_string
48-
public :: compact_real_string
4951
public :: valid_json_hex
5052
public :: to_unicode
5153

0 commit comments

Comments
 (0)