Skip to content

Commit

Permalink
Merge pull request #99 from yoshihiro503/fix_record_declaration
Browse files Browse the repository at this point in the history
Fix record declaration
  • Loading branch information
yutopp authored May 15, 2019
2 parents 457a9a2 + c7906e2 commit 74636ea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/abstract_format.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ and form_t =
| DeclFun of {line: line_t; function_name: string; arity: int; clauses: clause_t list}
| SpecFun of {line: line_t; module_name: string option; function_name: string; arity: int; specs: type_t list}
| Callback of {line: line_t; function_name: string; arity: int; specs: type_t list}
| DeclRecord of {line: line_t; fields: record_field_t list}
| DeclRecord of {line: line_t; name: string; fields: record_field_t list}
| DeclType of {line: line_t; name: string; tvars: (line_t * string) list; ty: type_t}
| DeclOpaqueType of {line: line_t; name: string; tvars: (line_t * string) list; ty: type_t}
| AttrWild of {line: line_t; attribute: string; term: Sf.t}
Expand Down Expand Up @@ -377,7 +377,7 @@ and form_of_sf sf : (form_t, err_t) Result.t =
let%bind fields =
sf_fields |> List.map ~f:record_field_of_sf |> Result.all |> track ~loc:[%here]
in
DeclRecord {line; fields} |> return
DeclRecord {line; name; fields} |> return

(* type declaration *)
| Sf.Tuple (4, [Sf.Atom "attribute";
Expand Down
1 change: 1 addition & 0 deletions test/test_record.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ let%expect_test "test_record.beam" =
(module_name test_record))
(DeclRecord
(line 4)
(name r)
(fields (
(RecordField
(line 4)
Expand Down
1 change: 1 addition & 0 deletions test/test_type_attr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ let%expect_test "test_type_attr.beam" =
(args ()))))
(DeclRecord
(line 12)
(name state)
(fields (
(RecordField
(line 12)
Expand Down

0 comments on commit 74636ea

Please # to comment.