diff --git a/parser.mly b/parser.mly index aff6c762..974c3d81 100644 --- a/parser.mly +++ b/parser.mly @@ -138,7 +138,7 @@ fun_binder: | type_name=qual_ident_ty "::" func_name=LIDENT {} | binder {} fun_header: - pub=ioption("pub") "func" + pub=ioption("pub") toplevel_fn fun_binder=fun_binder /* TODO: move the quants before self */ quants=optional_type_parameters @@ -146,7 +146,8 @@ fun_header: ts=option("->" t=type_{}) {} - +%inline toplevel_fn: "func" + | "fn" {} %inline block_expr: "{" ls=list_semis_rev(statement_expr) "}" {} val_header : pub=ioption("pub") "let" binder=binder t=opt_annot {}