@@ -115329,19 +115329,19 @@ let flow_deli_offset deli =
115329115329(* Here the loc is the payload loc *)
115330115330let check_flow_errors ~(loc : Location.t)
115331115331 ~offset
115332- (errors : (Loc.t * Parse_error.t) list) =
115332+ (errors : (Loc.t * Parse_error.t) list) : unit =
115333115333 match errors with
115334115334 | [] -> ()
115335115335 | ({start ;
115336115336 _end },first_error) :: _ ->
115337115337 let loc_start = loc.loc_start in
115338- Location.raise_errorf
115339- ~loc: {loc with
115338+ Location.prerr_warning
115339+ {loc with
115340115340 loc_start = offset_pos loc_start start
115341115341 offset ;
115342115342 loc_end = offset_pos loc_start _end
115343- offset } "%s"
115344- (Parse_error.PP.error first_error)
115343+ offset }
115344+ (Bs_ffi_warning ( Parse_error.PP.error first_error))
115345115345end
115346115346module Flow_ast
115347115347= struct
@@ -393849,16 +393849,20 @@ let classify_exp (prog : _ Flow_ast.Expression.t ) : Js_raw_info.exp =
393849393849 - in parsing
393850393850 - in code generation
393851393851 *)
393852- let classify ?check (prog : string) : Js_raw_info.exp =
393852+ let classify ?( check : (Location.t*int) option) (prog : string) : Js_raw_info.exp =
393853393853 let prog, errors =
393854393854 Parser_flow.parse_expression
393855393855 (Parser_env.init_env None prog) false in
393856- ( match check with
393857- | Some (loc,offset) ->
393856+ match check, errors with
393857+ | Some (loc,offset), _ :: _ ->
393858393858 Bs_flow_ast_utils.check_flow_errors
393859- ~loc ~offset errors
393860- | None -> ());
393861- classify_exp prog
393859+ ~loc ~offset errors;
393860+ Js_exp_unknown
393861+ | Some _, []
393862+ | None , [] ->
393863+ classify_exp prog
393864+ | None , _ :: _ -> Js_exp_unknown
393865+
393862393866
393863393867
393864393868let classify_stmt (prog : string) : Js_raw_info.stmt =
@@ -398775,7 +398779,7 @@ let raw_as_string_exp_exn
398775398779 Bs_flow_ast_utils.check_flow_errors ~loc ~offset:(Bs_flow_ast_utils.flow_deli_offset deli) (match kind with
398776398780 | Raw_re
398777398781 | Raw_exp ->
398778- let (_loc,e),errors = ( Parser_flow.parse_expression (Parser_env.init_env None str) false) in
398782+ let (_loc,e),errors = Parser_flow.parse_expression (Parser_env.init_env None str) false in
398779398783 if kind = Raw_re then
398780398784 (match e with
398781398785 | Literal {value = RegExp _} -> ()
0 commit comments