From 5c048c7fd52690ee5596fff059976943a407a2b6 Mon Sep 17 00:00:00 2001
From: JakobDeutloff <50237419+JakobDeutloff@users.noreply.github.com>
Date: Wed, 18 May 2022 22:42:57 +0200
Subject: [PATCH] New version of json fortran

---
 json-fortran-master/.VERSION                  |  2 +-
 json-fortran-master/.github/workflows/CI.yml  |  2 +-
 json-fortran-master/CHANGELOG.md              | 24 +++++++++++++++---
 json-fortran-master/README.md                 | 12 +++++----
 .../release-checklist.md                      |  6 ++---
 json-fortran-master/pages/releases/index.md   |  3 +++
 json-fortran-master/src/json_module.F90       | 25 +++++++++++++++++++
 json-fortran-master/src/json_parameters.F90   |  4 +--
 json-fortran-master/src/json_value_module.F90 |  4 +--
 json-fortran-master/src/tests/jf_test_01.F90  |  2 ++
 10 files changed, 67 insertions(+), 17 deletions(-)

diff --git a/json-fortran-master/.VERSION b/json-fortran-master/.VERSION
index fc8336c..2bf50aa 100644
--- a/json-fortran-master/.VERSION
+++ b/json-fortran-master/.VERSION
@@ -1 +1 @@
-8.2.5
+8.3.0
diff --git a/json-fortran-master/.github/workflows/CI.yml b/json-fortran-master/.github/workflows/CI.yml
index 0e4df36..7483e74 100644
--- a/json-fortran-master/.github/workflows/CI.yml
+++ b/json-fortran-master/.github/workflows/CI.yml
@@ -1,6 +1,6 @@
 name: CI
 
-on: [push]
+on: [push, pull_request]
 
 jobs:
 
diff --git a/json-fortran-master/CHANGELOG.md b/json-fortran-master/CHANGELOG.md
index cffa5bc..858a1c3 100644
--- a/json-fortran-master/CHANGELOG.md
+++ b/json-fortran-master/CHANGELOG.md
@@ -4,6 +4,7 @@
 
 - [Change Log](#change-log)
     - [Unreleased](#unreleased)
+    - [8.3.0 (2022-05-07)](#830-2022-05-07)
     - [8.2.5 (2021-08-17)](#825-2021-08-17)
     - [8.2.4 (2021-08-15)](#824-2021-08-15)
     - [8.2.3 (2021-06-05)](#823-2021-06-05)
@@ -44,7 +45,25 @@
 
 ### [Unreleased](https://github.com/jacobwilliams/json-fortran/tree/HEAD)
 
-[Complete Changeset](https://github.com/jacobwilliams/json-fortran/compare/8.2.5...HEAD)
+[Complete Changeset](https://github.com/jacobwilliams/json-fortran/compare/8.3.0...HEAD)
+
+### [8.3.0](https://github.com/jacobwilliams/json-fortran/tree/8.3.0) (2022-05-07)
+
+[Complete Changeset](https://github.com/jacobwilliams/json-fortran/compare/8.2.5...8.3.0)
+or [Download v8.3.0](https://github.com/jacobwilliams/json-fortran/releases/tag/8.3.0)
+
+**Enhancements:**
+
+- Added procedure to query version of json-fortran [\#505](https://github.com/jacobwilliams/json-fortran/issues/505) [\#512](https://github.com/jacobwilliams/json-fortran/pull/512) [\#516](https://github.com/jacobwilliams/json-fortran/pull/516) ([jacobwilliams](https://github.com/jacobwilliams))
+- Updates to the CI [\#509](https://github.com/jacobwilliams/json-fortran/pull/509) [\#508](https://github.com/jacobwilliams/json-fortran/issues/508) ([jacobwilliams](https://github.com/jacobwilliams))
+- Add information on conda-forge distribution [\#506](https://github.com/jacobwilliams/json-fortran/pull/506) ([awvwgk](https://github.com/awvwgk))  [\#507](https://github.com/jacobwilliams/json-fortran/issues/507)
+- Updated CMake to export include directories with target [\#504](https://github.com/jacobwilliams/json-fortran/pull/504) [\#503](https://github.com/jacobwilliams/json-fortran/issues/503) ([awvwgk](https://github.com/awvwgk))
+
+
+**Bug Fixes:**
+
+- Fixed a minor standards violation [\#510](https://github.com/jacobwilliams/json-fortran/issues/510) [\#511](https://github.com/jacobwilliams/json-fortran/pull/511) ([jacobwilliams](https://github.com/jacobwilliams))
+- Minor changes to work around issues with nvfortran compiler [\#496](https://github.com/jacobwilliams/json-fortran/pull/496) ([vyu16](https://github.com/vyu16))
 
 ### [8.2.5](https://github.com/jacobwilliams/json-fortran/tree/8.2.5) (2021-08-17)
 
@@ -59,8 +78,7 @@ or [Download v8.2.5](https://github.com/jacobwilliams/json-fortran/releases/tag/
 **Bug Fixes:**
 
 - Fixed a potential uninitialized variable issue in `get_current_line_from_file_stream`
-- Fixed a memory leak when parsing an invalid JSON
-- Fixed various memory issues in the unit tests [\#495](https://github.com/jacobwilliams/json-fortran/pull/495) ([jacobwilliams](https://github.com/jacobwilliams))
+- Fixed a memory leak when parsing an invalid JSON. Fixed various memory issues in the unit tests [\#494](https://github.com/jacobwilliams/json-fortran/issues/494) [\#495](https://github.com/jacobwilliams/json-fortran/pull/495) ([jacobwilliams](https://github.com/jacobwilliams))
 
 ### [8.2.4](https://github.com/jacobwilliams/json-fortran/tree/8.2.4) (2021-08-15)
 
diff --git a/json-fortran-master/README.md b/json-fortran-master/README.md
index e7d184c..03f1ecb 100644
--- a/json-fortran-master/README.md
+++ b/json-fortran-master/README.md
@@ -21,8 +21,10 @@ JSON-Fortran: A Modern Fortran JSON API
 Status
 ------
 [![Build Status](https://github.com/jacobwilliams/json-fortran/actions/workflows/CI.yml/badge.svg)](https://github.com/jacobwilliams/json-fortran/actions)
-[![GitHub issues](https://img.shields.io/github/issues/jacobwilliams/json-fortran.png?style=plastic)](https://github.com/jacobwilliams/json-fortran/issues)
+[![GitHub issues](https://img.shields.io/github/issues/jacobwilliams/json-fortran.png)](https://github.com/jacobwilliams/json-fortran/issues)
 [![Codecov](https://codecov.io/gh/jacobwilliams/json-fortran/branch/master/graph/badge.svg)](https://codecov.io/gh/jacobwilliams/json-fortran)
+[![last-commit](https://img.shields.io/github/last-commit/jacobwilliams/json-fortran)](https://github.com/jacobwilliams/json-fortran/commits/master)
+
 
 Take a look at the
 [CHANGELOG](https://github.com/jacobwilliams/json-fortran/blob/master/CHANGELOG.md#unreleased)
@@ -40,9 +42,9 @@ JSON-Fortran is a user-friendly, thread-safe, and object-oriented API for readin
 Download
 --------------------
 
-[![GitHub release](https://img.shields.io/github/release/jacobwilliams/json-fortran.svg?style=plastic)](https://github.com/jacobwilliams/json-fortran/releases)
-[![homebrew version](https://img.shields.io/homebrew/v/json-fortran.svg?style=plastic)](https://formulae.brew.sh/formula/json-fortran)
-[![Conda (channel only)](https://img.shields.io/conda/vn/conda-forge/json-fortran?style=plastic)](https://github.com/conda-forge/json-fortran-feedstock)
+[![GitHub release](https://img.shields.io/github/release/jacobwilliams/json-fortran.svg)](https://github.com/jacobwilliams/json-fortran/releases)
+[![homebrew version](https://img.shields.io/homebrew/v/json-fortran.svg)](https://formulae.brew.sh/formula/json-fortran)
+[![Conda (channel only)](https://img.shields.io/conda/vn/conda-forge/json-fortran)](https://github.com/conda-forge/json-fortran-feedstock)
 
 Download the official versioned releases
 [here](https://github.com/jacobwilliams/json-fortran/releases/latest).
@@ -137,7 +139,7 @@ cmake_minimum_required ( VERSION 2.8.8 FATAL_ERROR )
 enable_language ( Fortran )
 project ( jf_test NONE )
 
-find_package ( jsonfortran-${CMAKE_Fortran_COMPILER_ID} 8.2.5 REQUIRED )
+find_package ( jsonfortran-${CMAKE_Fortran_COMPILER_ID} 8.3.0 REQUIRED )
 
 file ( GLOB JF_TEST_SRCS "src/tests/jf_test_*.F90" )
 foreach ( UNIT_TEST ${JF_TEST_SRCS} )
diff --git a/json-fortran-master/pages/development-resources/release-checklist.md b/json-fortran-master/pages/development-resources/release-checklist.md
index 88b7641..34f9a14 100644
--- a/json-fortran-master/pages/development-resources/release-checklist.md
+++ b/json-fortran-master/pages/development-resources/release-checklist.md
@@ -52,9 +52,9 @@ remain accurate.
 	 1. Add `pages/releases/index.md` to the git index: `git add pages/releases/index.md`
  1. Update the version string in remaining files requiring manual edits:
      1. Edit the `.VERSION` file
-     1. Edit the CMake example on line 124 of `README.md`
-	 1. Add both files to the git index: `git add .VERSION
-     README.md`
+     1. Edit the CMake example on line 142 of `README.md`
+     1. Edit the `json_fortran_version` string in `json_module.F90`
+	 1. Add these files to the git index: `git add .VERSION README.md ./src/json_module.F90`
  1. Commit the changes to the master branch: `git commit`
  1. Create the tag: `git tag <new version>`
      1. Note: for some reason, using GitHub to tag a project means that the tag doesn't show up when you `git describe` the project. Tagging from the command line makes `git describe` work as expected.
diff --git a/json-fortran-master/pages/releases/index.md b/json-fortran-master/pages/releases/index.md
index 228d264..cb01cee 100644
--- a/json-fortran-master/pages/releases/index.md
+++ b/json-fortran-master/pages/releases/index.md
@@ -25,6 +25,9 @@ documentation from the documentation for official releases other than
 using the browser's back button. Feel free to bookmark this page, or
 the [main project page](|url|/index.html) for convenient navigation.
 
+* [8.3.0](https://jacobwilliams.github.io/json-fortran/prev/8.3.0/index.html)
+   ([FORD](https://github.com/Fortran-FOSS-Programmers/ford) generated documentation)
+    - [Download](https://github.com/jacobwilliams/json-fortran/releases/tag/8.3.0)
 * [8.2.5](https://jacobwilliams.github.io/json-fortran/prev/8.2.5/index.html)
    ([FORD](https://github.com/Fortran-FOSS-Programmers/ford) generated documentation)
     - [Download](https://github.com/jacobwilliams/json-fortran/releases/tag/8.2.5)
diff --git a/json-fortran-master/src/json_module.F90 b/json-fortran-master/src/json_module.F90
index c566a16..46284e9 100644
--- a/json-fortran-master/src/json_module.F90
+++ b/json-fortran-master/src/json_module.F90
@@ -73,7 +73,32 @@
 
     implicit none
 
+    character(kind=json_CK,len=*),parameter,private :: version = '8.3.0'
+        !! JSON-Fortran version.
+        !!
+        !!@note This string should match the one in the `.VERSION` file (which is used
+        !!      for the documentation generation.)
+
     public
 
+    contains
+!*****************************************************************************************
+
+!*****************************************************************************************
+!>
+!  Returns the JSON-Fortran version string.
+
+    function json_fortran_version() result(ver)
+
+    implicit none
+
+    character(len=:),allocatable :: ver  !! JSON-Fortran version string
+
+    ver = version
+
+    end function json_fortran_version
+!*****************************************************************************************
+
+!*****************************************************************************************
     end module json_module
 !*****************************************************************************************
diff --git a/json-fortran-master/src/json_parameters.F90 b/json-fortran-master/src/json_parameters.F90
index b70818d..ebd33c8 100644
--- a/json-fortran-master/src/json_parameters.F90
+++ b/json-fortran-master/src/json_parameters.F90
@@ -57,14 +57,14 @@
     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 :: single_quote    = CK_"'"  !! for JSONPath bracket-notation
-    character(kind=CK,len=*),parameter :: slash           = CK_'/'  !! JSON special character
-    character(kind=CK,len=*),parameter :: backslash       = CK_'\'  !! JSON special character
     character(kind=CK,len=*),parameter :: quotation_mark  = CK_'"'  !! JSON special character
     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 :: slash           = achar(47, kind=CK) !! JSON special character
+    character(kind=CK,len=*),parameter :: backslash       = achar(92, kind=CK) !! JSON special character
 
     !> default real number format statement (for writing real values to strings and files).
     !  Note that this can be overridden by calling [[json_initialize]].
diff --git a/json-fortran-master/src/json_value_module.F90 b/json-fortran-master/src/json_value_module.F90
index 2db0217..4bae98a 100644
--- a/json-fortran-master/src/json_value_module.F90
+++ b/json-fortran-master/src/json_value_module.F90
@@ -7390,7 +7390,7 @@
                                                    !! true if the leaf object had to be created
     integer(IK)              :: j                  !! counter of children when creating object
 
-    !     instead of reallocating `token` all the time, just
+    !TODO instead of reallocating `token` all the time, just
     !     allocate a big size and keep track of the length,
     !     then just reallocate only if necessary.
     !     [would probably be inefficient if there was a very large token,
@@ -7985,7 +7985,7 @@
         !! prepend the string to the path
         implicit none
         character(kind=CK,len=*),intent(in) :: str  !! string to prepend to `path`
-        character(kind=CK,len=1),intent(in),optional :: path_sep
+        character(kind=CK,len=*),intent(in),optional :: path_sep
             !! path separator (default is '.').
             !! (ignored if `json%path_mode/=1`)
 
diff --git a/json-fortran-master/src/tests/jf_test_01.F90 b/json-fortran-master/src/tests/jf_test_01.F90
index 13dc0d1..534aed7 100644
--- a/json-fortran-master/src/tests/jf_test_01.F90
+++ b/json-fortran-master/src/tests/jf_test_01.F90
@@ -57,6 +57,8 @@ contains
     write(error_unit,'(A)') '================================='
     write(error_unit,'(A)') ''
 
+    write(error_unit,'(A)') 'JSON-Fortran version: '//json_fortran_version()
+
     ! parse the json file:
     write(error_unit,'(A)') ''
     write(error_unit,'(A)') 'parsing file '//dir//filename1
-- 
GitLab