Skip to content

Commit

Permalink
remove TRACE
Browse files Browse the repository at this point in the history
  • Loading branch information
ranjitjhala committed Dec 10, 2024
1 parent 040e731 commit 6c0273a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 62 deletions.
1 change: 0 additions & 1 deletion crates/flux-middle/src/rty/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,6 @@ impl PrettyNested for Ty {
let field_d = field.fmt_nested(cx)?;
children.push(NestedString { key: Some(key), ..field_d });
}
println!("TRACE: DUMP {}", text);
Ok(NestedString { text, children: Some(children), key: None })
}
TyKind::Param(..)
Expand Down
1 change: 0 additions & 1 deletion crates/flux-refineck/src/type_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,6 @@ impl TypeEnvTrace {
let local = loc_info(loc);
let kind = format!("{:?}", binding.kind);
let ty = binding.ty.nested_string(&cx);
println!("TRACE: TypEnvTrace {}", ty);
bindings.push(TypeEnvBind { name, local, kind, ty });
});

Expand Down
60 changes: 0 additions & 60 deletions tools/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,63 +35,3 @@ Flux View Panel: shows the types and environments known at each program point
![Before Statement](static/flux_view_start.jpg)

![After Statement](static/flux_view_end.jpg)



## Noodling


```typescript
type NestedData = {
key?: string,
text: string,
children?: NestedData[],
}
```
```haskell
data Exp
= EVar Str
| ENum Int
| EAdd Exp Exp
| ERec [(Str, Exp)]
| EDot Exp Str

render :: Exp -> NestedData
render (EVar x) =
{ text: x }
render (ENum n) =
{ text: show n }
render (EAdd e1 e2) =
{ text, children }
where
d1 = render e1
d2 = render e2
text = printf "({} + {})" d1.text d2.text
children = flatten [d1.children, d2.children]
render (EDot e fld) =
{ text, children }
where
d = render e
text = printf "{}.{}" d.text fld
children = d.children
render (ERec fldExprs) =
{ text, children }
where
text = "{..}"
children = renderKey <$> fldExprs

renderKey :: (Str, Exp) -> NestedData
renderKey (fld, e) = { key: fld, text: d.text, children: d.children }
where
d = render e

flatten :: [[NestedData]] -> [NestedData]
flatten kidss = case filter (not . null) kidss of
[] -> []
[kids] -> kids
kidss'' -> zipWith mkArg [0..] kidss''

mkArg :: Int -> [NestedData] -> NestedData
mkArg i kids = { key: "arg " ++ show i, text: "{..}", children: kids }
```

0 comments on commit 6c0273a

Please sign in to comment.