@@ -273,7 +273,8 @@ subroutine initialize_json_core_in_file(me,verbose,compact_reals,&
273273 trailing_spaces_significant ,&
274274 case_sensitive_keys ,&
275275 no_whitespace ,&
276- unescape_strings )
276+ unescape_strings ,&
277+ comment_char )
277278
278279 implicit none
279280
@@ -298,14 +299,19 @@ subroutine initialize_json_core_in_file(me,verbose,compact_reals,&
298299 ! ! string is returned from [[json_get_string]]
299300 ! ! and similar routines. If true [default],
300301 ! ! then the string is returned unescaped.
302+ character (kind= CK,len= 1 ),intent (in ),optional :: comment_char ! ! If present, this character is used
303+ ! ! to denote comments in the JSON file,
304+ ! ! which will be ignored if present.
305+ ! ! Example: `!` or `#`.
301306
302307 call me% core% initialize(verbose,compact_reals,&
303308 print_signs,real_format,spaces_per_tab,&
304309 strict_type_checking,&
305310 trailing_spaces_significant,&
306311 case_sensitive_keys,&
307312 no_whitespace,&
308- unescape_strings)
313+ unescape_strings,&
314+ comment_char)
309315
310316 end subroutine initialize_json_core_in_file
311317! *****************************************************************************************
@@ -365,7 +371,8 @@ function initialize_json_file(p,verbose,compact_reals,&
365371 trailing_spaces_significant ,&
366372 case_sensitive_keys ,&
367373 no_whitespace ,&
368- unescape_strings ) result(file_object)
374+ unescape_strings ,&
375+ comment_char ) result(file_object)
369376
370377 implicit none
371378
@@ -392,14 +399,19 @@ function initialize_json_file(p,verbose,compact_reals,&
392399 ! ! string is returned from [[json_get_string]]
393400 ! ! and similar routines. If true [default],
394401 ! ! then the string is returned unescaped.
402+ character (kind= CK,len= 1 ),intent (in ),optional :: comment_char ! ! If present, this character is used
403+ ! ! to denote comments in the JSON file,
404+ ! ! which will be ignored if present.
405+ ! ! Example: `!` or `#`.
395406
396407 call file_object% initialize(verbose,compact_reals,&
397408 print_signs,real_format,spaces_per_tab,&
398409 strict_type_checking,&
399410 trailing_spaces_significant,&
400411 case_sensitive_keys,&
401412 no_whitespace,&
402- unescape_strings)
413+ unescape_strings,&
414+ comment_char)
403415
404416 if (present (p)) file_object% p = > p
405417
0 commit comments