summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>1996-08-22 18:12:24 +0000
committerDamien Doligez <damien.doligez-inria.fr>1996-08-22 18:12:24 +0000
commit2ec928c34a7d3d37acb75c5d6b947c2ac0c74cc2 (patch)
tree48535e6c82e9f32ebed01deb4e6b264a6d3e3288
parent65f5150ea5e329bada8a5afb0acedea6c65bb9ca (diff)
location.ml: bugfix affichage toplevel avec nouveau prompt.
parser.mly: "x;" synonyme de "x;()" git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@947 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--parsing/location.ml7
-rw-r--r--parsing/parser.mly2
2 files changed, 6 insertions, 3 deletions
diff --git a/parsing/location.ml b/parsing/location.ml
index 82d6a2a61..1dbcd465c 100644
--- a/parsing/location.ml
+++ b/parsing/location.ml
@@ -106,16 +106,17 @@ let rec highlight_location loc =
Terminfo.puts stdout !cursor_up 1
done;
(* Print the input, switching to standout for the location *)
- let bol = ref true in
+ let bol = ref false in
+ print_string "# ";
for pos = 0 to String.length lb.lex_buffer - pos0 - 1 do
- if !bol then (print_char '#'; bol := false);
+ if !bol then (print_string " "; bol := false);
if pos = loc.loc_start then
Terminfo.puts stdout !start_standout 1;
if pos = loc.loc_end then
Terminfo.puts stdout !end_standout 1;
let c = lb.lex_buffer.[pos + pos0] in
print_char c;
- bol := (c = '\n')
+ bol := (c = '\n')
done;
(* Make sure standout mode is over *)
Terminfo.puts stdout !end_standout 1;
diff --git a/parsing/parser.mly b/parsing/parser.mly
index 94c17342c..ed872b57d 100644
--- a/parsing/parser.mly
+++ b/parsing/parser.mly
@@ -385,6 +385,8 @@ expr:
{ mkexp(Pexp_ifthenelse($2, $4, None)) }
| expr SEMI expr
{ mkexp(Pexp_sequence($1, $3)) }
+ | expr SEMI
+ { mkexp(Pexp_sequence($1, mkexp(Pexp_construct(Lident "()", None)))) }
| WHILE expr DO expr DONE
{ mkexp(Pexp_while($2, $4)) }
| FOR val_ident EQUAL expr direction_flag expr DO expr DONE