Skip to content

Commit

Permalink
Finally the library builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
skaller committed May 23, 2022
1 parent f5887d0 commit 989f6ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/compiler/flx_bind/flx_bbind.ml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ let hfind msg h k =
let rec fix_typeofs state bsym_table t =
match t with
| BTYP_typeof (symbol_index,expr) ->
print_endline ("Found typeof to fix: " ^ Flx_btype.st t);
let env = Flx_lookup.build_env
state.lookup_state bsym_table (Some symbol_index)
in
let be = Flx_lookup.bind_expression
state.lookup_state bsym_table env expr
in
let typ = snd be in
print_endline ("Fixed typeof : " ^ Flx_btype.st t ^ ", set to " ^ Flx_btype.st typ);
typ
| _ -> Flx_btype.map ~f_btype:(fix_typeofs state bsym_table) t

Expand Down Expand Up @@ -179,6 +181,12 @@ if showpasses then
let b = bbdcl_structural_type_alias (bvs, r) in
Flx_bsym_table.update_bbdcl bsym_table bid b

| BBDCL_nominal_type_alias (bvs,t) ->
let r = fix_typeofs state bsym_table t in
let b = bbdcl_structural_type_alias (bvs, r) in
Flx_bsym_table.update_bbdcl bsym_table bid b


| BBDCL_type_function (bks,t) ->
let r = fix_typeofs state bsym_table t in
let b = bbdcl_type_function (bks, r) in
Expand Down
6 changes: 4 additions & 2 deletions src/compiler/flx_bind/flx_bind_type.ml
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,16 @@ print_endline ("Flx_bind_type.TYP_typeof fixpoint metatype hack! Expression " ^
*)
btyp_fix fixdepth (Flx_kind.KIND_type)
end else begin
if debug then
if debug then
print_endline ("Flx_bind_type.`TYP_typeof.Start tentative binding of typeof (" ^ string_of_expr e ^ ")");
let t = snd (bind_expression' state bsym_table env rs e []) in
if debug then
if debug then
print_endline ("Flx_bind_type.`TYP_typeof.end tentative binding of typeof (" ^string_of_expr e^ ")");
t
end
end else begin
if debug then
print_endline ("Flx_bind_type.DEFER `TYP_typeof(" ^ string_of_expr e ^ ")");
match env with
| (parent,_,_,_,_)::_ ->
btyp_typeof (parent, e)
Expand Down

0 comments on commit 989f6ff

Please sign in to comment.