Skip to content

How to tell when a statement is in data/transformed data/parameters/transformed parameters, etc? #876

Answered by nhuurre
SteveBronder asked this question in Q&A
Discussion options

You must be logged in to vote

There's not. That information is in program.output_vars only.
You could either have a new function like

let pp_toplevel_statement (params : String.Set.t) ppf stmt =
  match stmt.Stmt.Fixed.pattern with
  | Decl {decl_adtype; decl_id; decl_type} when Set.mem params decl_id ->
      pp_decl ppf (decl_id, decl_type, decl_adtype)
  | _ -> pp_statement ppf stmt

or it might make sense to add a new is_mappable : bool field to Decl in middle/Stmt.ml.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by SteveBronder
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #873 on April 10, 2021 04:14.