@@ -1726,11 +1726,9 @@ and parse_es6_arrow_expression ?(arrow_attrs = []) ?(arrow_start_pos = None)
17261726 let start_pos = p.Parser. start_pos in
17271727 Parser. leave_breadcrumb p Grammar. Es6ArrowExpr ;
17281728 (* Parsing function parameters and attributes:
1729- 1. Basically, attributes outside of `(...)` are added to the function, except
1730- the uncurried attribute `(.)` is added to the function. e.g. async, uncurried
1731-
1729+ 1. Attributes outside of `(...)` are added to the function, e.g. async.
17321730 2. Attributes inside `(...)` are added to the arguments regardless of whether
1733- labeled, optional or nolabeled *)
1731+ labeled, optional or nolabeled. *)
17341732 let parameters =
17351733 match term_parameters with
17361734 | Some params -> (None , params)
@@ -1807,9 +1805,6 @@ and parse_es6_arrow_expression ?(arrow_attrs = []) ?(arrow_start_pos = None)
18071805 {arrow_expr with pexp_loc = {arrow_expr.pexp_loc with loc_start = start_pos}}
18081806
18091807(*
1810- * dotted_parameter ::=
1811- * | . parameter
1812- *
18131808 * parameter ::=
18141809 * | pattern
18151810 * | pattern : type
@@ -1827,14 +1822,10 @@ and parse_es6_arrow_expression ?(arrow_attrs = []) ?(arrow_start_pos = None)
18271822 *)
18281823and parse_parameter p =
18291824 if
1830- p.Parser. token = Token. Typ || p.token = Tilde || p.token = Dot
1825+ p.Parser. token = Token. Typ || p.token = Tilde
18311826 || Grammar. is_pattern_start p.token
18321827 then
18331828 let start_pos = p.Parser. start_pos in
1834- let _ =
1835- Parser. optional p Token. Dot
1836- (* dot is ignored *)
1837- in
18381829 let attrs = parse_attributes p in
18391830 if p.Parser. token = Typ then (
18401831 Parser. next p;
@@ -1934,7 +1925,6 @@ and parse_parameter_list p =
19341925 * | _
19351926 * | lident
19361927 * | ()
1937- * | (.)
19381928 * | ( parameter {, parameter} [,] )
19391929 *)
19401930and parse_parameters p : fundef_type_param option * fundef_term_param list =
@@ -1983,7 +1973,6 @@ and parse_parameters p : fundef_type_param option * fundef_term_param list =
19831973 ] )
19841974 | Lparen ->
19851975 Parser. next p;
1986- ignore (Parser. optional p Dot );
19871976 let type_params, term_params = parse_parameter_list p in
19881977 let term_params =
19891978 if term_params <> [] then term_params else [unit_term_parameter () ]
@@ -3902,29 +3891,13 @@ and parse_switch_expression p =
39023891 * | ~ label-name = ? _ (* syntax sugar *)
39033892 * | ~ label-name = ? expr : type
39043893 *
3905- * dotted_argument ::=
3906- * | . argument
39073894 *)
39083895and parse_argument p : argument option =
39093896 if
39103897 p.Parser. token = Token. Tilde
3911- || p.token = Dot || p.token = Underscore
3898+ || p.token = Underscore
39123899 || Grammar. is_expr_start p.token
3913- then
3914- match p.Parser. token with
3915- | Dot -> (
3916- Parser. next p;
3917- match p.token with
3918- (* apply(.) *)
3919- | Rparen ->
3920- let unit_expr =
3921- Ast_helper.Exp. construct
3922- (Location. mknoloc (Longident. Lident " ()" ))
3923- None
3924- in
3925- Some {label = Asttypes. Nolabel ; expr = unit_expr}
3926- | _ -> parse_argument2 p)
3927- | _ -> parse_argument2 p
3900+ then parse_argument2 p
39283901 else None
39293902
39303903and parse_argument2 p : argument option =
@@ -4614,9 +4587,6 @@ and parse_type_alias p typ =
46144587 * note:
46154588 * | attrs ~ident: type_expr -> attrs are on the arrow
46164589 * | attrs type_expr -> attrs are here part of the type_expr
4617- *
4618- * dotted_type_parameter ::=
4619- * | . type_parameter
46204590 *)
46214591and parse_type_parameter p =
46224592 let doc_attr : Parsetree.attributes =
@@ -4626,16 +4596,8 @@ and parse_type_parameter p =
46264596 [doc_comment_to_attribute loc s]
46274597 | _ -> []
46284598 in
4629- if
4630- p.Parser. token = Token. Tilde
4631- || p.token = Dot
4632- || Grammar. is_typ_expr_start p.token
4633- then
4599+ if p.Parser. token = Token. Tilde || Grammar. is_typ_expr_start p.token then
46344600 let start_pos = p.Parser. start_pos in
4635- let _ =
4636- Parser. optional p Dot
4637- (* dot is ignored *)
4638- in
46394601 let attrs = doc_attr @ parse_attributes p in
46404602 match p.Parser. token with
46414603 | Tilde -> (
0 commit comments