Fixed bug #3776
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7155 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
ddb16a8326
commit
f0e54ce934
|
@ -83,9 +83,9 @@ value wrap f shfn lb =
|
||||||
lb.lex_curr_pos := lb.lex_curr_pos + 1;
|
lb.lex_curr_pos := lb.lex_curr_pos + 1;
|
||||||
Some c
|
Some c
|
||||||
}
|
}
|
||||||
})
|
}) in
|
||||||
in
|
let parse_fun = f lb.lex_curr_p in
|
||||||
try f cs with
|
try parse_fun cs with
|
||||||
[ Exc_located _ (Sys.Break as x) -> raise x
|
[ Exc_located _ (Sys.Break as x) -> raise x
|
||||||
| End_of_file as x -> raise x
|
| End_of_file as x -> raise x
|
||||||
| x ->
|
| x ->
|
||||||
|
@ -108,7 +108,7 @@ value wrap f shfn lb =
|
||||||
|
|
||||||
value first_phrase = ref True;
|
value first_phrase = ref True;
|
||||||
|
|
||||||
value toplevel_phrase cs =
|
value toplevel_phrase pos cs =
|
||||||
do {
|
do {
|
||||||
if Sys.interactive.val && first_phrase.val then do {
|
if Sys.interactive.val && first_phrase.val then do {
|
||||||
first_phrase.val := False;
|
first_phrase.val := False;
|
||||||
|
@ -121,7 +121,7 @@ value toplevel_phrase cs =
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
value use_file cs =
|
value use_file pos cs =
|
||||||
let v = Pcaml.input_file.val in
|
let v = Pcaml.input_file.val in
|
||||||
let (bolpos,lnum,fname) = Pcaml.position.val in
|
let (bolpos,lnum,fname) = Pcaml.position.val in
|
||||||
let restore =
|
let restore =
|
||||||
|
@ -132,7 +132,7 @@ value use_file cs =
|
||||||
} in
|
} in
|
||||||
do {
|
do {
|
||||||
Pcaml.input_file.val := Toploop.input_name.val;
|
Pcaml.input_file.val := Toploop.input_name.val;
|
||||||
bolpos.val := 0; lnum.val := 1; fname.val := Toploop.input_name.val;
|
bolpos.val := pos.pos_bol; lnum.val := pos.pos_lnum; fname.val := Toploop.input_name.val;
|
||||||
try
|
try
|
||||||
let (pl0, eoi) =
|
let (pl0, eoi) =
|
||||||
loop () where rec loop () =
|
loop () where rec loop () =
|
||||||
|
|
Loading…
Reference in New Issue