Skip to content

Commit b0649d1

Browse files
Merge pull request #332 from jacobwilliams/devel
Various updates
2 parents 84983c8 + 2d52cbb commit b0649d1

File tree

11 files changed

+480
-172
lines changed

11 files changed

+480
-172
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ install:
6868
- pip install --upgrade pygooglechart
6969
- pip install --upgrade graphviz
7070
- (pip install --upgrade FoBiS.py==2.2.8 && FoBiS.py --version)
71-
- (pip install --upgrade ford==5.0.6 && ford --version)
72-
- (pip install --upgrade markdown==2.6.9)
71+
- (pip install --upgrade ford==6.0.0 && ford --version)
7372
- (pip install --upgrade git+https://github.com/dmeranda/demjson.git && jsonlint --version)
7473

7574
before_script:

json-fortran.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Official Releases
5757

5858
The **current stable release** is **{!.VERSION!}** and can be [downloaded
5959
on GitHub](https://github.com/jacobwilliams/json-fortran/releases/latest)
60-
or installed with [Homebrew](http://brew.sh) on Mac OSX. The
60+
or installed with [Homebrew](http://brew.sh) on MacOS. The
6161
documentation for the current version, **{!.VERSION!}**, can be
6262
found [here](http://jacobwilliams.github.io/json-fortran/{!.VERSION!}/index.html)[^1], and a
6363
list of changes from the previous version are
@@ -74,6 +74,7 @@ Miscellaneous
7474

7575
*[API]: Application Programming Interface: a set of routines, protocols, and tools for building software applications
7676
*[JSON]: JavaScript Object Notation: A human friendly syntax for storing and exchanging data
77+
*[variable type]: json_unknown, json_null, json_object, json_array, json_logical, json_integer, json_double, json_string
7778
*[current stable release]: {!.VERSION!}
7879
*[latest stable release]: {!.VERSION!}
7980

src/json_file_module.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ end subroutine json_file_print_error_message
353353
! Initialize the [[json_core(type)]] for this [[json_file]].
354354
! This is just a wrapper for [[json_initialize]].
355355
!
356-
!@note: This does not destroy the data in the file.
356+
!@note This does not destroy the data in the file.
357357
!
358358
!@note [[initialize_json_core]], [[json_initialize]],
359359
! [[initialize_json_core_in_file]], and [[initialize_json_file]]
@@ -401,9 +401,9 @@ end subroutine initialize_json_core_in_file
401401
!>
402402
! Set the [[json_core(type)]] for this [[json_file]].
403403
!
404-
!@note: This does not destroy the data in the file.
404+
!@note This does not destroy the data in the file.
405405
!
406-
!@note: This one is used if you want to initialize the file with
406+
!@note This one is used if you want to initialize the file with
407407
! an already-existing [[json_core(type)]] (presumably, this was already
408408
! initialized by a call to [[initialize_json_core]] or similar).
409409

src/json_module.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
#pragma pop_macro("USE_UCS4")
2323
#endif
2424
!
25-
!## License
25+
!### License
2626
! * JSON-Fortran is released under a BSD-style license.
2727
! See the [LICENSE](https://github.com/jacobwilliams/json-fortran/blob/master/LICENSE)
2828
! file for details.
2929
!
30-
!## History
30+
!### History
3131
! * Joseph A. Levin : March 2012 : Original [FSON](https://github.com/josephalevin/fson)
3232
! code [retrieved on 12/2/2013].
3333
! * Jacob Williams : 2/8/2014 : Extensive modifications to the original FSON code.
@@ -39,7 +39,7 @@
3939
! (e.g., allocatable strings, newunit, generic, class, and abstract interface).
4040
! * Development continues at: [Github](http://github.com/jacobwilliams/json-fortran)
4141
!
42-
!## See also
42+
!### See also
4343
! * [json-fortran development site](http://github.com/jacobwilliams/json-fortran)
4444
! * [json-fortran online documentation](http://jacobwilliams.github.io/json-fortran)
4545
! * [JSON website](http://www.json.org/)

src/json_parameters.F90

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
! Other parameters used by JSON-Fortran.
66
! This is a low-level module not meant to be used by a JSON-Fortran user.
77
!
8-
!## License
8+
!### License
99
! * JSON-Fortran is released under a BSD-style license.
1010
! See the [LICENSE](https://github.com/jacobwilliams/json-fortran/blob/master/LICENSE)
1111
! file for details.
@@ -38,29 +38,29 @@ module json_parameters
3838
integer(IK),parameter :: json_string = 7 !! String JSON data type
3939

4040
!special JSON characters
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 :: dot = CK_'.' !! for [[json_get_by_path]]
41+
character(kind=CK,len=*),parameter :: space = CK_' ' !! space character
42+
character(kind=CK,len=*),parameter :: start_object = CK_'{' !! start of a JSON object
43+
character(kind=CK,len=*),parameter :: end_object = CK_'}' !! end of a JSON object
44+
character(kind=CK,len=*),parameter :: start_array = CK_'[' !! start of a JSON array
45+
character(kind=CK,len=*),parameter :: end_array = CK_']' !! end of a JSON array
46+
character(kind=CK,len=*),parameter :: delimiter = CK_',' !! delimiter for JSON
47+
character(kind=CK,len=*),parameter :: colon_char = CK_':' !! colon character for JSON
48+
character(kind=CK,len=*),parameter :: start_array_alt = CK_'(' !! alternate start of JSON array for [[json_get_by_path_default]]
49+
character(kind=CK,len=*),parameter :: end_array_alt = CK_')' !! alternate end of JSON array for [[json_get_by_path_default]]
50+
character(kind=CK,len=*),parameter :: root = CK_'$' !! root for [[json_get_by_path_default]]
51+
character(kind=CK,len=*),parameter :: this = CK_'@' !! 'this' for [[json_get_by_path_default]]
52+
character(kind=CK,len=*),parameter :: dot = CK_'.' !! path separator for [[json_get_by_path_default]]
5353
character(kind=CK,len=*),parameter :: tilde = CK_'~' !! RFC 6901 escape character
5454
character(kind=CK,len=*),parameter :: percent = CK_'%' !! Fortran path separator
5555
character(kind=CK,len=*),parameter :: single_quote = CK_"'" !! for JSONPath bracket-notation
56-
character(kind=CK,len=*),parameter :: bspace = achar(8, kind=CK)
57-
character(kind=CK,len=*),parameter :: horizontal_tab = achar(9, kind=CK)
58-
character(kind=CK,len=*),parameter :: newline = achar(10, kind=CK)
59-
character(kind=CK,len=*),parameter :: formfeed = achar(12, kind=CK)
60-
character(kind=CK,len=*),parameter :: carriage_return = achar(13, kind=CK)
61-
character(kind=CK,len=*),parameter :: quotation_mark = achar(34, kind=CK)
62-
character(kind=CK,len=*),parameter :: slash = achar(47, kind=CK)
63-
character(kind=CK,len=*),parameter :: backslash = achar(92, kind=CK)
56+
character(kind=CK,len=*),parameter :: bspace = achar(8, kind=CK) !! JSON special character
57+
character(kind=CK,len=*),parameter :: horizontal_tab = achar(9, kind=CK) !! JSON special character
58+
character(kind=CK,len=*),parameter :: newline = achar(10, kind=CK) !! JSON special character
59+
character(kind=CK,len=*),parameter :: formfeed = achar(12, kind=CK) !! JSON special character
60+
character(kind=CK,len=*),parameter :: carriage_return = achar(13, kind=CK) !! JSON special character
61+
character(kind=CK,len=*),parameter :: quotation_mark = achar(34, kind=CK) !! JSON special character
62+
character(kind=CK,len=*),parameter :: slash = achar(47, kind=CK) !! JSON special character
63+
character(kind=CK,len=*),parameter :: backslash = achar(92, kind=CK) !! JSON special character
6464

6565
character(kind=CDK,len=*),parameter :: default_real_fmt = '(ss,E27.17E4)'
6666
!! default real number format statement (for writing real values to strings and files).
@@ -103,11 +103,11 @@ module json_parameters
103103
!Get the number of possible digits in the exponent when using decimal number system
104104
integer(IK),parameter :: maxexp = maxexponent(1.0_RK)
105105
integer(IK),parameter :: minexp = minexponent(1.0_RK)
106-
integer(IK),parameter :: real_exponent_digits = floor( 1 + log10( &
106+
integer(IK),parameter :: real_exponent_digits = floor( 1_IK + log10( &
107107
real(max(maxexp,abs(maxexp)),&
108108
kind=RK) ) )
109109

110-
integer(IK),parameter :: max_numeric_str_len = real_precision + real_exponent_digits + 6
110+
integer(IK),parameter :: max_numeric_str_len = real_precision + real_exponent_digits + 6_IK
111111
!! 6 = sign + leading 0 + decimal + 'E' + exponent sign + 1 extra
112112
character(kind=CDK,len=*),parameter :: int_fmt = '(ss,I0)' !! minimum width format for integers
113113

src/json_string_utilities.F90

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
!
55
! JSON-Fortran support module for string manipulation.
66
!
7-
!## License
7+
!### License
88
! * JSON-Fortran is released under a BSD-style license.
99
! See the [LICENSE](https://github.com/jacobwilliams/json-fortran/blob/master/LICENSE)
1010
! file for details.
@@ -116,7 +116,7 @@ subroutine string_to_integer(str,ival,status_ok)
116116

117117
implicit none
118118

119-
character(kind=CK,len=*),intent(in) :: str !! the string to conver to an integer
119+
character(kind=CK,len=*),intent(in) :: str !! the string to convert to an integer
120120
integer(IK),intent(out) :: ival !! the integer value
121121
logical(LK),intent(out) :: status_ok !! true if there were no errors
122122

@@ -193,8 +193,8 @@ subroutine string_to_real(str,rval,status_ok)
193193

194194
implicit none
195195

196-
character(kind=CK,len=*),intent(in) :: str
197-
real(RK),intent(out) :: rval
196+
character(kind=CK,len=*),intent(in) :: str !! the string to convert to a real
197+
real(RK),intent(out) :: rval !! `str` converted to a real value
198198
logical(LK),intent(out) :: status_ok !! true if there were no errors
199199

200200
integer(IK) :: ierr !! read iostat error code
@@ -322,7 +322,6 @@ subroutine escape_string(str_in, str_out, escape_solidus)
322322

323323
character(kind=CK,len=*),parameter :: specials = specials_no_slash//slash
324324

325-
326325
!Do a quick scan for the special characters,
327326
! if any are present, then process the string,
328327
! otherwise, return the string as is.

0 commit comments

Comments
 (0)