-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into feat-6103
- Loading branch information
Showing
687 changed files
with
31,624 additions
and
13,055 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
true: package(ppx_deriving), package(dtoa), package(wtf8) | ||
true: package(core_kernel), package(ppx_deriving), package(dtoa), package(wtf8) | ||
<**/*.ml*>: ocaml, warn_A, warn(-4-6-29-35-44-48-50), warn_error_A, safe_string | ||
<hack/fsnotify_win/fsnotify.ml>: unsafe_string | ||
<hack/heap/*.ml*>: warn(-27-34) | ||
<hack/third-party/core/result.ml>: warn(-41) | ||
<hack/utils/*.ml*>: warn(-3-27) | ||
<src/flowlib/flowlib.ml>: ppx(scripts/ppx_gen_flowlibs.native lib/ prelude/) | ||
<src/parser/*.ml*>: warn(-39) | ||
<src/common/ty/*.ml*>: package(visitors.ppx) | ||
<**/node_modules/**>: -traverse | ||
<_obuild>: -traverse | ||
<packages>: -traverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
module List = struct | ||
include Core_kernel.List | ||
|
||
let rec fold_left_env env l ~init ~f = match l with | ||
| [] -> env, init | ||
| x :: xs -> | ||
let env, init = f env init x in | ||
fold_left_env env xs ~init ~f | ||
|
||
let rev_map_env env xs ~f = | ||
let f2 env init x = | ||
let env, x = f env x in | ||
env, x :: init | ||
in | ||
fold_left_env env xs ~init:[] ~f:f2 | ||
|
||
let map_env env xs ~f = | ||
let rec aux env xs counter = | ||
match xs with | ||
| [] -> env, [] | ||
| [y1] -> | ||
let env, z1 = f env y1 in | ||
env, [z1] | ||
| [y1; y2] -> | ||
let env, z1 = f env y1 in | ||
let env, z2 = f env y2 in | ||
env, [z1; z2] | ||
| [y1; y2; y3] -> | ||
let env, z1 = f env y1 in | ||
let env, z2 = f env y2 in | ||
let env, z3 = f env y3 in | ||
env, [z1; z2; z3] | ||
| [y1; y2; y3; y4] -> | ||
let env, z1 = f env y1 in | ||
let env, z2 = f env y2 in | ||
let env, z3 = f env y3 in | ||
let env, z4 = f env y4 in | ||
env, [z1; z2; z3; z4] | ||
| [y1; y2; y3; y4; y5] -> | ||
let env, z1 = f env y1 in | ||
let env, z2 = f env y2 in | ||
let env, z3 = f env y3 in | ||
let env, z4 = f env y4 in | ||
let env, z5 = f env y5 in | ||
env, [z1; z2; z3; z4; z5] | ||
| y1::y2::y3::y4::y5::ys -> | ||
let env, z1 = f env y1 in | ||
let env, z2 = f env y2 in | ||
let env, z3 = f env y3 in | ||
let env, z4 = f env y4 in | ||
let env, z5 = f env y5 in | ||
let env, zs = | ||
if counter > 1000 | ||
then | ||
let env, zs = rev_map_env env ys ~f in | ||
env, rev zs | ||
else | ||
aux env ys (counter + 1) | ||
in | ||
env, z1::z2::z3::z4::z5::zs | ||
in | ||
aux env xs 0 | ||
|
||
let rec map2_env env l1 l2 ~f = match l1, l2 with | ||
| [], [] -> env, [] | ||
| [], _ | _, [] -> raise @@ Invalid_argument "map2_env" | ||
| x1 :: rl1, x2 :: rl2 -> | ||
let env, x = f env x1 x2 in | ||
let env, rl = map2_env env rl1 rl2 ~f in | ||
env, x :: rl | ||
|
||
let filter_map_env env xs ~f = | ||
let env, l = rev_map_env env xs ~f in | ||
env, rev_filter_map l ~f:(fun x -> x) | ||
|
||
let rec replicate ~num x = | ||
match num with | ||
| 0 -> [] | ||
| n when n < 0 -> | ||
raise @@ Invalid_argument ( | ||
Printf.sprintf "List.replicate was called with %d argument" n) | ||
| _ -> x :: replicate ~num:(num - 1) x | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Copyright (c) 2015, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the "hack" directory of this source tree. | ||
* | ||
*/ | ||
|
||
#include "hh_assert.h" | ||
|
||
#define CAML_NAME_SPACE | ||
#include <caml/callback.h> | ||
#include <caml/fail.h> | ||
|
||
void raise_assertion_failure(char * msg) { | ||
caml_raise_with_string(*caml_named_value("c_assertion_failure"), msg); | ||
} |
Oops, something went wrong.