Skip to content

Commit

Permalink
splitted idls + simple merging
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanaz committed Jan 21, 2018
1 parent 88ca7ea commit 4a784fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion TS.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,15 @@ module InputIdlJson =
type InputIdlJsonType = JsonProvider<"inputfiles/sample.webidl.json">

let inputIdl =
File.ReadAllText(GlobalVars.inputFolder + @"/browser.webidl.json") |> InputIdlJsonType.Parse
let jsons =
DirectoryInfo(GlobalVars.inputFolder + @"/idls").GetFiles()
|> Array.map (fun file -> file.FullName |> File.ReadAllText |> InputIdlJsonType.Parse)

let inline extractJsonArray f =
jsons |> Array.collect f |> Array.map (fun item -> (^a: (member JsonValue: JsonValue) item)) |> JsonValue.Array;

let list = [| ("typedefs", extractJsonArray (fun json -> json.Typedefs)) |]
InputIdlJsonType.Root(JsonValue.Record list)

let allTypedefsMap =
inputIdl.Typedefs |> toNameMap
Expand Down
File renamed without changes.

0 comments on commit 4a784fd

Please sign in to comment.