@@ -38,57 +38,57 @@ module json_parameters
38
38
integer (IK),parameter :: json_string = 7 ! ! String JSON data type
39
39
40
40
! special JSON characters
41
- character (kind= CK,len=* ),parameter :: space = ' '
42
- character (kind= CK,len=* ),parameter :: start_object = ' {'
43
- character (kind= CK,len=* ),parameter :: end_object = ' }'
44
- character (kind= CK,len=* ),parameter :: start_array = ' ['
45
- character (kind= CK,len=* ),parameter :: end_array = ' ]'
46
- character (kind= CK,len=* ),parameter :: delimiter = ' ,'
47
- character (kind= CK,len=* ),parameter :: colon_char = ' :'
48
- character (kind= CK,len=* ),parameter :: start_array_alt = ' (' ! ! for [[json_get_by_path]]
49
- character (kind= CK,len=* ),parameter :: end_array_alt = ' )' ! ! for [[json_get_by_path]]
50
- character (kind= CK,len=* ),parameter :: root = ' $' ! ! for [[json_get_by_path]]
51
- character (kind= CK,len=* ),parameter :: this = ' @' ! ! for [[json_get_by_path]]
52
- character (kind= CK,len=* ),parameter :: child = ' .' ! ! for [[json_get_by_path]]
53
- character (kind= CK,len=* ),parameter :: bspace = achar (8 )
54
- character (kind= CK,len=* ),parameter :: horizontal_tab = achar (9 )
55
- character (kind= CK,len=* ),parameter :: newline = achar (10 )
56
- character (kind= CK,len=* ),parameter :: formfeed = achar (12 )
57
- character (kind= CK,len=* ),parameter :: carriage_return = achar (13 )
58
- character (kind= CK,len=* ),parameter :: quotation_mark = achar (34 )
59
- character (kind= CK,len=* ),parameter :: slash = achar (47 )
60
- character (kind= CK,len=* ),parameter :: backslash = achar (92 )
41
+ character (kind= CK,len=* ),parameter :: space = CK_ ' '
42
+ character (kind= CK,len=* ),parameter :: start_object = CK_ ' {'
43
+ character (kind= CK,len=* ),parameter :: end_object = CK_ ' }'
44
+ character (kind= CK,len=* ),parameter :: start_array = CK_ ' ['
45
+ character (kind= CK,len=* ),parameter :: end_array = CK_ ' ]'
46
+ character (kind= CK,len=* ),parameter :: delimiter = CK_ ' ,'
47
+ character (kind= CK,len=* ),parameter :: colon_char = CK_ ' :'
48
+ character (kind= CK,len=* ),parameter :: start_array_alt = CK_ ' (' ! ! for [[json_get_by_path]]
49
+ character (kind= CK,len=* ),parameter :: end_array_alt = CK_ ' )' ! ! for [[json_get_by_path]]
50
+ character (kind= CK,len=* ),parameter :: root = CK_ ' $' ! ! for [[json_get_by_path]]
51
+ character (kind= CK,len=* ),parameter :: this = CK_ ' @' ! ! for [[json_get_by_path]]
52
+ character (kind= CK,len=* ),parameter :: child = CK_ ' .' ! ! for [[json_get_by_path]]
53
+ character (kind= CK,len=* ),parameter :: bspace = achar (8 , kind = CK )
54
+ character (kind= CK,len=* ),parameter :: horizontal_tab = achar (9 , kind = CK )
55
+ character (kind= CK,len=* ),parameter :: newline = achar (10 , kind = CK )
56
+ character (kind= CK,len=* ),parameter :: formfeed = achar (12 , kind = CK )
57
+ character (kind= CK,len=* ),parameter :: carriage_return = achar (13 , kind = CK )
58
+ character (kind= CK,len=* ),parameter :: quotation_mark = achar (34 , kind = CK )
59
+ character (kind= CK,len=* ),parameter :: slash = achar (47 , kind = CK )
60
+ character (kind= CK,len=* ),parameter :: backslash = achar (92 , kind = CK )
61
61
62
62
character (kind= CDK,len=* ),parameter :: default_real_fmt = ' (ss,E26.16E4)'
63
63
! ! default real number format statement (for writing real values to strings and files).
64
64
! ! Note that this can be overridden by calling [[json_initialize]].
65
65
66
- character (kind= CK,len=* ),parameter :: star = ' *' ! ! for invalid numbers and
67
- ! ! list-directed real output
66
+ character (kind= CK,len=* ),parameter :: star = CK_ ' *' ! ! for invalid numbers and
67
+ ! ! list-directed real output
68
68
69
69
#if defined __GFORTRAN__
70
70
! not parameters due to gfortran bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65141)
71
- character (kind= CK,len= 26 ),protected :: upper = ' ABCDEFGHIJKLMNOPQRSTUVWXYZ' ! ! uppercase characters
72
- character (kind= CK,len= 26 ),protected :: lower = ' abcdefghijklmnopqrstuvwxyz' ! ! lowercase characters
71
+ character (kind= CK,len= 26 ),protected :: upper = CK_ ' ABCDEFGHIJKLMNOPQRSTUVWXYZ' ! ! uppercase characters
72
+ character (kind= CK,len= 26 ),protected :: lower = CK_ ' abcdefghijklmnopqrstuvwxyz' ! ! lowercase characters
73
73
#else
74
- character (kind= CK,len=* ),parameter :: upper = ' ABCDEFGHIJKLMNOPQRSTUVWXYZ' ! ! uppercase characters
75
- character (kind= CK,len=* ),parameter :: lower = ' abcdefghijklmnopqrstuvwxyz' ! ! lowercase characters
74
+ character (kind= CK,len=* ),parameter :: upper = CK_ ' ABCDEFGHIJKLMNOPQRSTUVWXYZ' ! ! uppercase characters
75
+ character (kind= CK,len=* ),parameter :: lower = CK_ ' abcdefghijklmnopqrstuvwxyz' ! ! lowercase characters
76
76
#endif
77
77
78
78
#if defined __GFORTRAN__
79
79
! not parameters due to gfortran bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65141)
80
- character (kind= CK,len= 4 ),protected :: null_str = ' null' ! ! JSON Null variable string
81
- character (kind= CK,len= 4 ),protected :: true_str = ' true' ! ! JSON logical True string
82
- character (kind= CK,len= 5 ),protected :: false_str = ' false' ! ! JSON logical False string
80
+ character (kind= CK,len= 4 ),protected :: null_str = CK_ ' null' ! ! JSON Null variable string
81
+ character (kind= CK,len= 4 ),protected :: true_str = CK_ ' true' ! ! JSON logical True string
82
+ character (kind= CK,len= 5 ),protected :: false_str = CK_ ' false' ! ! JSON logical False string
83
83
#else
84
- character (kind= CK,len=* ),parameter :: null_str = ' null' ! ! JSON Null variable string
85
- character (kind= CK,len=* ),parameter :: true_str = ' true' ! ! JSON logical True string
86
- character (kind= CK,len=* ),parameter :: false_str = ' false' ! ! JSON logical False string
84
+ character (kind= CK,len=* ),parameter :: null_str = CK_ ' null' ! ! JSON Null variable string
85
+ character (kind= CK,len=* ),parameter :: true_str = CK_ ' true' ! ! JSON logical True string
86
+ character (kind= CK,len=* ),parameter :: false_str = CK_ ' false' ! ! JSON logical False string
87
87
#endif
88
88
89
89
integer , private :: i_ ! ! just a counter for `control_chars` array
90
90
character (kind= CK,len=* ),dimension (32 ),parameter :: control_chars = &
91
- [(achar (i_),i_= 1 ,31 ), achar (127 )] ! ! Control characters, possibly in unicode
91
+ [(achar (i_,kind = CK ),i_= 1 ,31 ), achar (127 ,kind = CK )] ! ! Control characters, possibly in unicode
92
92
93
93
! find out the precision of the floating point number system
94
94
! and set safety factors
@@ -108,14 +108,19 @@ module json_parameters
108
108
! ! 6 = sign + leading 0 + decimal + 'E' + exponent sign + 1 extra
109
109
character (kind= CDK,len=* ),parameter :: int_fmt = ' (ss,I0)' ! ! minimum width format for integers
110
110
111
+ integer (IK),parameter :: max_integer_str_len = 256 ! ! maximum string length of an integer.
112
+ ! ! This is totally arbitrary (any way
113
+ ! ! to get the compiler to tell us this?)
114
+
111
115
integer (IK),parameter :: chunk_size = 100_IK ! ! for allocatable strings: allocate chunks of this size
112
116
integer (IK),parameter :: unit2str = - 1_IK ! ! unit number to cause stuff to be
113
117
! ! output to strings rather than files.
114
118
! ! See 9.5.6.12 in the F2003/08 standard
115
119
116
120
integer (IK),parameter :: seq_chunk_size = 256_IK ! ! chunk size for reading sequential files
117
121
118
- integer (IK),parameter :: pushed_char_size = 10_IK ! ! magic number
122
+ integer (IK),parameter :: pushed_char_size = 10_IK ! ! size for `pushed_char`
123
+ ! ! array in [[json_core]]
119
124
120
125
end module json_parameters
121
126
! *****************************************************************************************
0 commit comments