-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[infer/python][2/2] update python integration to allow capture of mul…
…tiple files Summary: In this diff, we do the minimum update to `TextualSil` and deal with the fallout so we can run a simple python test in `codetoanalyze/python/pulse` Reviewed By: artempyanykh Differential Revision: D46274102 fbshipit-source-id: 1b034c6d78304a8794dc9310a57b6e41477186c1
- Loading branch information
1 parent
03f7e27
commit e4fb442
Showing
31 changed files
with
299 additions
and
21 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
(* | ||
* 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. | ||
*) | ||
|
||
open! IStd | ||
module F = Format | ||
|
||
(* TODO: add support for | ||
- module names | ||
- nested classes | ||
*) | ||
type t = {classname: string} [@@deriving compare, equal, yojson_of, sexp, hash] | ||
|
||
let make classname = {classname} | ||
|
||
let classname {classname} = classname | ||
|
||
let components {classname} = [classname] | ||
|
||
let wildcard = make "?" | ||
|
||
let pp fmt {classname} = F.fprintf fmt "%s" classname | ||
|
||
let to_string = Pp.string_of_pp pp | ||
|
||
let static_suffix = "$static" | ||
|
||
let len_static_suffix = String.length static_suffix | ||
|
||
let static_companion {classname} = {classname= classname ^ static_suffix} | ||
|
||
let is_static {classname} = StringLabels.ends_with ~suffix:static_suffix classname | ||
|
||
let static_companion_origin ({classname} as name) = | ||
let len_classname = String.length classname in | ||
if len_classname > len_static_suffix then | ||
let len = len_classname - len_static_suffix in | ||
{classname= StringLabels.sub ~pos:0 ~len classname} | ||
else name |
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,36 @@ | ||
(* | ||
* 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. | ||
*) | ||
|
||
open! IStd | ||
module F = Format | ||
|
||
type t [@@deriving compare, equal, yojson_of, sexp, hash] | ||
|
||
val make : string -> t | ||
|
||
val classname : t -> string | ||
|
||
val components : t -> string list | ||
|
||
val wildcard : t [@@warning "-unused-value-declaration"] | ||
|
||
val pp : F.formatter -> t -> unit | ||
|
||
val to_string : t -> string | ||
|
||
val static_companion : t -> t | ||
[@@warning "-unused-value-declaration"] | ||
(** return the class of the companion class object of this class eg: Foo -> Foo$static *) | ||
|
||
val static_companion_origin : t -> t | ||
[@@warning "-unused-value-declaration"] | ||
(** return the origin class of a companion class object eg: Foo$static -> Foo. the result is not | ||
specified if is the name is not a valid static class name *) | ||
|
||
val is_static : t -> bool | ||
[@@warning "-unused-value-declaration"] | ||
(** tests if the name is a valid static class name (ie. ends with "$static") *) |
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
Oops, something went wrong.