Skip to content

Commit

Permalink
removed json_initialize_dummy_arguments.inc
Browse files Browse the repository at this point in the history
this usage is not supported by flang-new compiler. See #554
  • Loading branch information
jacobwilliams committed May 19, 2024
1 parent 6b6951a commit a2206b4
Show file tree
Hide file tree
Showing 4 changed files with 233 additions and 54 deletions.
189 changes: 170 additions & 19 deletions src/json_file_module.F90
Original file line number Diff line number Diff line change
Expand Up @@ -502,17 +502,55 @@ end subroutine json_file_print_error_message
! all have a similar interface.

subroutine initialize_json_core_in_file(me,&
#include "json_initialize_dummy_arguments.inc"
)
verbose,&
compact_reals,&
print_signs,&
real_format,&
spaces_per_tab,&
strict_type_checking,&
trailing_spaces_significant,&
case_sensitive_keys,&
no_whitespace,&
unescape_strings,&
comment_char,&
path_mode,&
path_separator,&
compress_vectors,&
allow_duplicate_keys,&
escape_solidus,&
stop_on_error,&
null_to_real_mode,&
non_normal_mode,&
use_quiet_nan, &
strict_integer_type_checking )

implicit none

class(json_file),intent(inout) :: me
#include "json_initialize_arguments.inc"

call me%core%initialize(&
#include "json_initialize_dummy_arguments.inc"
)
call me%core%initialize(verbose,&
compact_reals,&
print_signs,&
real_format,&
spaces_per_tab,&
strict_type_checking,&
trailing_spaces_significant,&
case_sensitive_keys,&
no_whitespace,&
unescape_strings,&
comment_char,&
path_mode,&
path_separator,&
compress_vectors,&
allow_duplicate_keys,&
escape_solidus,&
stop_on_error,&
null_to_real_mode,&
non_normal_mode,&
use_quiet_nan, &
strict_integer_type_checking )

end subroutine initialize_json_core_in_file
!*****************************************************************************************

Expand Down Expand Up @@ -568,8 +606,27 @@ end subroutine get_json_core_in_file
! all have a similar interface.

function initialize_json_file(p,&
#include "json_initialize_dummy_arguments.inc"
) result(file_object)
verbose,&
compact_reals,&
print_signs,&
real_format,&
spaces_per_tab,&
strict_type_checking,&
trailing_spaces_significant,&
case_sensitive_keys,&
no_whitespace,&
unescape_strings,&
comment_char,&
path_mode,&
path_separator,&
compress_vectors,&
allow_duplicate_keys,&
escape_solidus,&
stop_on_error,&
null_to_real_mode,&
non_normal_mode,&
use_quiet_nan, &
strict_integer_type_checking ) result(file_object)

implicit none

Expand All @@ -579,9 +636,27 @@ function initialize_json_file(p,&
!! will be nullified.
#include "json_initialize_arguments.inc"

call file_object%initialize(&
#include "json_initialize_dummy_arguments.inc"
)
call file_object%initialize(verbose,&
compact_reals,&
print_signs,&
real_format,&
spaces_per_tab,&
strict_type_checking,&
trailing_spaces_significant,&
case_sensitive_keys,&
no_whitespace,&
unescape_strings,&
comment_char,&
path_mode,&
path_separator,&
compress_vectors,&
allow_duplicate_keys,&
escape_solidus,&
stop_on_error,&
null_to_real_mode,&
non_normal_mode,&
use_quiet_nan, &
strict_integer_type_checking )

if (present(p)) then
file_object%p => p
Expand Down Expand Up @@ -637,18 +712,56 @@ end function initialize_json_file_v2
! all have a similar interface.

function initialize_json_file_from_string(str,&
#include "json_initialize_dummy_arguments.inc"
) result(file_object)
verbose,&
compact_reals,&
print_signs,&
real_format,&
spaces_per_tab,&
strict_type_checking,&
trailing_spaces_significant,&
case_sensitive_keys,&
no_whitespace,&
unescape_strings,&
comment_char,&
path_mode,&
path_separator,&
compress_vectors,&
allow_duplicate_keys,&
escape_solidus,&
stop_on_error,&
null_to_real_mode,&
non_normal_mode,&
use_quiet_nan, &
strict_integer_type_checking ) result(file_object)

implicit none

type(json_file) :: file_object
character(kind=CK,len=*),intent(in) :: str !! string to load JSON data from
#include "json_initialize_arguments.inc"

call file_object%initialize(&
#include "json_initialize_dummy_arguments.inc"
)
call file_object%initialize(verbose,&
compact_reals,&
print_signs,&
real_format,&
spaces_per_tab,&
strict_type_checking,&
trailing_spaces_significant,&
case_sensitive_keys,&
no_whitespace,&
unescape_strings,&
comment_char,&
path_mode,&
path_separator,&
compress_vectors,&
allow_duplicate_keys,&
escape_solidus,&
stop_on_error,&
null_to_real_mode,&
non_normal_mode,&
use_quiet_nan, &
strict_integer_type_checking )

call file_object%deserialize(str)

end function initialize_json_file_from_string
Expand All @@ -659,8 +772,27 @@ end function initialize_json_file_from_string
! Alternate version of [[initialize_json_file_from_string]], where "str" is kind=CDK.

function wrap_initialize_json_file_from_string(str,&
#include "json_initialize_dummy_arguments.inc"
) result(file_object)
verbose,&
compact_reals,&
print_signs,&
real_format,&
spaces_per_tab,&
strict_type_checking,&
trailing_spaces_significant,&
case_sensitive_keys,&
no_whitespace,&
unescape_strings,&
comment_char,&
path_mode,&
path_separator,&
compress_vectors,&
allow_duplicate_keys,&
escape_solidus,&
stop_on_error,&
null_to_real_mode,&
non_normal_mode,&
use_quiet_nan, &
strict_integer_type_checking ) result(file_object)

implicit none

Expand All @@ -670,8 +802,27 @@ function wrap_initialize_json_file_from_string(str,&

file_object = initialize_json_file_from_string(&
to_unicode(str),&
#include "json_initialize_dummy_arguments.inc"
)
verbose,&
compact_reals,&
print_signs,&
real_format,&
spaces_per_tab,&
strict_type_checking,&
trailing_spaces_significant,&
case_sensitive_keys,&
no_whitespace,&
unescape_strings,&
comment_char,&
path_mode,&
path_separator,&
compress_vectors,&
allow_duplicate_keys,&
escape_solidus,&
stop_on_error,&
null_to_real_mode,&
non_normal_mode,&
use_quiet_nan, &
strict_integer_type_checking )

end function wrap_initialize_json_file_from_string
!*****************************************************************************************
Expand Down
2 changes: 0 additions & 2 deletions src/json_initialize_arguments.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
! The argument list for the various `initialize` subroutines.
!
! See also: json_initialize_dummy_arguments.inc

logical(LK),intent(in),optional :: verbose
!! mainly useful for debugging (default is false)
Expand Down
25 changes: 0 additions & 25 deletions src/json_initialize_dummy_arguments.inc

This file was deleted.

71 changes: 63 additions & 8 deletions src/json_value_module.F90
Original file line number Diff line number Diff line change
Expand Up @@ -978,18 +978,54 @@ end subroutine destroy_json_core
! [[initialize_json_core_in_file]], and [[initialize_json_file]]
! all have a similar interface.

function initialize_json_core(&
#include "json_initialize_dummy_arguments.inc"
) result(json_core_object)
function initialize_json_core(verbose,&
compact_reals,&
print_signs,&
real_format,&
spaces_per_tab,&
strict_type_checking,&
trailing_spaces_significant,&
case_sensitive_keys,&
no_whitespace,&
unescape_strings,&
comment_char,&
path_mode,&
path_separator,&
compress_vectors,&
allow_duplicate_keys,&
escape_solidus,&
stop_on_error,&
null_to_real_mode,&
non_normal_mode,&
use_quiet_nan, &
strict_integer_type_checking ) result(json_core_object)

implicit none

type(json_core) :: json_core_object
#include "json_initialize_arguments.inc"

call json_core_object%initialize(&
#include "json_initialize_dummy_arguments.inc"
)
call json_core_object%initialize(verbose,&
compact_reals,&
print_signs,&
real_format,&
spaces_per_tab,&
strict_type_checking,&
trailing_spaces_significant,&
case_sensitive_keys,&
no_whitespace,&
unescape_strings,&
comment_char,&
path_mode,&
path_separator,&
compress_vectors,&
allow_duplicate_keys,&
escape_solidus,&
stop_on_error,&
null_to_real_mode,&
non_normal_mode,&
use_quiet_nan, &
strict_integer_type_checking )

end function initialize_json_core
!*****************************************************************************************
Expand All @@ -1014,8 +1050,27 @@ end function initialize_json_core
! all have a similar interface.

subroutine json_initialize(me,&
#include "json_initialize_dummy_arguments.inc"
)
verbose,&
compact_reals,&
print_signs,&
real_format,&
spaces_per_tab,&
strict_type_checking,&
trailing_spaces_significant,&
case_sensitive_keys,&
no_whitespace,&
unescape_strings,&
comment_char,&
path_mode,&
path_separator,&
compress_vectors,&
allow_duplicate_keys,&
escape_solidus,&
stop_on_error,&
null_to_real_mode,&
non_normal_mode,&
use_quiet_nan, &
strict_integer_type_checking )

implicit none

Expand Down

0 comments on commit a2206b4

Please sign in to comment.