Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
west-public
West
Commits
f1f9458f
Commit
f1f9458f
authored
Jul 10, 2018
by
Marco Govoni
Browse files
Json bumped to 6.7.0
parent
6cb8925b
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Libraries/Json/json_file_module.f90
View file @
f1f9458f
This diff is collapsed.
Click to expand it.
Libraries/Json/json_initialize_arguments.inc
View file @
f1f9458f
...
...
@@ -40,10 +40,11 @@ character(kind=CK,len=1),intent(in),optional :: comment_char
integer
(
IK
),
intent
(
in
),
optional
::
path_mode
!!
How
the
path
strings
are
interpreted
in
the
!!
`get_by_path`
routines
:
!!
*
1
--
Default
way
(
see
[[
json_get_by_path_default
]])
!!
[
Default
]
!!
*
1
--
Default
mode
(
see
[[
json_get_by_path_default
]])
!!
*
2
--
as
RFC
6901
"JSON Pointer"
paths
!!
(
see
[[
json_get_by_path_rfc6901
]])
!!
*
3
--
JSONPath
"bracket-notation"
!!
see
[[
json_get_by_path_jsonpath_bracket
]])
character
(
kind
=
CK
,
len
=
1
),
intent
(
in
),
optional
::
path_separator
!!
The
`path`
separator
to
use
!!
in
the
"default"
mode
for
...
...
@@ -73,4 +74,7 @@ logical(LK),intent(in),optional :: escape_solidus
!!
Note
that
this
option
does
not
affect
parsing
!!
(
both
escaped
and
unescaped
are
still
valid
in
!!
all
cases
)
.
logical
(
LK
),
intent
(
in
),
optional
::
stop_on_error
!!
If
an
exception
is
raised
,
then
immediately
quit
.
!!
(
Default
is
False
)
.
Libraries/Json/json_kinds.f90
View file @
f1f9458f
...
...
@@ -75,8 +75,7 @@
#elif REAL128
integer
,
parameter
,
public
::
RK
=
real128
!! Default real kind [16 bytes]
#else
!integer,parameter,public :: RK = real64 !! Default real kind if not specified [8 bytes]
integer
,
parameter
,
public
::
RK
=
selected_real_kind
(
14
,
200
)
integer
,
parameter
,
public
::
RK
=
real64
!! Default real kind if not specified [8 bytes]
#endif
#ifdef INT8
...
...
Libraries/Json/json_module.f90
View file @
f1f9458f
...
...
@@ -22,12 +22,12 @@
#pragma pop_macro("USE_UCS4")
#endif
!
!## License
!##
#
License
! * JSON-Fortran is released under a BSD-style license.
! See the [LICENSE](https://github.com/jacobwilliams/json-fortran/blob/master/LICENSE)
! file for details.
!
!## History
!##
#
History
! * Joseph A. Levin : March 2012 : Original [FSON](https://github.com/josephalevin/fson)
! code [retrieved on 12/2/2013].
! * Jacob Williams : 2/8/2014 : Extensive modifications to the original FSON code.
...
...
@@ -39,7 +39,7 @@
! (e.g., allocatable strings, newunit, generic, class, and abstract interface).
! * Development continues at: [Github](http://github.com/jacobwilliams/json-fortran)
!
!## See also
!##
#
See also
! * [json-fortran development site](http://github.com/jacobwilliams/json-fortran)
! * [json-fortran online documentation](http://jacobwilliams.github.io/json-fortran)
! * [JSON website](http://www.json.org/)
...
...
Libraries/Json/json_parameters.f90
View file @
f1f9458f
...
...
@@ -5,7 +5,7 @@
! Other parameters used by JSON-Fortran.
! This is a low-level module not meant to be used by a JSON-Fortran user.
!
!## License
!##
#
License
! * JSON-Fortran is released under a BSD-style license.
! See the [LICENSE](https://github.com/jacobwilliams/json-fortran/blob/master/LICENSE)
! file for details.
...
...
@@ -38,29 +38,29 @@
integer
(
IK
),
parameter
::
json_string
=
7
!! String JSON data type
!special JSON characters
character
(
kind
=
CK
,
len
=*
),
parameter
::
space
=
CK_' '
character
(
kind
=
CK
,
len
=*
),
parameter
::
start_object
=
CK_'{'
character
(
kind
=
CK
,
len
=*
),
parameter
::
end_object
=
CK_'}'
character
(
kind
=
CK
,
len
=*
),
parameter
::
start_array
=
CK_'['
character
(
kind
=
CK
,
len
=*
),
parameter
::
end_array
=
CK_']'
character
(
kind
=
CK
,
len
=*
),
parameter
::
delimiter
=
CK_','
character
(
kind
=
CK
,
len
=*
),
parameter
::
colon_char
=
CK_':'
character
(
kind
=
CK
,
len
=*
),
parameter
::
start_array_alt
=
CK_'('
!! for [[json_get_by_path]]
character
(
kind
=
CK
,
len
=*
),
parameter
::
end_array_alt
=
CK_')'
!! for [[json_get_by_path]]
character
(
kind
=
CK
,
len
=*
),
parameter
::
root
=
CK_'$'
!! for [[json_get_by_path]]
character
(
kind
=
CK
,
len
=*
),
parameter
::
this
=
CK_'@'
!! for [[json_get_by_path]]
character
(
kind
=
CK
,
len
=*
),
parameter
::
dot
=
CK_'.'
!! for [[json_get_by_path]]
character
(
kind
=
CK
,
len
=*
),
parameter
::
space
=
CK_' '
!! space character
character
(
kind
=
CK
,
len
=*
),
parameter
::
start_object
=
CK_'{'
!! start of a JSON object
character
(
kind
=
CK
,
len
=*
),
parameter
::
end_object
=
CK_'}'
!! end of a JSON object
character
(
kind
=
CK
,
len
=*
),
parameter
::
start_array
=
CK_'['
!! start of a JSON array
character
(
kind
=
CK
,
len
=*
),
parameter
::
end_array
=
CK_']'
!! end of a JSON array
character
(
kind
=
CK
,
len
=*
),
parameter
::
delimiter
=
CK_','
!! delimiter for JSON
character
(
kind
=
CK
,
len
=*
),
parameter
::
colon_char
=
CK_':'
!! colon character for JSON
character
(
kind
=
CK
,
len
=*
),
parameter
::
start_array_alt
=
CK_'('
!!
alternate start of JSON array
for [[json_get_by_path
_default
]]
character
(
kind
=
CK
,
len
=*
),
parameter
::
end_array_alt
=
CK_')'
!!
alternate end of JSON array
for [[json_get_by_path
_default
]]
character
(
kind
=
CK
,
len
=*
),
parameter
::
root
=
CK_'$'
!!
root
for [[json_get_by_path
_default
]]
character
(
kind
=
CK
,
len
=*
),
parameter
::
this
=
CK_'@'
!!
'this'
for [[json_get_by_path
_default
]]
character
(
kind
=
CK
,
len
=*
),
parameter
::
dot
=
CK_'.'
!!
path separator
for [[json_get_by_path
_default
]]
character
(
kind
=
CK
,
len
=*
),
parameter
::
tilde
=
CK_'~'
!! RFC 6901 escape character
character
(
kind
=
CK
,
len
=*
),
parameter
::
percent
=
CK_'%'
!! Fortran path separator
character
(
kind
=
CK
,
len
=*
),
parameter
::
single_quote
=
CK_"'"
!! for JSONPath bracket-notation
character
(
kind
=
CK
,
len
=*
),
parameter
::
bspace
=
achar
(
8
,
kind
=
CK
)
character
(
kind
=
CK
,
len
=*
),
parameter
::
horizontal_tab
=
achar
(
9
,
kind
=
CK
)
character
(
kind
=
CK
,
len
=*
),
parameter
::
newline
=
achar
(
10
,
kind
=
CK
)
character
(
kind
=
CK
,
len
=*
),
parameter
::
formfeed
=
achar
(
12
,
kind
=
CK
)
character
(
kind
=
CK
,
len
=*
),
parameter
::
carriage_return
=
achar
(
13
,
kind
=
CK
)
character
(
kind
=
CK
,
len
=*
),
parameter
::
quotation_mark
=
achar
(
34
,
kind
=
CK
)
character
(
kind
=
CK
,
len
=*
),
parameter
::
slash
=
achar
(
47
,
kind
=
CK
)
character
(
kind
=
CK
,
len
=*
),
parameter
::
backslash
=
achar
(
92
,
kind
=
CK
)
character
(
kind
=
CK
,
len
=*
),
parameter
::
bspace
=
achar
(
8
,
kind
=
CK
)
!! JSON special character
character
(
kind
=
CK
,
len
=*
),
parameter
::
horizontal_tab
=
achar
(
9
,
kind
=
CK
)
!! JSON special character
character
(
kind
=
CK
,
len
=*
),
parameter
::
newline
=
achar
(
10
,
kind
=
CK
)
!! JSON special character
character
(
kind
=
CK
,
len
=*
),
parameter
::
formfeed
=
achar
(
12
,
kind
=
CK
)
!! JSON special character
character
(
kind
=
CK
,
len
=*
),
parameter
::
carriage_return
=
achar
(
13
,
kind
=
CK
)
!! JSON special character
character
(
kind
=
CK
,
len
=*
),
parameter
::
quotation_mark
=
achar
(
34
,
kind
=
CK
)
!! JSON special character
character
(
kind
=
CK
,
len
=*
),
parameter
::
slash
=
achar
(
47
,
kind
=
CK
)
!! JSON special character
character
(
kind
=
CK
,
len
=*
),
parameter
::
backslash
=
achar
(
92
,
kind
=
CK
)
!! JSON special character
character
(
kind
=
CDK
,
len
=*
),
parameter
::
default_real_fmt
=
'(ss,E27.17E4)'
!! default real number format statement (for writing real values to strings and files).
...
...
@@ -103,11 +103,11 @@
!Get the number of possible digits in the exponent when using decimal number system
integer
(
IK
),
parameter
::
maxexp
=
maxexponent
(
1.0_RK
)
integer
(
IK
),
parameter
::
minexp
=
minexponent
(
1.0_RK
)
integer
(
IK
),
parameter
::
real_exponent_digits
=
floor
(
1
+
log10
(
&
integer
(
IK
),
parameter
::
real_exponent_digits
=
floor
(
1
_IK
+
log10
(
&
real
(
max
(
maxexp
,
abs
(
maxexp
)),&
kind
=
RK
)
)
)
integer
(
IK
),
parameter
::
max_numeric_str_len
=
real_precision
+
real_exponent_digits
+
6
integer
(
IK
),
parameter
::
max_numeric_str_len
=
real_precision
+
real_exponent_digits
+
6
_IK
!! 6 = sign + leading 0 + decimal + 'E' + exponent sign + 1 extra
character
(
kind
=
CDK
,
len
=*
),
parameter
::
int_fmt
=
'(ss,I0)'
!! minimum width format for integers
...
...
Libraries/Json/json_string_utilities.f90
View file @
f1f9458f
...
...
@@ -4,7 +4,7 @@
!
! JSON-Fortran support module for string manipulation.
!
!## License
!##
#
License
! * JSON-Fortran is released under a BSD-style license.
! See the [LICENSE](https://github.com/jacobwilliams/json-fortran/blob/master/LICENSE)
! file for details.
...
...
@@ -116,17 +116,18 @@
implicit
none
character
(
kind
=
CK
,
len
=*
),
intent
(
in
)
::
str
!! the string to conver to an integer
character
(
kind
=
CK
,
len
=*
),
intent
(
in
)
::
str
!! the string to conver
t
to an integer
integer
(
IK
),
intent
(
out
)
::
ival
!! the integer value
logical
(
LK
),
intent
(
out
)
::
status_ok
!! true if there were no errors
character
(
kind
=
CDK
,
len
=
:),
allocatable
::
digits
!character(kind=CDK,len=:),allocatable :: digits
character
(
len
=
:),
allocatable
::
digits
integer
(
IK
)
::
ndigits_digits
,
ndigits
,
ierr
! Compute how many digits we need to read
ndigits
=
2
*
len_trim
(
str
)
ndigits_digits
=
floor
(
log10
(
real
(
ndigits
)))
+1
!allocate(character(kind=C
D
K,len=ndigits_digits) :: digits)
DOES NOT COMPILE ON BGQ
!allocate(character(kind=CK,len=ndigits_digits) :: digits)
allocate
(
character
(
len
=
ndigits_digits
)
::
digits
)
write
(
digits
,
'(I0)'
)
ndigits
!gfortran will have a runtime error with * edit descriptor here
! gfortran bug: '*' edit descriptor for ISO_10646 strings does bad stuff.
...
...
@@ -194,8 +195,8 @@
implicit
none
character
(
kind
=
CK
,
len
=*
),
intent
(
in
)
::
str
real
(
RK
),
intent
(
out
)
::
rval
character
(
kind
=
CK
,
len
=*
),
intent
(
in
)
::
str
!! the string to convert to a real
real
(
RK
),
intent
(
out
)
::
rval
!! `str` converted to a real value
logical
(
LK
),
intent
(
out
)
::
status_ok
!! true if there were no errors
integer
(
IK
)
::
ierr
!! read iostat error code
...
...
@@ -323,7 +324,6 @@
character
(
kind
=
CK
,
len
=*
),
parameter
::
specials
=
specials_no_slash
//
slash
!Do a quick scan for the special characters,
! if any are present, then process the string,
! otherwise, return the string as is.
...
...
@@ -753,16 +753,12 @@
!
! Returns lowercase version of the `CK` string.
!pure elemental function lowercase_string(str) result(s_lower) ! DOES NOT COMPILE ON BGQ
pure
function
lowercase_string
(
str
)
result
(
s_lower
)
implicit
none
!character(kind=CK,len=*),intent(in) :: str !! input string ! DOES NOT COMPILE ON BGQ
!character(kind=CK,len=(len(str))) :: s_lower !! lowercase version of the string !DOES NOT COMPILE ON BGQ
character
(
len
=*
),
intent
(
in
)
::
str
!! input string
character
(
len
=
(
len
(
str
)))
::
s_lower
!! lowercase version of the string
character
(
kind
=
CK
,
len
=*
),
intent
(
in
)
::
str
!! input string
character
(
kind
=
CK
,
len
=
(
len
(
str
)))
::
s_lower
!! lowercase version of the string
integer
::
i
!! counter
integer
::
j
!! index of uppercase character
...
...
Libraries/Json/json_value_module.f90
View file @
f1f9458f
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment