Skip to content

Commit b1af52d

Browse files
Merge pull request #259 from jacobwilliams/disable_comments
Disable comments using blank comment_char
2 parents b33038a + 4d01459 commit b1af52d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/json_initialize_arguments.inc

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
character(kind=CK,len=1),intent(in),optional :: comment_char !! If present, this character is used
2222
!! to denote comments in the JSON file,
2323
!! which will be ignored if present.
24-
!! Example: `!` or `#`.
24+
!! Example: `!` or `#`. Setting this
25+
!! to a blank string disables the
26+
!! ignoring of comments. (Default is `!`).
2527
integer(IK),intent(in),optional :: path_mode !! How the path strings are interpreted in the
2628
!! `get_by_path` routines:
2729
!!

src/json_value_module.F90

+2-1
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,9 @@ subroutine json_initialize(json,verbose,compact_reals,&
769769
end if
770770

771771
! if we are allowing comments in the file:
772+
! [an empty string disables comments]
772773
if (present(comment_char)) then
773-
json%allow_comments = .true.
774+
json%allow_comments = comment_char/=CK_''
774775
json%comment_char = comment_char
775776
end if
776777

0 commit comments

Comments
 (0)