Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Sesterl #1

Merged
merged 14 commits into from
Jul 10, 2021
Prev Previous commit
FIRST SUCCESS in passing the type check of Sesterl
  • Loading branch information
gfngfn committed Jul 10, 2021
commit 8f0a35ad387f2e391ff869c932f94bfe54dead82
19 changes: 13 additions & 6 deletions src/genSesterl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,19 @@ end = struct
(stringify_type ty2)

| RecordType(tyrcd) ->
let sr =
tyrcd |> List.map (fun (key, ty) ->
Format.sprintf "%s : %s" (Constant.key key) (stringify_type ty)
) |> String.concat ", "
in
Format.sprintf "{ %s }" sr
begin
match tyrcd with
| [] ->
"unit"

| _ :: _ ->
let sr =
tyrcd |> List.map (fun (key, ty) ->
Format.sprintf "%s : %s" (Constant.key key) (stringify_type ty)
) |> String.concat ", "
in
Format.sprintf "{ %s }" sr
end


let stringify_declaration (odecl : declaration) : string =
Expand Down