OCaml: Handle some edge cases; refactor parser, main.ml; add config fetcher
This commit is contained in:
parent
6096817932
commit
cb56da1462
16 changed files with 229 additions and 105 deletions
14
ocaml/lib/parsers/config/fetcher.ml
Normal file
14
ocaml/lib/parsers/config/fetcher.ml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
let fetch ?clean (origin: Schema.schema): Schema.schema =
|
||||
let config = Lexer.read origin.meta.defaults.paths.configuration
|
||||
|> Lexer.scan
|
||||
|> List.concat
|
||||
|> Parser.parse
|
||||
in
|
||||
|
||||
if Option.value clean ~default:false then {
|
||||
Schema.origin with input = {
|
||||
origin.input with configuration = {
|
||||
origin.input.configuration with main = config
|
||||
}
|
||||
}
|
||||
} else Parser.apply origin config
|
||||
Loading…
Add table
Add a link
Reference in a new issue