Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit f902e3a

Browse files
committed
add comments for the mental model
- of how to parse function parameters and attributes
1 parent bbf4db0 commit f902e3a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/res_core.ml

+6
Original file line numberDiff line numberDiff line change
@@ -1461,6 +1461,12 @@ and parseTernaryExpr leftOperand p =
14611461
and parseEs6ArrowExpression ?context ?parameters p =
14621462
let startPos = p.Parser.startPos in
14631463
Parser.leaveBreadcrumb p Grammar.Es6ArrowExpr;
1464+
(* Parsing function parameters and attributes:
1465+
1. Basically, attributes outside of `(...)` are added to the function, except
1466+
the uncurried attribute `(.)` is added to the function. e.g. async, uncurried
1467+
1468+
2. Attributes inside `(...)` are added to the arguments regardless of whether
1469+
labeled, optional or nolabeled *)
14641470
let parameters =
14651471
match parameters with
14661472
| Some params -> params

0 commit comments

Comments
 (0)