Skip to content

Commit

Permalink
Merge pull request #71 from Goddard-Fortran-Ecosystem/feature/tmp
Browse files Browse the repository at this point in the history
Forgot interface for file.
  • Loading branch information
tclune authored Mar 3, 2024
2 parents 2774ab5 + 2ad6e71 commit f34ee01
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions src/Parser.F90
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,21 @@ module fy_Parser
procedure :: interpret
end type Parser


interface Parser
module procedure new_Parser_schema
module procedure new_Parser_schema_name
end interface Parser

interface Load
module procedure load_file
module procedure load_stream
end interface Load

character(*), parameter :: MERGE_KEY = '<<'

contains

subroutine load(node, stream, unusable, schema_name, rc)
subroutine load_stream(node, stream, unusable, schema_name, rc)
class(YAML_Node), allocatable, intent(out) :: node
class(AbstractTextStream), intent(in) :: stream
class(KeywordEnforcer), optional, intent(in) :: unusable
Expand All @@ -93,7 +97,24 @@ subroutine load(node, stream, unusable, schema_name, rc)

__RETURN__(YAFYAML_SUCCESS)
__UNUSED_DUMMY__(unusable)
end subroutine load
end subroutine load_stream

subroutine load_file(node, file, unusable, schema_name, rc)
class(YAML_Node), allocatable, intent(out) :: node
character(*), intent(in) :: file
class(KeywordEnforcer), optional, intent(in) :: unusable
character(*), optional, intent(in) :: schema_name
integer, optional, intent(out) :: rc

integer :: status
type(Parser) :: p

call load_stream(node, FileStream(file), schema_name=schema_name, rc=status)
__VERIFY__(status)

__RETURN__(YAFYAML_SUCCESS)
__UNUSED_DUMMY__(unusable)
end subroutine load_file

function new_Parser_schema(schema) result(p)
type(Parser) :: p
Expand Down

0 comments on commit f34ee01

Please sign in to comment.