From f75fecce9056ea1f2d3e44dea933103b7c4986e8 Mon Sep 17 00:00:00 2001 From: Alan Schmitt Date: Wed, 21 Jun 2017 08:53:01 +0200 Subject: [PATCH] fixing is_infix --- js_of_ast.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js_of_ast.ml b/js_of_ast.ml index 645df2b..ae2a39c 100644 --- a/js_of_ast.ml +++ b/js_of_ast.ml @@ -120,9 +120,11 @@ let is_infix f args = match args with | _ :: [] | [] -> false | x :: xs -> let open Location in - let f_loc = (f.exp_loc.loc_start, f.exp_loc.loc_end) in - let args_loc = (x.exp_loc.loc_start, x.exp_loc.loc_end) in - if fst args_loc < fst f_loc then true else false + let open Lexing in + if f.exp_loc.loc_ghost then false else + if x.exp_loc.loc_ghost then false else + x.exp_loc.loc_end.pos_lnum < f.exp_loc.loc_start.pos_lnum || + x.exp_loc.loc_end.pos_cnum < f.exp_loc.loc_start.pos_cnum exception Map_fields_elements_mismatch_number_args