editorial changes
This commit is contained in:
parent
0c70f1a54f
commit
1610a6e12a
|
@ -1,11 +1,10 @@
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief yaml_types
|
!> @author Sharan Roongta, Max-Planck-Institut für Eisenforschung GmbH
|
||||||
|
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
|
||||||
|
!> @brief Data types to create a scalar, a list, and a dictionary/hash
|
||||||
!> @details module describes the various functions to store and get the yaml data.
|
!> @details module describes the various functions to store and get the yaml data.
|
||||||
!! tNode is the fundamental derived data type. It can be of tScalar, &
|
!! A node is the base class for scalar, list and dictionary, list items and dictionary entries point
|
||||||
!! tList or tDict.
|
!! to a node.
|
||||||
!! Every 'value' in a key: value pair is of tNode and is a pointer.
|
|
||||||
!! If 'value' is of tScalar, it can either be a string, real, integer or logical, &
|
|
||||||
!! functions exist to convert this scalar type to its respective primitive data type.
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
module YAML_types
|
module YAML_types
|
||||||
|
@ -702,9 +701,9 @@ function tNode_get_byKey_asStrings(self,k) result(nodeAsStrings)
|
||||||
end function tNode_get_byKey_asStrings
|
end function tNode_get_byKey_asStrings
|
||||||
|
|
||||||
|
|
||||||
!-------------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief Returns the index of a key in a dictionary
|
!> @brief Returns the index of a key in a dictionary
|
||||||
!-------------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
function tNode_get_byKey_asIndex(self,key) result(keyIndex)
|
function tNode_get_byKey_asIndex(self,key) result(keyIndex)
|
||||||
|
|
||||||
class(tNode), intent(in), target :: self
|
class(tNode), intent(in), target :: self
|
||||||
|
@ -717,6 +716,7 @@ function tNode_get_byKey_asIndex(self,key) result(keyIndex)
|
||||||
|
|
||||||
dict => self%asDict()
|
dict => self%asDict()
|
||||||
item => dict%first
|
item => dict%first
|
||||||
|
keyIndex = -1
|
||||||
do i = 1, dict%length
|
do i = 1, dict%length
|
||||||
if(key == item%key) then
|
if(key == item%key) then
|
||||||
keyIndex = i
|
keyIndex = i
|
||||||
|
@ -730,7 +730,7 @@ end function tNode_get_byKey_asIndex
|
||||||
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief Prints scalar as string
|
!> @brief Scalar as string (YAML block style)
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
recursive function tScalar_asFormattedString(self,indent)
|
recursive function tScalar_asFormattedString(self,indent)
|
||||||
|
|
||||||
|
@ -752,7 +752,7 @@ end function tScalar_asFormattedString
|
||||||
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief Prints list as string (YAML block style)
|
!> @brief List as string (YAML block style)
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
recursive function tList_asFormattedString(self,indent) result(str)
|
recursive function tList_asFormattedString(self,indent) result(str)
|
||||||
|
|
||||||
|
@ -781,7 +781,7 @@ end function tList_asFormattedString
|
||||||
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief Prints dictionary as string (YAML block style)
|
!> @brief Dictionary as string (YAML block style)
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
recursive function tDict_asFormattedString(self,indent) result(str)
|
recursive function tDict_asFormattedString(self,indent) result(str)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue