@@ -100,6 +100,22 @@ subroutine new_dependency(self, table, root, error)
100
100
call table% get_key(self% name)
101
101
call get_value(table, " namespace" , self% namespace)
102
102
103
+ call get_value(table, " v" , requested_version)
104
+ if (allocated (requested_version)) then
105
+ if (.not. allocated (self% requested_version)) allocate (self% requested_version)
106
+ call new_version(self% requested_version, requested_version, error)
107
+ if (allocated (error)) return
108
+ end if
109
+
110
+ ! > Get optional preprocessor directives
111
+ call get_value(table, " preprocess" , child, requested= .false. )
112
+ print * , ' has preprocess? ' ,associated (child)
113
+ if (associated (child)) then
114
+ call new_preprocessors(self% preprocess, child, error)
115
+ print * , ' size preprocess ' ,size (self% preprocess),' error? =' ,allocated (error)
116
+ if (allocated (error)) return
117
+ endif
118
+
103
119
call get_value(table, " path" , uri)
104
120
if (allocated (uri)) then
105
121
if (get_os_type() == OS_WINDOWS) uri = windows_path(uri)
@@ -135,21 +151,6 @@ subroutine new_dependency(self, table, root, error)
135
151
return
136
152
end if
137
153
138
- call get_value(table, " v" , requested_version)
139
-
140
- if (allocated (requested_version)) then
141
- if (.not. allocated (self% requested_version)) allocate (self% requested_version)
142
- call new_version(self% requested_version, requested_version, error)
143
- if (allocated (error)) return
144
- end if
145
-
146
- ! > Get optional preprocessor directives
147
- call get_value(table, " preprocess" , child, requested= .false. )
148
- if (associated (child)) then
149
- call new_preprocessors(self% preprocess, child, error)
150
- if (allocated (error)) return
151
- end if
152
-
153
154
end subroutine new_dependency
154
155
155
156
! > Check local schema for allowed entries
@@ -163,6 +164,7 @@ subroutine check(table, error)
163
164
164
165
character (len= :), allocatable :: name
165
166
type (toml_key), allocatable :: list(:)
167
+ type (toml_table), pointer :: child
166
168
167
169
! > List of valid keys for the dependency table.
168
170
character (* ), dimension (* ), parameter :: valid_keys = [character (24 ) :: &
@@ -185,7 +187,6 @@ subroutine check(table, error)
185
187
end if
186
188
187
189
call check_keys(table, valid_keys, error)
188
- print * , ' check keys ' ,allocated (error)
189
190
if (allocated (error)) return
190
191
191
192
if (table% has_key(" path" ) .and. table% has_key(" git" )) then
@@ -218,6 +219,18 @@ subroutine check(table, error)
218
219
return
219
220
end if
220
221
222
+ ! Check preprocess key
223
+ if (table% has_key(' preprocess' )) then
224
+
225
+ call get_value(table, ' preprocess' , child)
226
+
227
+ if (.not. associated (child)) then
228
+ call syntax_error(error, " Dependency '" // name// " ' has invalid 'preprocess' entry" )
229
+ return
230
+ end if
231
+
232
+ end if
233
+
221
234
end subroutine check
222
235
223
236
! > Construct new dependency array from a TOML data structure
@@ -279,6 +292,7 @@ subroutine new_dependencies(deps, table, root, meta, error)
279
292
! Parse as a standard dependency
280
293
is_meta(idep) = .false.
281
294
295
+ print * , ' new dependency ' ,all_deps(idep)% name
282
296
call new_dependency(all_deps(idep), node, root, error)
283
297
if (allocated (error)) return
284
298
0 commit comments