@@ -273,7 +273,8 @@ subroutine initialize_json_core_in_file(me,verbose,compact_reals,&
273
273
trailing_spaces_significant ,&
274
274
case_sensitive_keys ,&
275
275
no_whitespace ,&
276
- unescape_strings )
276
+ unescape_strings ,&
277
+ comment_char )
277
278
278
279
implicit none
279
280
@@ -298,14 +299,19 @@ subroutine initialize_json_core_in_file(me,verbose,compact_reals,&
298
299
! ! string is returned from [[json_get_string]]
299
300
! ! and similar routines. If true [default],
300
301
! ! 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 `#`.
301
306
302
307
call me% core% initialize(verbose,compact_reals,&
303
308
print_signs,real_format,spaces_per_tab,&
304
309
strict_type_checking,&
305
310
trailing_spaces_significant,&
306
311
case_sensitive_keys,&
307
312
no_whitespace,&
308
- unescape_strings)
313
+ unescape_strings,&
314
+ comment_char)
309
315
310
316
end subroutine initialize_json_core_in_file
311
317
! *****************************************************************************************
@@ -365,7 +371,8 @@ function initialize_json_file(p,verbose,compact_reals,&
365
371
trailing_spaces_significant ,&
366
372
case_sensitive_keys ,&
367
373
no_whitespace ,&
368
- unescape_strings ) result(file_object)
374
+ unescape_strings ,&
375
+ comment_char ) result(file_object)
369
376
370
377
implicit none
371
378
@@ -392,14 +399,19 @@ function initialize_json_file(p,verbose,compact_reals,&
392
399
! ! string is returned from [[json_get_string]]
393
400
! ! and similar routines. If true [default],
394
401
! ! 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 `#`.
395
406
396
407
call file_object% initialize(verbose,compact_reals,&
397
408
print_signs,real_format,spaces_per_tab,&
398
409
strict_type_checking,&
399
410
trailing_spaces_significant,&
400
411
case_sensitive_keys,&
401
412
no_whitespace,&
402
- unescape_strings)
413
+ unescape_strings,&
414
+ comment_char)
403
415
404
416
if (present (p)) file_object% p = > p
405
417
0 commit comments