language
stringlengths
0
24
filename
stringlengths
9
214
code
stringlengths
99
9.93M
OCaml
hhvm/hphp/hack/src/typing/tast_check/tany_logger/tany_logger_types.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) (** A masking scheme indicating logging mode. For example, both the log levels 1 (0x1) and 3 (0x11) enable logging to a f...
hhvm/hphp/hack/src/typing/write_symbol_info/dune
(library (name write_symbol_info) (wrapped false) (modules symbol_sym_def symbol_gencode symbol_indexable symbol_file_info symbol_add_fact symbol_build_json symbol_fact_id symbol_xrefs symbol_json_util symbol_sym_hash symbol_index_batch symbol_index_decls symbol_index_xrefs symbol_entrypo...
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_add_fact.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Aast open Hh_prelude open Hh_json module Util = Symbol_json_util module Build_json = Symbol_build_json module Predicate =...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_add_fact.mli
(* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) (* * These functions build up the JSON necessary and then add facts * to the running result. *) open Hh_prelude module F...
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_build_json.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Aast open Ast_defs open Hh_json open Hh_prelude module Util = Symbol_json_util module Fact_id = Symbol_fact_id module XRe...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_build_json.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) (* * JSON builder functions. These all return JSON objects, which * may be used to build up larger objects. The functions wi...
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_entrypoint.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude open Hh_json module File_info = Symbol_file_info module Add_fact = Symbol_add_fact module Fact_acc = Symbol_pr...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_entrypoint.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) (* entry point to the hack indexer *) open Hh_prelude module Indexable = Symbol_indexable module Sym_hash = Symbol_sym_hash ...
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_fact_id.ml
(* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) type t = int let next = let x = ref 1 in fun () -> let r = !x in x := !x + 1; r let to_json_number i = Hh_...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_fact_id.mli
(* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) type t = private int (* return consecutive fact ids, starting from 1 *) val next : unit -> t val to_json_number : t -> Hh_...
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_file_info.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude module Indexable = Symbol_indexable module Sym_def = Symbol_sym_def module Class = Typing_classes_heap.Api ty...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_file_info.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude module Indexable = Symbol_indexable module Sym_def = Symbol_sym_def type symbol = private { occ: Relative_p...
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_gencode.ml
(* * Copyright (c) Meta, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude type t = { mutable is_generated: bool; mutable fully_generated: bool; mutable source: string option; mutab...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_gencode.mli
(* * Copyright (c) Meta, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) type t = private { mutable is_generated: bool; mutable fully_generated: bool; mutable source: string option; mutable comma...
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_indexable.ml
(* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude open Hh_json type t = { path: Relative_path.t; fanout: bool; } let from_file path = { path; fanout = t...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_indexable.mli
(* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) type t = private { path: Relative_path.t; fanout: bool; } val from_file : Relative_path.t -> t (** Compute files to in...
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_index_batch.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) (** Indexing a Hack file consists in three distinct passes 1. Indexing source text (regex matching for extracting gencode in...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_index_batch.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) val build_json : Provider_context.t -> Symbol_file_info.t list -> ownership:bool -> Hh_json.json list
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_index_decls.ml
(* * Copyright (c) Meta, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Aast open Hh_prelude module Add_fact = Symbol_add_fact module Fact_acc = Symbol_predicate.Fact_acc module Fact_id = Symbol_fa...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_index_decls.mli
(* * Copyright (c) Meta, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) (** Generate facts for all declarations in AST, and a XRefs map for the module references *) val process_decls : Provider_co...
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_index_xrefs.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude module Add_fact = Symbol_add_fact module Fact_acc = Symbol_predicate.Fact_acc module Build = Symbol_build_json...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_index_xrefs.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) val process_xrefs_and_calls : Provider_context.t -> Symbol_predicate.Fact_acc.t -> Symbol_file_info.t -> Symbol_predic...
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_json_util.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude let is_enum_or_enum_class = function | Ast_defs.Cenum | Ast_defs.Cenum_class _ -> true | Ast_defs.(...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_json_util.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) val is_enum_or_enum_class : Ast_defs.classish_kind -> bool (* True if source text ends in a newline *) val ends_in_newline : ...
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_predicate.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) module Fact_id = Symbol_fact_id open Hh_prelude open Hh_json (* Predicate types for the JSON facts emitted *) type hack = |...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_predicate.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) (* Predicate types for the JSON facts emitted *) type hack = | ClassConstDeclaration | ClassConstDefinition | ClassDecla...
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_sym_def.ml
(* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude module Util = Symbol_json_util type t = { kind: SymbolDefinition.kind; name: string; full_name: strin...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_sym_def.mli
(* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) (* This is mostly a wrapper around ServerSymbolDefinition, specialized to what the indexer needs. Currently, resolve, ba...
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_sym_hash.ml
(* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude (** Concatenation of hashes, sorted in lexicographic order. *) type t = string let mem t h = let md5_bin...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_sym_hash.mli
(* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude (** Set of Md5.t hashes *) type t val mem : t -> Md5.t -> bool (** Construct a [t] from file [path]. File...
OCaml
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_xrefs.ml
(* * Copyright (c) Meta, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) module Fact_id = Symbol_fact_id module PosMap = WrappedMap.Make (struct let compare = Pos.compare type t = Pos.t end) type ...
OCaml Interface
hhvm/hphp/hack/src/typing/write_symbol_info/symbol_xrefs.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) module Fact_id = Symbol_fact_id module PosMap : WrappedMap_sig.S with type key = Pos.t (** maps a target fact id to the json...
OCaml
hhvm/hphp/hack/src/utils/aast_names_utils.ml
(* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) module A = Aast let stmt_name = function | A.Fallthrough -> "Fallthrough" | A.Expr _ -> "Expr" | A.Break -> "Break" ...
OCaml Interface
hhvm/hphp/hack/src/utils/aast_names_utils.mli
(* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) module A = Aast val stmt_name : ('a, 'b) A.stmt_ -> string val expr_name : ('a, 'b) A.expr_ -> string
OCaml
hhvm/hphp/hack/src/utils/bigList.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude type 'a t = int * 'a list let empty = (0, []) let cons hd (length, tl) = (length + 1, hd :: tl) let create...
OCaml Interface
hhvm/hphp/hack/src/utils/bigList.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) (** A BigList is like a list but with potentially huge contents. It keeps a "length" integer, so that BigList.length can be O(...
OCaml
hhvm/hphp/hack/src/utils/cli_args.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Core include Cli_args_sig.Types let files_to_check_range_to_json (range : files_to_check_range) : Hh_json.json = let r...
OCaml Interface
hhvm/hphp/hack/src/utils/cli_args.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) include Cli_args_sig.S
OCaml
hhvm/hphp/hack/src/utils/cli_args_sig.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) module Types = struct type saved_state_target_info = { changes: Relative_path.t list; [@printer Utils.pp_large_l...
OCaml
hhvm/hphp/hack/src/utils/connection_tracker.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude (** The deal with logging is that we normally don't want it verbose, but if something went wrong then we wish...
OCaml Interface
hhvm/hphp/hack/src/utils/connection_tracker.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) (** Allow to record the timestamps on multiple connection events. *) type t (** The connection events whose timestamps we wan...
OCaml
hhvm/hphp/hack/src/utils/counters.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude exception WrongEnum module Category = struct [@@@warning "-32"] type t = | Decling | Disk_cat ...
OCaml Interface
hhvm/hphp/hack/src/utils/counters.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) module Category : sig (** Care: each of these entries adds up to telemetry in [HackEventLogger.ProfileTypeCheck.get_stats], ...
OCaml
hhvm/hphp/hack/src/utils/cpu_cycles.ml
(* This API deliberately does not expose a way to reset the counter, so * as not to disturb programs that expect to be able to use it themselves. * * There are a bunch of caveats about what happens if your * process is interrupted or if you get scheduled onto a different * processor. * *) external cpu_cycles : un...
OCaml Interface
hhvm/hphp/hack/src/utils/cpu_cycles.mli
(* * Copyright (c) 2019, 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. * *) (* This `.mli` file was generated automatically. It may include extra definitions that should not actually be exp...
OCaml
hhvm/hphp/hack/src/utils/decl_reference.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) type t = | GlobalConstant of string | Function of string | Type of string | Module of string [@@deriving eq, show, ord...
OCaml Interface
hhvm/hphp/hack/src/utils/decl_reference.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) type t = | GlobalConstant of string | Function of string | Type of string (** type, interface, trait, typedef, recordde...
hhvm/hphp/hack/src/utils/dune
; splitted utils:utils (library (name trie) (wrapped false) (modules trie) (preprocess (pps lwt_ppx ppx_deriving.std ppx_deriving.enum)) (libraries utils_core)) (library (name utils_find) (wrapped false) (modules findUtils) (preprocess (pps lwt_ppx ppx_deriving.std ppx_deriving.enum)) (libraries ignore ...
Rust
hhvm/hphp/hack/src/utils/escaper.rs
// Copyright (c) 2019, 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. // // Implementation of string escaping logic. // See http://php.net/manual/en/language.types.string.php use std::borrow::Cow;...
OCaml
hhvm/hphp/hack/src/utils/exit.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) module Option = Base.Option let hook_upon_clean_exit : (Exit_status.finale_data -> unit) list ref = ref [] let add_hook_upon...
OCaml Interface
hhvm/hphp/hack/src/utils/exit.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) val exit : ?msg:string -> ?telemetry:Telemetry.t -> ?stack:string -> Exit_status.t -> 'a val add_hook_upon_clean_exit : (Ex...
Rust
hhvm/hphp/hack/src/utils/files_to_ignore.rs
// Copyright (c) Meta Platforms, Inc. and affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the "hack" directory of this source tree. use std::path::Path; use regex::bytes::RegexSet; // These VCS paths are already omitted from our Watchman Subscription, but we // al...
OCaml
hhvm/hphp/hack/src/utils/file_pos_large.ml
(* * 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. * *) open Hh_prelude (* See documentation in mli file *) type t = { pos_lnum: int; pos_bol: int; pos_offset: int; ...
OCaml Interface
hhvm/hphp/hack/src/utils/file_pos_large.mli
(* * Copyright (c) 2019, 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. * *) (* This `.mli` file was generated automatically. It may include extra definitions that should not actually be exp...
OCaml
hhvm/hphp/hack/src/utils/file_pos_small.ml
(* * 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. * *) open Hh_prelude (** * Three values packed into one 64-bit integer: * * 6 5 4 3 ...
OCaml Interface
hhvm/hphp/hack/src/utils/file_pos_small.mli
(* * Copyright (c) 2019, 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. * *) type t = int [@@deriving eq, hash] val dummy : t val is_dummy : t -> bool val beg_of_line : t -> int val line : ...
OCaml
hhvm/hphp/hack/src/utils/findUtils.ml
(* * 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. * *) open Hh_prelude (*****************************************************************************) (* The file extensi...
OCaml Interface
hhvm/hphp/hack/src/utils/findUtils.mli
(* * 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. * *) (** The file extensions we are interested, each in the form ".ext" *) val extensions : string list val is_dot_file ...
Rust
hhvm/hphp/hack/src/utils/find_utils.rs
// Copyright (c) Facebook, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the "hack" directory of this source tree. use std::path::Path; use files_to_ignore::FilesToIgnore; use relative_path::RelativePath; const EXTENSIONS: [&str; 8] = [ "php", ...
OCaml
hhvm/hphp/hack/src/utils/gc_utils.ml
(* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude type megabytes = int let get_heap_size () = Gc.((quick_stat ()).Stat.heap_words) * 8 / 1024 / 1024
OCaml Interface
hhvm/hphp/hack/src/utils/gc_utils.mli
(* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) type megabytes = int val get_heap_size : unit -> megabytes
Rust
hhvm/hphp/hack/src/utils/hh24_test.rs
// Copyright (c) Facebook, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the "hack" directory of this source tree. use std::collections::BTreeMap; use std::io::Write; use std::path::Path; use std::path::PathBuf; use anyhow::Result; use bumpalo::Bump;...
C
hhvm/hphp/hack/src/utils/libcpu_cycles.c
#define CAML_NAME_SPACE #include <stdint.h> #include <caml/alloc.h> #include <caml/memory.h> #define IGNORE_UNUSED(x) ( (void)(x) ) static inline uint64_t CPU_CYCLES() { #ifdef __x86_64__ uint32_t high, low; uint64_t high1, low1; asm volatile("rdtsc": "=a"((low)), "=d"((high))); high1 = (uint64_t) hi...
OCaml
hhvm/hphp/hack/src/utils/line_break_map.ml
(* * Copyright (c) 2017, 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. * *) open Hh_prelude type t = int array [@@deriving show, eq, sexp_of] let last_offset = ref 0 let curr_index = ref 0 ...
OCaml Interface
hhvm/hphp/hack/src/utils/line_break_map.mli
(* * Copyright (c) 2017, 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. * *) (* A line break map is created for a given string. It contains the offsets (in * said string) of the first characte...
Rust
hhvm/hphp/hack/src/utils/line_break_map.rs
// Copyright (c) 2019, 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. use std::cell::Cell; #[derive(Debug)] pub struct LineBreakMap { lines: Box<[usize]>, last_offset: Cell<usize>, cu...
OCaml
hhvm/hphp/hack/src/utils/lwt_message_queue.ml
(* * Copyright (c) 2019, 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. * *) type 'a t = { mutable messages: 'a ImmQueue.t; mutable is_open: bool; cv: unit Lwt_condition.t; (** Broa...
OCaml Interface
hhvm/hphp/hack/src/utils/lwt_message_queue.mli
(* * Copyright (c) 2019, 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. * *) (** A mutable queue containing messages of type ['a]. *) type 'a t (** Create a new [Lwt_message_queue.t]. *) val c...
OCaml
hhvm/hphp/hack/src/utils/lwt_utils.ml
(* * Copyright (c) 2018, 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. * *) open Hh_prelude exception WrappedException of Exception.t (** Use this instead of [Lwt_main.run] to ensure that th...
OCaml Interface
hhvm/hphp/hack/src/utils/lwt_utils.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) (** Use this instead of [Lwt_main.run] to ensure that the right engine is set, and to improve stack traces. *) val run_main : (...
OCaml
hhvm/hphp/hack/src/utils/memory_stats.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) open Hh_prelude open Base.Option.Monad_infix let lines path = try Some (Str.split (Str.regexp_string "\n") (Path.cat (Path.m...
OCaml Interface
hhvm/hphp/hack/src/utils/memory_stats.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) val get_vm_hwm : unit -> int option val get_vm_rss : unit -> int option (** A collection of telemetry about the host we're o...
OCaml
hhvm/hphp/hack/src/utils/multifile.ml
(* * Copyright (c) 2015-present, 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. * *) open Hh_prelude (** This allows one to fake having multiple files in one file. This is used only in unit ...
OCaml Interface
hhvm/hphp/hack/src/utils/multifile.mli
(* * Copyright (c) 2015-present, 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. * *) (** This allows one to fake having multiple files in one file. This is used only in unit test files. Ind...
Rust
hhvm/hphp/hack/src/utils/multifile.rs
// Copyright (c) Facebook, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the "hack" directory of this source tree. //! Multifiles fake having multiple files in one file. This is intended for use //! only in unit test files. //! //! Example features th...
OCaml
hhvm/hphp/hack/src/utils/mutable_accumulator.ml
(* * Copyright (c) 2018, 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. * *) type 'a t = 'a list ref let create () = ref [] let add t s = t := s :: !t let segments t = List.rev !t
OCaml Interface
hhvm/hphp/hack/src/utils/mutable_accumulator.mli
(* * Copyright (c) 2018, 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. * *) type 'a t val create : unit -> 'a t val add : 'a t -> 'a -> unit val segments : 'a t -> 'a list
Rust
hhvm/hphp/hack/src/utils/ocaml_helper.rs
// Copyright (c) 2019, 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. use std::borrow::Cow; #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum IntKind { Dec, Hex, Oct, Bin, } ...
OCaml
hhvm/hphp/hack/src/utils/ocaml_overrides.ml
(* * 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. * *) (** * We override some things in the Ocaml system so that we can have our own * implementations. This is useful fo...
OCaml Interface
hhvm/hphp/hack/src/utils/ocaml_overrides.mli
(* * Copyright (c) 2019, 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. * *) module Ocaml_unix = Unix module Ocaml_Sys = Sys module Unix : sig (* Import ocaml's Unix module signature *) in...
OCaml
hhvm/hphp/hack/src/utils/php_escaping.ml
(* * 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. * *) (* Implementation of string escaping stuff. Ugggggggh. * See http://php.net/manual/en/language.types.string.php *) ...
OCaml Interface
hhvm/hphp/hack/src/utils/php_escaping.mli
(* * Copyright (c) 2019, 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. * *) val is_lit_printable : char -> bool val escape_char : char -> string val escape : ?f:(char -> string) -> string ->...
OCaml
hhvm/hphp/hack/src/utils/pos.ml
(** Positions embedded with full position info inside its * data structure. See "type 'a pos" * * Note: This module can only be used with the Lexbuf Pos_source * module, as it will not compile with other Pos_source modules. So, * when choosing a different Pos module, you must also choose its * compatible Pos_sour...
OCaml Interface
hhvm/hphp/hack/src/utils/pos.mli
(* * 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. * *) (* Note: While Pos.string prints out positions as closed intervals, pos_start * and pos_end actually form a half-op...
OCaml
hhvm/hphp/hack/src/utils/pos_source.ml
(** Pos_source is the underlying structure that provides position information. * * There will be two kinds of Pos_source * Lexbuf_based - this is used by the original Hack lexer. * Node_based - position data is held by a node. *) module Lexbuf_based_pos_source = struct type t = Lexing.lexbuf end include Lex...
OCaml Interface
hhvm/hphp/hack/src/utils/pos_source.mli
(* * Copyright (c) 2019, 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. * *) (* This `.mli` file was generated automatically. It may include extra definitions that should not actually be exp...
OCaml
hhvm/hphp/hack/src/utils/pos_span_tiny.ml
(* * 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. * *) open Hh_prelude (** A compressed representation of a position span, i.e. a start and an end position. *) (** * Po...
OCaml Interface
hhvm/hphp/hack/src/utils/pos_span_tiny.mli
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) (** A compressed representation of a position span, i.e. a start and an end position. *) type t [@@deriving eq, hash, show, o...
OCaml
hhvm/hphp/hack/src/utils/promise.ml
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the "hack" directory of this source tree. * *) module type S = sig type 'value t (** Creates a promise that returns the given value immediately. *) val return : 'valu...
OCaml
hhvm/hphp/hack/src/utils/regexp_utils.ml
(* * 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. * *) (* Utility functions implemented with regular expressions. * Needs to be duplicated between regular ocaml and JS si...
OCaml Interface
hhvm/hphp/hack/src/utils/regexp_utils.mli
(* * Copyright (c) 2019, 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. * *) (* This `.mli` file was generated automatically. It may include extra definitions that should not actually be exp...
OCaml
hhvm/hphp/hack/src/utils/relative_path.ml
(* * 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. * *) open Hh_prelude open Reordered_argument_collections open Utils type prefix = | Root | Hhi | Dummy | Tmp [@@...
OCaml Interface
hhvm/hphp/hack/src/utils/relative_path.mli
(* * 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. * *) open Reordered_argument_collections type prefix = | Root | Hhi | Dummy | Tmp [@@deriving eq, hash, show, en...
OCaml
hhvm/hphp/hack/src/utils/serverLoadFlag.ml
(* TODO: turn this into a bool option with None indicating * an uninitialized state for greater strictness *) let no_load_ref : bool ref = ref false let set_no_load b = no_load_ref := b let get_no_load () = !no_load_ref
OCaml
hhvm/hphp/hack/src/utils/signed_source.ml
(* * Copyright (c) 2018-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) (* This file is based on fbsource/tools/signedsource.py *) (* This old token was historically used as the signing token. It was replaced...
OCaml Interface
hhvm/hphp/hack/src/utils/signed_source.mli
(* * Copyright (c) 2018-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) (** The signing token, which you must embed in the file you wish to sign. Generally, you should put this in a header comment. *) val ...
Rust
hhvm/hphp/hack/src/utils/si_addendum.rs
// Copyright (c) Meta Platforms, Inc. and affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the "hack" directory of this source tree. use oxidized::search_types::SiAddendum; use oxidized_by_ref::direct_decl_parser::ParsedFileWithHashes; /// From a `ParsedFileWithHash...
OCaml
hhvm/hphp/hack/src/utils/stack_utils.ml
(* * 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. * *) (** Adds some utilities to the Stack module *) module Ocaml_stack = Stack module Stack = struct include Ocaml_st...
OCaml Interface
hhvm/hphp/hack/src/utils/stack_utils.mli
(* * Copyright (c) 2019, 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. * *) (* This `.mli` file was generated automatically. It may include extra definitions that should not actually be exp...
OCaml
hhvm/hphp/hack/src/utils/symbolDefinition.ml
(* * 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. * *) open Hh_prelude type kind = | Function | Class | Method | Property | ClassConst | GlobalConst | Enum ...