Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for parens around args to arrow funcs
Remove the lookahead check and just set that a potential arrow function is there.
- Loading branch information
1 parent
f17e743
commit 2857ab2
Showing
7 changed files
with
733 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...peline-operator/proposal-fsharp-arrow-in-body-no-parens-indented-with-arg-parens/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(x) => x | ||
|> (y) => y + 1 | ||
|> (z) => z * 2 |
3 changes: 3 additions & 0 deletions
3
...ne-operator/proposal-fsharp-arrow-in-body-no-parens-indented-with-arg-parens/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": [["pipelineOperator", { "proposal": "fsharp" }]] | ||
} |
361 changes: 361 additions & 0 deletions
361
...ine-operator/proposal-fsharp-arrow-in-body-no-parens-indented-with-arg-parens/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,361 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 44, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 44, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
} | ||
}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 0, | ||
"end": 44, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
} | ||
}, | ||
"expression": { | ||
"type": "ArrowFunctionExpression", | ||
"start": 0, | ||
"end": 44, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
} | ||
}, | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [ | ||
{ | ||
"type": "Identifier", | ||
"start": 1, | ||
"end": 2, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 2 | ||
}, | ||
"identifierName": "x" | ||
}, | ||
"name": "x" | ||
} | ||
], | ||
"body": { | ||
"type": "BinaryExpression", | ||
"start": 7, | ||
"end": 44, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 7 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
} | ||
}, | ||
"left": { | ||
"type": "PipelineHead", | ||
"start": 11, | ||
"end": 8, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
}, | ||
"head": { | ||
"type": "Identifier", | ||
"start": 7, | ||
"end": 8, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 7 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
}, | ||
"identifierName": "x" | ||
}, | ||
"name": "x" | ||
} | ||
}, | ||
"operator": "|>", | ||
"right": { | ||
"type": "PipelineBody", | ||
"start": 14, | ||
"end": 44, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
} | ||
}, | ||
"body": { | ||
"type": "ArrowFunctionExpression", | ||
"start": 14, | ||
"end": 44, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
} | ||
}, | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [ | ||
{ | ||
"type": "Identifier", | ||
"start": 15, | ||
"end": 16, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 6 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 7 | ||
}, | ||
"identifierName": "y" | ||
}, | ||
"name": "y" | ||
} | ||
], | ||
"body": { | ||
"type": "BinaryExpression", | ||
"start": 21, | ||
"end": 44, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 12 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
} | ||
}, | ||
"left": { | ||
"type": "BinaryExpression", | ||
"start": 21, | ||
"end": 26, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 12 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 17 | ||
} | ||
}, | ||
"left": { | ||
"type": "Identifier", | ||
"start": 21, | ||
"end": 22, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 12 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 13 | ||
}, | ||
"identifierName": "y" | ||
}, | ||
"name": "y" | ||
}, | ||
"operator": "+", | ||
"right": { | ||
"type": "NumericLiteral", | ||
"start": 25, | ||
"end": 26, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 16 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 17 | ||
} | ||
}, | ||
"extra": { | ||
"rawValue": 1, | ||
"raw": "1" | ||
}, | ||
"value": 1 | ||
} | ||
}, | ||
"operator": "|>", | ||
"right": { | ||
"type": "PipelineBody", | ||
"start": 32, | ||
"end": 44, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
} | ||
}, | ||
"body": { | ||
"type": "ArrowFunctionExpression", | ||
"start": 32, | ||
"end": 44, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
} | ||
}, | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [ | ||
{ | ||
"type": "Identifier", | ||
"start": 33, | ||
"end": 34, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 6 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 7 | ||
}, | ||
"identifierName": "z" | ||
}, | ||
"name": "z" | ||
} | ||
], | ||
"body": { | ||
"type": "BinaryExpression", | ||
"start": 39, | ||
"end": 44, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 12 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
} | ||
}, | ||
"left": { | ||
"type": "Identifier", | ||
"start": 39, | ||
"end": 40, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 12 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 13 | ||
}, | ||
"identifierName": "z" | ||
}, | ||
"name": "z" | ||
}, | ||
"operator": "*", | ||
"right": { | ||
"type": "NumericLiteral", | ||
"start": 43, | ||
"end": 44, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 16 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
} | ||
}, | ||
"extra": { | ||
"rawValue": 2, | ||
"raw": "2" | ||
}, | ||
"value": 2 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...mental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-with-arg-parens/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(x) => x |> (y) => y + 1 |> (z) => z * 2 |
3 changes: 3 additions & 0 deletions
3
...al/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-with-arg-parens/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": [["pipelineOperator", { "proposal": "fsharp" }]] | ||
} |
Oops, something went wrong.