|
@@ -105,7 +105,7 @@ let parse ctx code file =
|
|
|
end;
|
|
|
tk
|
|
|
| CommentLine s ->
|
|
|
- if encloses_display_position (pos tk) then syntax_completion SCComment (pos tk);
|
|
|
+ if !in_display_file && encloses_display_position (pos tk) then syntax_completion SCComment (pos tk);
|
|
|
next_token()
|
|
|
| Sharp "end" ->
|
|
|
(match !mstack with
|
|
@@ -193,17 +193,24 @@ let parse_string com s p error inlined =
|
|
|
let old_file = (try Some (Hashtbl.find Lexer.all_files p.pfile) with Not_found -> None) in
|
|
|
let old_display = !display_position in
|
|
|
let old_de = !display_error in
|
|
|
+ let old_in_display_file = !in_display_file in
|
|
|
let restore() =
|
|
|
(match old_file with
|
|
|
| None -> ()
|
|
|
| Some f -> Hashtbl.replace Lexer.all_files p.pfile f);
|
|
|
- if not inlined then display_position := old_display;
|
|
|
+ if not inlined then begin
|
|
|
+ display_position := old_display;
|
|
|
+ in_display_file := old_in_display_file;
|
|
|
+ end;
|
|
|
Lexer.restore old;
|
|
|
display_error := old_de
|
|
|
in
|
|
|
Lexer.init p.pfile true;
|
|
|
display_error := (fun e p -> raise (Error (e,p)));
|
|
|
- if not inlined then display_position := null_pos;
|
|
|
+ if not inlined then begin
|
|
|
+ display_position := null_pos;
|
|
|
+ in_display_file := false;
|
|
|
+ end;
|
|
|
let pack, decls = try
|
|
|
parse com (Sedlexing.Utf8.from_string s) p.pfile
|
|
|
with Error (e,pe) ->
|