@@ -175,8 +175,8 @@ module json_value_module
175
175
integer (IK) :: char_count = 0 ! ! character position in the current line
176
176
integer (IK) :: line_count = 1 ! ! lines read counter
177
177
integer (IK) :: pushed_index = 0 ! ! used when parsing lines in file
178
- character (kind= CK,len= pushed_char_size) :: pushed_char = ' ' ! ! used when parsing
179
- ! ! lines in file
178
+ character (kind= CK,len= pushed_char_size) :: pushed_char = CK_ ' ' ! ! used when parsing
179
+ ! ! lines in file
180
180
181
181
integer (IK) :: ipos = 1 ! ! for allocatable strings: next character to read
182
182
@@ -720,7 +720,7 @@ subroutine json_initialize(json,verbose,compact_reals,&
720
720
721
721
! Just in case, clear these global variables also:
722
722
json% pushed_index = 0
723
- json% pushed_char = ' '
723
+ json% pushed_char = CK_ ' '
724
724
json% char_count = 0
725
725
json% line_count = 1
726
726
json% ipos = 1
@@ -852,7 +852,7 @@ function name_equal(json,p,name) result(is_equal)
852
852
end if
853
853
854
854
else
855
- is_equal = name == ' ' ! check a blank name
855
+ is_equal = name == CK_ ' ' ! check a blank name
856
856
end if
857
857
858
858
end function name_equal
@@ -1010,7 +1010,7 @@ subroutine json_info(json,p,var_type,n_children,name)
1010
1010
if (allocated (p% name)) then
1011
1011
name = p% name
1012
1012
else
1013
- name = ' '
1013
+ name = CK_ ' '
1014
1014
end if
1015
1015
end if
1016
1016
@@ -1058,7 +1058,7 @@ subroutine json_info_by_path(json,p,path,found,var_type,n_children,name)
1058
1058
if (.not. ok) then
1059
1059
if (present (var_type)) var_type = json_unknown
1060
1060
if (present (n_children)) n_children = 0
1061
- if (present (name)) name = ' '
1061
+ if (present (name)) name = CK_ ' '
1062
1062
else
1063
1063
! get info:
1064
1064
@@ -1069,7 +1069,7 @@ subroutine json_info_by_path(json,p,path,found,var_type,n_children,name)
1069
1069
p_name = p_var% name
1070
1070
name = p_name
1071
1071
else
1072
- name = ' '
1072
+ name = CK_ ' '
1073
1073
end if
1074
1074
end if
1075
1075
#else
@@ -1166,7 +1166,7 @@ subroutine json_matrix_info(json,p,is_matrix,var_type,n_sets,set_size,name)
1166
1166
p_name = p% name
1167
1167
name = p_name
1168
1168
else
1169
- name = ' '
1169
+ name = CK_ ' '
1170
1170
end if
1171
1171
end if
1172
1172
#else
@@ -1286,7 +1286,7 @@ subroutine json_matrix_info_by_path(json,p,path,is_matrix,found,&
1286
1286
if (present (var_type)) var_type = json_unknown
1287
1287
if (present (n_sets)) n_sets = 0
1288
1288
if (present (set_size)) set_size = 0
1289
- if (present (name)) name = ' '
1289
+ if (present (name)) name = CK_ ' '
1290
1290
else
1291
1291
1292
1292
! get info about the variable:
@@ -1297,7 +1297,7 @@ subroutine json_matrix_info_by_path(json,p,path,is_matrix,found,&
1297
1297
p_name = p_var% name
1298
1298
name = p_name
1299
1299
else
1300
- name = ' '
1300
+ name = CK_ ' '
1301
1301
end if
1302
1302
end if
1303
1303
#else
@@ -1392,7 +1392,7 @@ pure subroutine json_clear_exceptions(json)
1392
1392
1393
1393
! clear the flag and message:
1394
1394
json% exception_thrown = .false.
1395
- json% err_message = ' '
1395
+ json% err_message = CK_ ' '
1396
1396
1397
1397
end subroutine json_clear_exceptions
1398
1398
! *****************************************************************************************
@@ -1495,7 +1495,7 @@ subroutine json_check_for_errors(json,status_ok,error_msg)
1495
1495
error_msg = ' Unknown error.'
1496
1496
end if
1497
1497
else
1498
- error_msg = ' '
1498
+ error_msg = CK_ ' '
1499
1499
end if
1500
1500
1501
1501
end subroutine json_check_for_errors
@@ -2733,7 +2733,7 @@ subroutine json_value_add_double_vec(json, p, name, val)
2733
2733
2734
2734
! populate the array:
2735
2735
do i= 1 ,size (val)
2736
- call json% add(var, ' ' , val(i))
2736
+ call json% add(var, CK_ ' ' , val(i))
2737
2737
end do
2738
2738
2739
2739
! add it:
@@ -2876,7 +2876,7 @@ subroutine json_value_add_integer_vec(json, p, name, val)
2876
2876
2877
2877
! populate the array:
2878
2878
do i= 1 ,size (val)
2879
- call json% add(var, ' ' , val(i))
2879
+ call json% add(var, CK_ ' ' , val(i))
2880
2880
end do
2881
2881
2882
2882
! add it:
@@ -2976,7 +2976,7 @@ subroutine json_value_add_logical_vec(json, p, name, val)
2976
2976
2977
2977
! populate the array:
2978
2978
do i= 1 ,size (val)
2979
- call json% add(var, ' ' , val(i))
2979
+ call json% add(var, CK_ ' ' , val(i))
2980
2980
end do
2981
2981
2982
2982
! add it:
@@ -3139,7 +3139,7 @@ subroutine json_value_add_string_vec(json, p, name, val, trim_str, adjustl_str)
3139
3139
if (trim_string) str = trim (str)
3140
3140
3141
3141
! write it:
3142
- call json% add(var, ' ' , str)
3142
+ call json% add(var, CK_ ' ' , str)
3143
3143
3144
3144
! cleanup
3145
3145
deallocate (str)
@@ -3506,7 +3506,7 @@ subroutine json_value_to_string(json,p,str)
3506
3506
type (json_value),pointer ,intent (in ) :: p
3507
3507
character (kind= CK,len= :),intent (out ),allocatable :: str ! ! prints structure to this string
3508
3508
3509
- str = ' '
3509
+ str = CK_ ' '
3510
3510
call json% json_value_print(p, iunit= unit2str, str= str, indent= 1 , colon= .true. )
3511
3511
3512
3512
end subroutine json_value_to_string
@@ -3634,7 +3634,7 @@ recursive subroutine json_value_print(json,p,iunit,str,indent,&
3634
3634
3635
3635
! if the colon was the last thing written
3636
3636
if (present (colon)) then
3637
- s = ' '
3637
+ s = CK_ ' '
3638
3638
else
3639
3639
s = repeat (space, spaces)
3640
3640
end if
@@ -4154,7 +4154,7 @@ subroutine json_get_by_path_rfc6901(json, me, path, p, found)
4154
4154
4155
4155
if (islash_curr== ilen) then
4156
4156
! the last token is an empty string
4157
- token = ' '
4157
+ token = CK_ ' '
4158
4158
islash_next = 0 ! will signal to stop
4159
4159
else
4160
4160
@@ -4173,7 +4173,7 @@ subroutine json_get_by_path_rfc6901(json, me, path, p, found)
4173
4173
token = path(islash_curr+1 :islash_next-1 )
4174
4174
else
4175
4175
! empty token:
4176
- token = ' '
4176
+ token = CK_ ' '
4177
4177
end if
4178
4178
end if
4179
4179
@@ -4323,7 +4323,7 @@ subroutine json_get_path(json, p, path, found, use_alt_array_tokens, path_sep)
4323
4323
logical (LK) :: parent_is_root ! ! if the parent is the root
4324
4324
4325
4325
! initialize:
4326
- path = ' '
4326
+ path = CK_ ' '
4327
4327
4328
4328
! optional input:
4329
4329
if (present (use_alt_array_tokens)) then
@@ -4425,7 +4425,7 @@ subroutine json_get_path(json, p, path, found, use_alt_array_tokens, path_sep)
4425
4425
4426
4426
! for errors, return blank string:
4427
4427
if (json% exception_thrown) then
4428
- path = ' '
4428
+ path = CK_ ' '
4429
4429
else
4430
4430
if (json% use_rfc6901_paths) then
4431
4431
! add the root slash:
@@ -4455,14 +4455,14 @@ subroutine add_to_path(str,dot)
4455
4455
4456
4456
if (json% use_rfc6901_paths) then
4457
4457
! in this case, the options are ignored
4458
- if (path==' ' ) then
4458
+ if (path== CK_ ' ' ) then
4459
4459
path = str
4460
4460
else
4461
4461
path = str// slash// path
4462
4462
end if
4463
4463
else
4464
4464
! default path format
4465
- if (path==' ' ) then
4465
+ if (path== CK_ ' ' ) then
4466
4466
path = str
4467
4467
else
4468
4468
if (present (dot)) then
@@ -5271,7 +5271,7 @@ subroutine json_get_string(json, me, value)
5271
5271
5272
5272
character (kind= CK,len= :),allocatable :: error_message ! ! for [[unescape_string]]
5273
5273
5274
- value = ' '
5274
+ value = CK_ ' '
5275
5275
if (.not. json% exception_thrown) then
5276
5276
5277
5277
if (me% var_type == json_string) then
@@ -5282,7 +5282,7 @@ subroutine json_get_string(json, me, value)
5282
5282
if (allocated (error_message)) then
5283
5283
call json% throw_exception(error_message)
5284
5284
deallocate (error_message)
5285
- value = ' '
5285
+ value = CK_ ' '
5286
5286
end if
5287
5287
else
5288
5288
value = me% str_value
@@ -5373,7 +5373,7 @@ subroutine json_get_string_with_path(json, me, path, value, found)
5373
5373
5374
5374
type (json_value),pointer :: p
5375
5375
5376
- value = ' '
5376
+ value = CK_ ' '
5377
5377
if ( json% exception_thrown ) then
5378
5378
if ( present (found) ) found = .false.
5379
5379
return
@@ -5476,7 +5476,7 @@ subroutine get_chars_from_array(json, element, i, count)
5476
5476
vec(i) = cval
5477
5477
deallocate (cval)
5478
5478
else
5479
- vec(i) = ' '
5479
+ vec(i) = CK_ ' '
5480
5480
end if
5481
5481
5482
5482
end subroutine get_chars_from_array
@@ -5532,7 +5532,7 @@ subroutine get_chars_from_array(json, element, i, count)
5532
5532
vec(i) = cval
5533
5533
deallocate (cval)
5534
5534
else
5535
- vec(i) = ' '
5535
+ vec(i) = CK_ ' '
5536
5536
end if
5537
5537
5538
5538
end subroutine get_chars_from_array
@@ -5876,7 +5876,7 @@ subroutine json_parse_string(json, p, str)
5876
5876
5877
5877
! Note: the name of the root json_value doesn't really matter,
5878
5878
! but we'll allocate something here just in case.
5879
- p% name = ' '
5879
+ p% name = CK_ ' '
5880
5880
5881
5881
! parse as a value
5882
5882
call json% parse_value(unit= iunit, str= str, value= p)
@@ -5962,7 +5962,7 @@ subroutine annotate_invalid_json(json,iunit,str)
5962
5962
5963
5963
else
5964
5964
! in this case, it was an empty line or file
5965
- line = ' '
5965
+ line = CK_ ' '
5966
5966
end if
5967
5967
5968
5968
! create the error message:
@@ -5998,7 +5998,7 @@ subroutine get_current_line_from_file_sequential(json,iunit,line)
5998
5998
integer (IK) :: isize ! ! number of characters read in read statement
5999
5999
6000
6000
! initialize:
6001
- line = ' '
6001
+ line = CK_ ' '
6002
6002
6003
6003
! rewind to beginning of the current record:
6004
6004
backspace (iunit, iostat= istat)
@@ -6623,7 +6623,7 @@ subroutine to_string(p,val,name)
6623
6623
if (present (val)) then
6624
6624
p% str_value = val
6625
6625
else
6626
- p% str_value = ' ' ! default value
6626
+ p% str_value = CK_ ' ' ! default value
6627
6627
end if
6628
6628
6629
6629
! name:
@@ -6928,7 +6928,7 @@ subroutine parse_string(json, unit, str, string)
6928
6928
if (i== 4 ) then
6929
6929
if (valid_json_hex(hex)) then
6930
6930
i = 0
6931
- hex = ' '
6931
+ hex = CK_ ' '
6932
6932
is_hex = .false.
6933
6933
else
6934
6934
call json% throw_exception(' Error in parse_string:' // &
@@ -6957,7 +6957,7 @@ subroutine parse_string(json, unit, str, string)
6957
6957
! trim the string if necessary:
6958
6958
if (ip< len (string)+ 1 ) then
6959
6959
if (ip== 1 ) then
6960
- string = ' '
6960
+ string = CK_ ' '
6961
6961
else
6962
6962
string = string (1 :ip-1 )
6963
6963
end if
0 commit comments