@@ -36,19 +36,19 @@ module fpm_toml
36
36
contains
37
37
38
38
! > Dump to TOML table, unit, file
39
- procedure (to_toml), deferred, private :: dump_to_toml
39
+ procedure (to_toml), deferred :: dump_to_toml
40
40
procedure , non_overridable, private :: dump_to_file
41
41
procedure , non_overridable, private :: dump_to_unit
42
42
generic :: dump = > dump_to_toml, dump_to_file, dump_to_unit
43
43
44
44
! > Load from TOML table, unit, file
45
- procedure (from_toml), deferred, private :: load_from_toml
45
+ procedure (from_toml), deferred :: load_from_toml
46
46
procedure , non_overridable, private :: load_from_file
47
47
procedure , non_overridable, private :: load_from_unit
48
48
generic :: load = > load_from_toml, load_from_file, load_from_unit
49
49
50
50
! > Serializable entities need a way to check that they're equal
51
- procedure (is_equal), deferred, private :: serializable_is_same
51
+ procedure (is_equal), deferred :: serializable_is_same
52
52
generic :: operator (==) = > serializable_is_same
53
53
54
54
! > Test load/write roundtrip
@@ -256,7 +256,7 @@ subroutine load_from_unit(self, unit, error, json)
256
256
! > Optional JSON format
257
257
logical , optional , intent (in ) :: json
258
258
259
- type (toml_error), allocatable :: toml_error
259
+ type (toml_error), allocatable :: local_error
260
260
type (toml_table), allocatable :: table
261
261
type (toml_table), pointer :: jtable
262
262
class(toml_value), allocatable :: object
@@ -267,10 +267,10 @@ subroutine load_from_unit(self, unit, error, json)
267
267
if (is_json) then
268
268
269
269
! > init JSON interpreter
270
- call json_load(object, unit, error= toml_error )
271
- if (allocated (toml_error )) then
270
+ call json_load(object, unit, error= local_error )
271
+ if (allocated (local_error )) then
272
272
allocate (error)
273
- call move_alloc(toml_error % message, error% message)
273
+ call move_alloc(local_error % message, error% message)
274
274
return
275
275
end if
276
276
@@ -286,11 +286,11 @@ subroutine load_from_unit(self, unit, error, json)
286
286
else
287
287
288
288
! > use default TOML parser
289
- call toml_load(table, unit, error= toml_error )
289
+ call toml_load(table, unit, error= local_error )
290
290
291
- if (allocated (toml_error )) then
291
+ if (allocated (local_error )) then
292
292
allocate (error)
293
- call move_alloc(toml_error % message, error% message)
293
+ call move_alloc(local_error % message, error% message)
294
294
return
295
295
end if
296
296
@@ -454,7 +454,7 @@ subroutine set_character(table, key, var, error, whereAt)
454
454
character (len=* ), intent (in ) :: key
455
455
456
456
! > The character variable
457
- character (len= : ), allocatable , intent (in ) :: var
457
+ character (len=* ), optional , intent (in ) :: var
458
458
459
459
! > Error handling
460
460
type (error_t), allocatable , intent (out ) :: error
@@ -471,7 +471,7 @@ subroutine set_character(table, key, var, error, whereAt)
471
471
return
472
472
end if
473
473
474
- if (allocated (var)) then
474
+ if (present (var)) then
475
475
call set_value(table, key, var, ierr)
476
476
if (ierr/= toml_stat% success) then
477
477
call fatal_error(error,' cannot set character key <' // key// ' > in TOML table' )
0 commit comments