Skip to content

Commit 9d706e7

Browse files
committed
Play nice with idempotent tests.
1 parent f9b50bd commit 9d706e7

File tree

3 files changed

+78
-1
lines changed

3 files changed

+78
-1
lines changed

res_syntax/src/res_core.ml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6404,7 +6404,14 @@ and parseStandaloneAttribute p =
64046404
let startPos = p.startPos in
64056405
Parser.expect AtAt p;
64066406
let attrId = parseAttributeId ~startPos p in
6407-
if attrId.txt = "uncurried" then p.uncurried_by_default <- true;
6407+
let attrId =
6408+
match attrId.txt with
6409+
| "uncurried" ->
6410+
p.uncurried_by_default <- true;
6411+
attrId
6412+
| "toUncurried" -> {attrId with txt = "uncurried"}
6413+
| _ -> attrId
6414+
in
64086415
let payload = parsePayload p in
64096416
(attrId, payload)
64106417

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
let cApp = foo(3)
2+
let uApp = foo(. 3)
3+
4+
let cFun = x => 3
5+
let uFun = (.x) => 3
6+
let mixFun = (a, .b, c) => (d, e, f) => (g, .h) => 4
7+
let bracesFun = (. x) => y => x+y
8+
let cFun2 = (x, y) => 3
9+
let uFun2 = (. x, y) => 3
10+
11+
type cTyp = string => int
12+
type uTyp = (. string) => int
13+
type mixTyp = (string, .string, string) => (string, string, string) => (string, .string) => int
14+
type bTyp = (. string) => string => int
15+
type cTyp2 = (string, string) => int
16+
type uTyp2 = (.string, string) => int
17+
18+
@@toUncurried
19+
20+
let cApp = foo(3)
21+
let uApp = foo(. 3)
22+
23+
let cFun = x => 3
24+
let uFun = (.x) => 3
25+
let mixFun = (a, .b, c) => (d, e, f) => (g, .h) => 4
26+
let bracesFun = (. x) => y => x+y
27+
let cFun2 = (x, y) => 3
28+
let uFun2 = (. x, y) => 3
29+
30+
type cTyp = string => int
31+
type uTyp = (. string) => int
32+
type mixTyp = (string, .string, string) => (string, string, string) => (string, .string) => int
33+
type bTyp = (. string) => string => int
34+
type cTyp2 = (string, string) => int
35+
type uTyp2 = (.string, string) => int
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
let cApp = foo(3)
2+
let uApp = foo(. 3)
3+
4+
let cFun = x => 3
5+
let uFun = (. x) => 3
6+
let mixFun = a => (. b, c) => {(d, e, f, g) => (. h) => 4}
7+
let bracesFun = (. x) => {y => x + y}
8+
let cFun2 = (x, y) => 3
9+
let uFun2 = (. x, y) => 3
10+
11+
type cTyp = string => int
12+
type uTyp = (. string) => int
13+
type mixTyp = string => (. string, string) => (string, string, string, string) => (. string) => int
14+
type bTyp = (. string) => string => int
15+
type cTyp2 = (string, string) => int
16+
type uTyp2 = (. string, string) => int
17+
18+
@@uncurried
19+
20+
let cApp = foo(. 3)
21+
let uApp = foo(3)
22+
23+
let cFun = (. x) => 3
24+
let uFun = x => 3
25+
let mixFun = (. a) => (b, c) => {(. d, e, f, g) => h => 4}
26+
let bracesFun = x => {(. y) => x + y}
27+
let cFun2 = (. x, y) => 3
28+
let uFun2 = (x, y) => 3
29+
30+
type cTyp = (. string) => int
31+
type uTyp = string => int
32+
type mixTyp = (. string) => (string, string) => (. string, string, string, string) => string => int
33+
type bTyp = string => (. string) => int
34+
type cTyp2 = (. string, string) => int
35+
type uTyp2 = (string, string) => int

0 commit comments

Comments
 (0)