|
@@ -93,9 +93,15 @@ module ExprPreprocessing = struct
|
|
|
let find_display_call e =
|
|
|
let found = ref false in
|
|
|
let loop e = match fst e with
|
|
|
- | ECall _ | ENew _ when not !found && is_display_position (pos e) ->
|
|
|
- found := true;
|
|
|
- Parser.mk_display_expr e DKCall
|
|
|
+ | ECall(_,el) | ENew(_,el) when not !found && is_display_position (pos e) ->
|
|
|
+ let call_arg_is_marked () =
|
|
|
+ List.exists (fun (e,_) -> match e with EDisplay(_,DKMarked) -> true | _ -> false) el
|
|
|
+ in
|
|
|
+ if not !Parser.was_auto_triggered || call_arg_is_marked () then begin
|
|
|
+ found := true;
|
|
|
+ Parser.mk_display_expr e DKCall
|
|
|
+ end else
|
|
|
+ e
|
|
|
| _ -> e
|
|
|
in
|
|
|
let rec map e = loop (Ast.map_expr map e) in
|