I'm not sure if there are 1 or 2 issues here.
- A constructor with arguments is accepted without parens; should this be a syntax error?
- Nested parents are dropped from the AST
Has parens
module Example exposing ( foo )
setStatus1 : Int -> Response -> Response
setStatus1 statusCode (Response response) =
Response { response | status = statusCode }
Produces this ctor in the AST:
{
"start": {
"row": 4,
"col": 24
},
"end": {
"row": 4,
"col": 41
},
"value": {
"type": "ctor",
"name": {
"start": {
"row": 4,
"col": 24
},
"end": {
"row": 4,
"col": 32
},
"value": "Response"
},
"arg": {
"start": {
"row": 4,
"col": 33
},
"end": {
"row": 4,
"col": 41
},
"value": {
"type": "var",
"name": "response"
}
}
}
}
No parens
Without parens:
module Example exposing ( foo )
setStatus2 : Int -> Response -> Response
setStatus2 statusCode Response response =
Response { response | status = statusCode }
produces the same AST (with small changes in a few token columns)
Nested parens
Unnecessary extra parens:
module Example exposing ( foo )
setStatus2 : Int -> Response -> Response
setStatus2 statusCode ((Response response)) =
Response { response | status = statusCode }
Also produces the same AST, modulo token column positions
I'm not sure if there are 1 or 2 issues here.
Has parens
Produces this ctor in the AST:
No parens
Without parens:
produces the same AST (with small changes in a few token columns)
Nested parens
Unnecessary extra parens:
Also produces the same AST, modulo token column positions