Skip to content

Commit cebdc5a

Browse files
committed
address review comments
1 parent 918c2fd commit cebdc5a

6 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/frontend/Ast_to_Mir.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ let migrate_checks_to_end_of_block stmts =
679679
let checks, not_checks = List.partition_tf ~f:stmt_contains_check stmts in
680680
not_checks @ checks
681681

682-
let trans_data (p : Ast.typed_program) =
682+
let gather_data (p : Ast.typed_program) =
683683
let data = Ast.get_stmts p.datablock in
684684
List.filter_map data ~f:(function
685685
| { stmt=

src/frontend/Ast_to_Mir.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(** Translate from the AST to the MIR *)
22
open Middle
33

4-
val trans_data :
4+
val gather_data :
55
Ast.typed_program
66
-> (Expr.Typed.t SizedType.t * Expr.Typed.t Transformation.t * string) list
77

src/middle/Expr.ml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,8 @@ module Helpers = struct
213213
match e.Fixed.pattern with
214214
| FunApp (CompilerInternal (FnMakeRowVec | FnMakeArray), l) -> Some l
215215
| FunApp
216-
( StanLib (transpose, FnPlain, _)
217-
, [{pattern= FunApp (CompilerInternal FnMakeRowVec, l); _}] )
218-
when String.equal transpose (Operator.to_string Transpose) ->
216+
( StanLib ("Transpose__", FnPlain, _)
217+
, [{pattern= FunApp (CompilerInternal FnMakeRowVec, l); _}] ) ->
219218
Some l
220219
| _ -> None
221220

src/stanc/stanc.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ let use_file filename =
272272
(Deprecation_analysis.collect_warnings typed_ast) ;
273273
if !generate_data then
274274
print_endline
275-
(Debug_data_generation.print_data_prog (Ast_to_Mir.trans_data typed_ast)) ;
275+
(Debug_data_generation.print_data_prog (Ast_to_Mir.gather_data typed_ast)) ;
276276
Debugging.typed_ast_logger typed_ast ;
277277
if not !pretty_print_program then (
278278
let mir = Ast_to_Mir.trans_prog filename typed_ast in

src/stancjs/stancjs.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ let stan2cpp model_name model_string is_flag_set flag_val =
9292
r.return
9393
( Result.Ok
9494
(Debug_data_generation.print_data_prog
95-
(Ast_to_Mir.trans_data typed_ast) )
95+
(Ast_to_Mir.gather_data typed_ast) )
9696
, warnings
9797
, [] ) ;
9898
let opt_mir =

test/unit/Debug_data_generation_tests.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ open Core_kernel
33
open Frontend
44
open Debug_data_generation
55

6-
let print_data_prog ast = print_data_prog (Ast_to_Mir.trans_data ast)
6+
let print_data_prog ast = print_data_prog (Ast_to_Mir.gather_data ast)
77

88
let%expect_test "whole program data generation check" =
99
let ast =

0 commit comments

Comments
 (0)