summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camlp4/etc/pr_o.ml5
-rw-r--r--camlp4/etc/pr_r.ml6
-rw-r--r--camlp4/lib/grammar.ml3
-rw-r--r--camlp4/ocaml_src/lib/grammar.ml3
4 files changed, 9 insertions, 8 deletions
diff --git a/camlp4/etc/pr_o.ml b/camlp4/etc/pr_o.ml
index 74eaba37b..0aed9b159 100644
--- a/camlp4/etc/pr_o.ml
+++ b/camlp4/etc/pr_o.ml
@@ -115,7 +115,8 @@ value has_special_chars v =
;
value var_escaped v =
- if has_special_chars v || is_infix v then "( " ^ v ^ " )"
+ if v = "" then "$lid:\"\"$"
+ else if has_special_chars v || is_infix v then "( " ^ v ^ " )"
else if is_keyword v then v ^ "__"
else v
;
@@ -786,7 +787,7 @@ and class_expr ce k =
[: `S LR "fun"; `simple_patt p "" [: `S LR "->" :];
`class_expr ce k :]
| MLast.CeLet _ rf lb ce ->
- HVbox
+ Vbox
[: `HVbox [: :];
`bind_list [: `S LR "let"; rec_flag rf :] lb "" [: `S LR "in" :];
`class_expr ce k :]
diff --git a/camlp4/etc/pr_r.ml b/camlp4/etc/pr_r.ml
index c187c7ac7..4b2fd83b3 100644
--- a/camlp4/etc/pr_r.ml
+++ b/camlp4/etc/pr_r.ml
@@ -125,7 +125,9 @@ value has_special_chars v =
;
value var_escaped v =
- if has_special_chars v || is_keyword v then " \\" ^ v else v
+ if v = "" then "$lid:\"\"$"
+ else if has_special_chars v || is_keyword v then " \\" ^ v
+ else v
;
value flag n f = if f then [: `S LR n :] else [: :];
@@ -763,7 +765,7 @@ and class_expr ce k =
HVbox
[: `S LR "fun"; `simple_patt p [: `S LR "->" :]; `class_expr ce k :]
| MLast.CeLet _ rf lb ce ->
- HVbox
+ Vbox
[: `HVbox [: :];
`bind_list [: `S LR "let"; flag "rec" rf :] lb [: `S LR "in" :];
`class_expr ce k :]
diff --git a/camlp4/lib/grammar.ml b/camlp4/lib/grammar.ml
index e8688f5f8..01a35be14 100644
--- a/camlp4/lib/grammar.ml
+++ b/camlp4/lib/grammar.ml
@@ -761,8 +761,7 @@ value extend_entry entry position rules =
with
[ Token.Error s ->
do {
- Printf.eprintf "Lexer initialization error.\n%s\n"
- (String.capitalize s);
+ Printf.eprintf "Lexer initialization error.\n%s\n" s;
flush stderr;
failwith "Grammar.extend"
} ]
diff --git a/camlp4/ocaml_src/lib/grammar.ml b/camlp4/ocaml_src/lib/grammar.ml
index 0ce395686..6b0792dc9 100644
--- a/camlp4/ocaml_src/lib/grammar.ml
+++ b/camlp4/ocaml_src/lib/grammar.ml
@@ -835,8 +835,7 @@ let extend_entry entry position rules =
entry.econtinue <- f; f lev bp a strm
with
Token.Error s ->
- Printf.eprintf "Lexer initialization error.\n%s\n"
- (String.capitalize s);
+ Printf.eprintf "Lexer initialization error.\n%s\n" s;
flush stderr;
failwith "Grammar.extend"
;;