@@ -123,6 +123,7 @@ subroutine check_keys(table, valid_keys, error)
123
123
type (error_t), allocatable , intent (out ) :: error
124
124
125
125
type (toml_key), allocatable :: keys(:)
126
+ type (toml_table), pointer :: child
126
127
character (:), allocatable :: name, value, valid_keys_string
127
128
integer :: ikey, ivalid
128
129
@@ -143,12 +144,18 @@ subroutine check_keys(table, valid_keys, error)
143
144
end if
144
145
145
146
! Check if value can be mapped or else (wrong type) show error message with the error location.
146
- ! Right now, it can only be mapped to a string, but this can be extended in the future.
147
+ ! Right now, it can only be mapped to a string or to a child node , but this can be extended in the future.
147
148
call get_value(table, keys(ikey)% key, value)
148
149
if (.not. allocated (value)) then
149
- allocate (error)
150
- error% message = " '" // name// " ' has an invalid '" // keys(ikey)% key// " ' entry."
151
- return
150
+
151
+ ! If value is not a string, check if it is a child node
152
+ call get_value(table, keys(ikey)% key, child)
153
+
154
+ if (.not. associated (child)) then
155
+ allocate (error)
156
+ error% message = " '" // name// " ' has an invalid '" // keys(ikey)% key// " ' entry."
157
+ return
158
+ endif
152
159
end if
153
160
end do
154
161
0 commit comments