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

feat: parse universal type variables in signature items #2797

Merged
merged 2 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
[#2790](https://github.com/reasonml/reason/pull/2790))
- Support quoted extensions (@anmonteiro,
[#2794](https://github.com/reasonml/reason/pull/2794))
- Parse universal type variables in signature items (@anmonteiro,
[#2797](https://github.com/reasonml/reason/pull/2797))

## 3.12.0

Expand Down
2 changes: 1 addition & 1 deletion src/reason-parser/reason_parser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -1931,7 +1931,7 @@ signature:

signature_item:
| item_attributes
LET item_extension_sugar? as_loc(val_ident) COLON core_type
LET item_extension_sugar? as_loc(val_ident) COLON poly_type
{ let loc = mklocation $startpos($2) $endpos in
wrap_sig_ext
~loc
Expand Down
4 changes: 4 additions & 0 deletions test/general-syntax-re.t/input.re
Original file line number Diff line number Diff line change
Expand Up @@ -1322,3 +1322,7 @@ let () = {
3
};

module type x = {
let a: 'a. 'a => unit;
};

4 changes: 4 additions & 0 deletions test/general-syntax-re.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -1545,3 +1545,7 @@ Format general implementation syntax
let x = 1;
3;
};

module type x = {
let a: 'a. 'a => unit;
};
7 changes: 7 additions & 0 deletions test/general-syntax-rei.t/input.rei
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,10 @@ open! %foo Bar;
type%foo t = int;

type%x foo += Int;

module type x = {
let a: 'a. 'a => unit;
};

let a: 'a. 'a => unit;

6 changes: 6 additions & 0 deletions test/general-syntax-rei.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,9 @@ Format general interface syntax

type%x foo +=
| Int;

module type x = {
let a: 'a. 'a => unit;
};

let a: 'a. 'a => unit;
Loading