Summary: Rebar3.capture now calls into ErlangTranslator to obtain Sil. For now, ErlangTranslator does nothing interesting. Reviewed By: skcho Differential Revision: D28261799 fbshipit-source-id: 0603db671master
parent
765d45c2fd
commit
e2cc723074
@ -0,0 +1,26 @@
|
|||||||
|
(*
|
||||||
|
* 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 Ast = ErlangAst
|
||||||
|
|
||||||
|
let to_source_and_cfg module_ =
|
||||||
|
let source =
|
||||||
|
let extract_path = function
|
||||||
|
| {Ast.line= _; simple_form= File {path}} ->
|
||||||
|
Some path
|
||||||
|
| _ ->
|
||||||
|
None
|
||||||
|
in
|
||||||
|
match List.find_map ~f:extract_path module_ with
|
||||||
|
| None ->
|
||||||
|
SourceFile.invalid __FILE__
|
||||||
|
| Some path ->
|
||||||
|
SourceFile.create path
|
||||||
|
in
|
||||||
|
let cfg = (* TODO *) Cfg.create () in
|
||||||
|
(source, cfg)
|
@ -0,0 +1,10 @@
|
|||||||
|
(*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
val to_source_and_cfg : ErlangAst.module_ -> SourceFile.t * Cfg.t
|
Loading…
Reference in new issue