summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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