| Attached Files | ocaml-end-of-line.patch [^] (18,029 bytes) 2010-09-15 13:25 [Show Content] [Hide Content]commit fe6bff81580e70abb4b02a37c6c7f8cf10011ddf
Author: Stephane Glondu <steph@glondu.net>
Date: Wed Sep 15 13:21:22 2010 +0200
Fix incorrect end-of-line in string constants
diff --git a/bytecomp/bytelink.ml b/bytecomp/bytelink.ml
index ede7bb9..4792800 100644
--- a/bytecomp/bytelink.ml
+++ b/bytecomp/bytelink.ml
@@ -407,15 +407,15 @@ let link_bytecode_as_c tolink outfile =
begin try
(* The bytecode *)
output_string outchan "\
-#ifdef __cplusplus\n\
-extern \"C\" {\n\
-#endif\n\
-#include <caml/mlvalues.h>\n\
-CAMLextern void caml_startup_code(\n\
- code_t code, asize_t code_size,\n\
- char *data, asize_t data_size,\n\
- char *section_table, asize_t section_table_size,\n\
- char **argv);\n";
+#ifdef __cplusplus\
+\nextern \"C\" {\
+\n#endif\
+\n#include <caml/mlvalues.h>\
+\nCAMLextern void caml_startup_code(\
+\n code_t code, asize_t code_size,\
+\n char *data, asize_t data_size,\
+\n char *section_table, asize_t section_table_size,\
+\n char **argv);\n";
output_string outchan "static int caml_code[] = {\n";
Symtable.init();
Consistbl.clear crc_interfaces;
@@ -444,17 +444,17 @@ CAMLextern void caml_startup_code(\n\
(* The table of primitives *)
Symtable.output_primitive_table outchan;
(* The entry point *)
- output_string outchan "\n\
-void caml_startup(char ** argv)\n\
-{\n\
- caml_startup_code(caml_code, sizeof(caml_code),\n\
- caml_data, sizeof(caml_data),\n\
- caml_sections, sizeof(caml_sections),\n\
- argv);\n\
-}\n\
-#ifdef __cplusplus\n\
-}\n\
-#endif\n";
+ output_string outchan "\
+\nvoid caml_startup(char ** argv)\
+\n{\
+\n caml_startup_code(caml_code, sizeof(caml_code),\
+\n caml_data, sizeof(caml_data),\
+\n caml_sections, sizeof(caml_sections),\
+\n argv);\
+\n}\
+\n#ifdef __cplusplus\
+\n}\
+\n#endif\n";
close_out outchan
with x ->
close_out outchan;
diff --git a/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml b/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml
index 11fd025..2617512 100644
--- a/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml
+++ b/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml
@@ -33,19 +33,19 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
value help_sequences () =
do {
Printf.eprintf "\
-New syntax:\n\
- (e1; e2; ... ; en) OR begin e1; e2; ... ; en end\n\
- while e do e1; e2; ... ; en done\n\
- for v = v1 to/downto v2 do e1; e2; ... ; en done\n\
-Old syntax (still supported):\n\
- do {e1; e2; ... ; en}\n\
- while e do {e1; e2; ... ; en}\n\
- for v = v1 to/downto v2 do {e1; e2; ... ; en}\n\
-Very old (no more supported) syntax:\n\
- do e1; e2; ... ; en-1; return en\n\
- while e do e1; e2; ... ; en; done\n\
- for v = v1 to/downto v2 do e1; e2; ... ; en; done\n\
- ";
+New syntax:\
+\n (e1; e2; ... ; en) OR begin e1; e2; ... ; en end\
+\n while e do e1; e2; ... ; en done\
+\n for v = v1 to/downto v2 do e1; e2; ... ; en done\
+\nOld syntax (still supported):\
+\n do {e1; e2; ... ; en}\
+\n while e do {e1; e2; ... ; en}\
+\n for v = v1 to/downto v2 do {e1; e2; ... ; en}\
+\nVery old (no more supported) syntax:\
+\n do e1; e2; ... ; en-1; return en\
+\n while e do e1; e2; ... ; en; done\
+\n for v = v1 to/downto v2 do e1; e2; ... ; en; done\
+\n";
flush stderr;
exit 1
}
diff --git a/camlp4/boot/camlp4boot.ml b/camlp4/boot/camlp4boot.ml
index 618693e..090db0f 100644
--- a/camlp4/boot/camlp4boot.ml
+++ b/camlp4/boot/camlp4boot.ml
@@ -40,19 +40,19 @@ module R =
let help_sequences () =
(Printf.eprintf
"\
-New syntax:\n\
- (e1; e2; ... ; en) OR begin e1; e2; ... ; en end\n\
- while e do e1; e2; ... ; en done\n\
- for v = v1 to/downto v2 do e1; e2; ... ; en done\n\
-Old syntax (still supported):\n\
- do {e1; e2; ... ; en}\n\
- while e do {e1; e2; ... ; en}\n\
- for v = v1 to/downto v2 do {e1; e2; ... ; en}\n\
-Very old (no more supported) syntax:\n\
- do e1; e2; ... ; en-1; return en\n\
- while e do e1; e2; ... ; en; done\n\
- for v = v1 to/downto v2 do e1; e2; ... ; en; done\n\
- ";
+New syntax:\
+\n (e1; e2; ... ; en) OR begin e1; e2; ... ; en end\
+\n while e do e1; e2; ... ; en done\
+\n for v = v1 to/downto v2 do e1; e2; ... ; en done\
+\nOld syntax (still supported):\
+\n do {e1; e2; ... ; en}\
+\n while e do {e1; e2; ... ; en}\
+\n for v = v1 to/downto v2 do {e1; e2; ... ; en}\
+\nVery old (no more supported) syntax:\
+\n do e1; e2; ... ; en-1; return en\
+\n while e do e1; e2; ... ; en; done\
+\n for v = v1 to/downto v2 do e1; e2; ... ; en; done\
+\n";
flush stderr;
exit 1)
diff --git a/debugger/command_line.ml b/debugger/command_line.ml
index babb65b..944efa8 100644
--- a/debugger/command_line.ml
+++ b/debugger/command_line.ml
@@ -1008,10 +1008,10 @@ Argument N means do this N times (or till program stops for another reason)." };
(* Breakpoints *)
{ instr_name = "break"; instr_prio = false;
instr_action = instr_break; instr_repeat = false; instr_help =
-"Set breakpoint at specified line or function.\n\
-Syntax: break function-name\n\
- break @ [module] linenum\n\
- break @ [module] # characternum" };
+"Set breakpoint at specified line or function.\
+\nSyntax: break function-name\
+\n break @ [module] linenum\
+\n break @ [module] # characternum" };
{ instr_name = "delete"; instr_prio = false;
instr_action = instr_delete; instr_repeat = false; instr_help =
"delete some breakpoints.\n\
diff --git a/lex/output.ml b/lex/output.ml
index 620f67f..5ca403b 100644
--- a/lex/output.ml
+++ b/lex/output.ml
@@ -74,8 +74,8 @@ let output_tables oc tbl =
let output_entry sourcefile ic oc oci e =
let init_num, init_moves = e.auto_initial_state in
- fprintf oc "%s %alexbuf =\n\
- %a%a __ocaml_lex_%s_rec %alexbuf %d\n"
+ fprintf oc "%s %alexbuf =\
+\n %a%a __ocaml_lex_%s_rec %alexbuf %d\n"
e.auto_name
output_args e.auto_args
(fun oc x ->
diff --git a/lex/outputbis.ml b/lex/outputbis.ml
index 266c0ac..6d5e77c 100644
--- a/lex/outputbis.ml
+++ b/lex/outputbis.ml
@@ -20,31 +20,31 @@ open Lexgen
open Common
let output_auto_defs oc =
- fprintf oc "let __ocaml_lex_init_lexbuf lexbuf mem_size =\n\
- let pos = lexbuf.Lexing.lex_curr_pos in\n\
- lexbuf.Lexing.lex_mem <- Array.create mem_size (-1) ;\n\
- lexbuf.Lexing.lex_start_pos <- pos ;\n\
- lexbuf.Lexing.lex_last_pos <- pos ;\n\
- lexbuf.Lexing.lex_last_action <- -1\n\
-\n\
+ fprintf oc "let __ocaml_lex_init_lexbuf lexbuf mem_size =\
+\n let pos = lexbuf.Lexing.lex_curr_pos in\
+\n lexbuf.Lexing.lex_mem <- Array.create mem_size (-1) ;\
+\n lexbuf.Lexing.lex_start_pos <- pos ;\
+\n lexbuf.Lexing.lex_last_pos <- pos ;\
+\n lexbuf.Lexing.lex_last_action <- -1\
+\n\n\
" ;
output_string oc
- "let rec __ocaml_lex_next_char lexbuf =\n\
- if lexbuf.Lexing.lex_curr_pos >= lexbuf.Lexing.lex_buffer_len then begin\n\
- if lexbuf.Lexing.lex_eof_reached then\n\
- 256\n\
- else begin\n\
- lexbuf.Lexing.refill_buff lexbuf ;\n\
- __ocaml_lex_next_char lexbuf\n\
- end\n\
- end else begin\n\
- let i = lexbuf.Lexing.lex_curr_pos in\n\
- let c = lexbuf.Lexing.lex_buffer.[i] in\n\
- lexbuf.Lexing.lex_curr_pos <- i+1 ;\n\
- Char.code c\n\
- end\n\
-\n\
+ "let rec __ocaml_lex_next_char lexbuf =\
+\n if lexbuf.Lexing.lex_curr_pos >= lexbuf.Lexing.lex_buffer_len then begin\
+\n if lexbuf.Lexing.lex_eof_reached then\
+\n 256\
+\n else begin\
+\n lexbuf.Lexing.refill_buff lexbuf ;\
+\n __ocaml_lex_next_char lexbuf\
+\n end\
+\n end else begin\
+\n let i = lexbuf.Lexing.lex_curr_pos in\
+\n let c = lexbuf.Lexing.lex_buffer.[i] in\
+\n lexbuf.Lexing.lex_curr_pos <- i+1 ;\
+\n Char.code c\
+\n end\
+\n\n\
"
@@ -155,13 +155,13 @@ let output_automata oc auto =
let output_entry sourcefile ic oc tr e =
let init_num, init_moves = e.auto_initial_state in
- fprintf oc "%s %alexbuf =\n\
- __ocaml_lex_init_lexbuf lexbuf %d; %a\n\
- let __ocaml_lex_result = __ocaml_lex_state%d lexbuf in\n\
- lexbuf.Lexing.lex_start_p <- lexbuf.Lexing.lex_curr_p;\n\
- lexbuf.Lexing.lex_curr_p <- {lexbuf.Lexing.lex_curr_p with\n\
- Lexing.pos_cnum = lexbuf.Lexing.lex_abs_pos + lexbuf.Lexing.lex_curr_pos};\n\
- match __ocaml_lex_result with\n"
+ fprintf oc "%s %alexbuf =\
+\n __ocaml_lex_init_lexbuf lexbuf %d; %a\
+\n let __ocaml_lex_result = __ocaml_lex_state%d lexbuf in\
+\n lexbuf.Lexing.lex_start_p <- lexbuf.Lexing.lex_curr_p;\
+\n lexbuf.Lexing.lex_curr_p <- {lexbuf.Lexing.lex_curr_p with\
+\n Lexing.pos_cnum = lexbuf.Lexing.lex_abs_pos + lexbuf.Lexing.lex_curr_pos};\
+\n match __ocaml_lex_result with\n"
e.auto_name output_args e.auto_args
e.auto_mem_size (output_memory_actions " ") init_moves init_num ;
List.iter
diff --git a/ocamldoc/odoc_latex_style.ml b/ocamldoc/odoc_latex_style.ml
index a689b26..db0964a 100644
--- a/ocamldoc/odoc_latex_style.ml
+++ b/ocamldoc/odoc_latex_style.ml
@@ -13,79 +13,79 @@
(* $Id$ *)
-let content ="\n\
-%% Support macros for LaTeX documentation generated by ocamldoc.\n\
-%% This file is in the public domain; do what you want with it.\n\
+let content ="\
+\n%% Support macros for LaTeX documentation generated by ocamldoc.\
+\n%% This file is in the public domain; do what you want with it.\
\n\
-\\NeedsTeXFormat{LaTeX2e}\n\
-\\ProvidesPackage{ocamldoc}\n\
- [2001/12/04 v1.0 ocamldoc support]\n\
+\n\\NeedsTeXFormat{LaTeX2e}\
+\n\\ProvidesPackage{ocamldoc}\
+\n [2001/12/04 v1.0 ocamldoc support]\
\n\
-\\newenvironment{ocamldoccode}{%\n\
- \\bgroup\n\
- \\leftskip\\@totalleftmargin\n\
- \\rightskip\\z@skip\n\
- \\parindent\\z@\n\
- \\parfillskip\\@flushglue\n\
- \\parskip\\z@skip\n\
- %\\noindent\n\
- \\@@par\\smallskip\n\
- \\@tempswafalse\n\
- \\def\\par{%\n\
- \\if@tempswa\n\
- \\leavevmode\\null\\@@par\\penalty\\interlinepenalty\n\
- \\else\n\
- \\@tempswatrue\n\
- \\ifhmode\\@@par\\penalty\\interlinepenalty\\fi\n\
- \\fi}\n\
- \\obeylines\n\
- \\verbatim@font\n\
- \\let\\org@prime~%\n\
- \\@noligs\n\
- \\let\\org@dospecials\\dospecials\n\
- \\g@remfrom@specials{\\\\}\n\
- \\g@remfrom@specials{\\{}\n\
- \\g@remfrom@specials{\\}}\n\
- \\let\\do\\@makeother\n\
- \\dospecials\n\
- \\let\\dospecials\\org@dospecials\n\
- \\frenchspacing\\@vobeyspaces\n\
- \\everypar \\expandafter{\\the\\everypar \\unpenalty}}\n\
-{\\egroup\\par}\n\
+\n\\newenvironment{ocamldoccode}{%\
+\n \\bgroup\
+\n \\leftskip\\@totalleftmargin\
+\n \\rightskip\\z@skip\
+\n \\parindent\\z@\
+\n \\parfillskip\\@flushglue\
+\n \\parskip\\z@skip\
+\n %\\noindent\
+\n \\@@par\\smallskip\
+\n \\@tempswafalse\
+\n \\def\\par{%\
+\n \\if@tempswa\
+\n \\leavevmode\\null\\@@par\\penalty\\interlinepenalty\
+\n \\else\
+\n \\@tempswatrue\
+\n \\ifhmode\\@@par\\penalty\\interlinepenalty\\fi\
+\n \\fi}\
+\n \\obeylines\
+\n \\verbatim@font\
+\n \\let\\org@prime~%\
+\n \\@noligs\
+\n \\let\\org@dospecials\\dospecials\
+\n \\g@remfrom@specials{\\\\}\
+\n \\g@remfrom@specials{\\{}\
+\n \\g@remfrom@specials{\\}}\
+\n \\let\\do\\@makeother\
+\n \\dospecials\
+\n \\let\\dospecials\\org@dospecials\
+\n \\frenchspacing\\@vobeyspaces\
+\n \\everypar \\expandafter{\\the\\everypar \\unpenalty}}\
+\n{\\egroup\\par}\
\n\
-\\def\\g@remfrom@specials#1{%\n\
- \\def\\@new@specials{}\n\
- \\def\\@remove##1{%\n\
- \\ifx##1#1\\else\n\
- \\g@addto@macro\\@new@specials{\\do ##1}\\fi}\n\
- \\let\\do\\@remove\\dospecials\n\
- \\let\\dospecials\\@new@specials\n\
- }\n\
+\n\\def\\g@remfrom@specials#1{%\
+\n \\def\\@new@specials{}\
+\n \\def\\@remove##1{%\
+\n \\ifx##1#1\\else\
+\n \\g@addto@macro\\@new@specials{\\do ##1}\\fi}\
+\n \\let\\do\\@remove\\dospecials\
+\n \\let\\dospecials\\@new@specials\
+\n }\
\n\
-\\newenvironment{ocamldocdescription}\n\
-{\\list{}{\\rightmargin0pt \\topsep0pt}\\raggedright\\item\\noindent\\relax\\ignorespaces}\n\
-{\\endlist\\medskip}\n\
+\n\\newenvironment{ocamldocdescription}\
+\n{\\list{}{\\rightmargin0pt \\topsep0pt}\\raggedright\\item\\noindent\\relax\\ignorespaces}\
+\n{\\endlist\\medskip}\
\n\
-\\newenvironment{ocamldoccomment}\n\
-{\\list{}{\\leftmargin 2\\leftmargini \\rightmargin0pt \\topsep0pt}\\raggedright\\item\\noindent\\relax}\n\
-{\\endlist}\n\
+\n\\newenvironment{ocamldoccomment}\
+\n{\\list{}{\\leftmargin 2\\leftmargini \\rightmargin0pt \\topsep0pt}\\raggedright\\item\\noindent\\relax}\
+\n{\\endlist}\
\n\
-\\let \\ocamldocparagraph \\paragraph\n\
-\\def \\paragraph #1{\\ocamldocparagraph {#1}\\noindent}\n\
-\\let \\ocamldocsubparagraph \\subparagraph\n\
-\\def \\subparagraph #1{\\ocamldocsubparagraph {#1}\\noindent}\n\
+\n\\let \\ocamldocparagraph \\paragraph\
+\n\\def \\paragraph #1{\\ocamldocparagraph {#1}\\noindent}\
+\n\\let \\ocamldocsubparagraph \\subparagraph\
+\n\\def \\subparagraph #1{\\ocamldocsubparagraph {#1}\\noindent}\
\n\
-\\let\\ocamldocvspace\\vspace\n\
+\n\\let\\ocamldocvspace\\vspace\
\n\
-\\newenvironment{ocamldocindent}{\\list{}{}\\item\\relax}{\\endlist}\n\
-\\newenvironment{ocamldocsigend}\n\
- {\\noindent\\quad\\texttt{sig}\\ocamldocindent}\n\
- {\\endocamldocindent\\vskip -\\lastskip\n\
- \\noindent\\quad\\texttt{end}\\medskip}\n\
-\\newenvironment{ocamldocobjectend}\n\
- {\\noindent\\quad\\texttt{object}\\ocamldocindent}\n\
- {\\endocamldocindent\\vskip -\\lastskip\n\
- \\noindent\\quad\\texttt{end}\\medskip}\n\
+\n\\newenvironment{ocamldocindent}{\\list{}{}\\item\\relax}{\\endlist}\
+\n\\newenvironment{ocamldocsigend}\
+\n {\\noindent\\quad\\texttt{sig}\\ocamldocindent}\
+\n {\\endocamldocindent\\vskip -\\lastskip\
+\n \\noindent\\quad\\texttt{end}\\medskip}\
+\n\\newenvironment{ocamldocobjectend}\
+\n {\\noindent\\quad\\texttt{object}\\ocamldocindent}\
+\n {\\endocamldocindent\\vskip -\\lastskip\
+\n \\noindent\\quad\\texttt{end}\\medskip}\
\n\
-\\endinput\n\
-"
+\n\\endinput\
+\n"
diff --git a/tools/ocamlmklib.mlp b/tools/ocamlmklib.mlp
index 737749c..2e2edd0 100644
--- a/tools/ocamlmklib.mlp
+++ b/tools/ocamlmklib.mlp
@@ -141,37 +141,37 @@ let parse_arguments argv =
if !output_c = "" then output_c := !output
let usage = "\
-Usage: ocamlmklib [options] <.cmo|.cma|.cmx|.cmxa|.ml|.mli|.o|.a|.obj|.lib|.dll files>\n\
-Options are:\n\
- -cclib <lib> C library passed to ocamlc -a or ocamlopt -a only\n\
- -ccopt <opt> C option passed to ocamlc -a or ocamlopt -a only\n\
- -custom disable dynamic loading\n\
- -dllpath <dir> Add <dir> to the run-time search path for DLLs\n\
- -F<dir> Specify a framework directory (MacOSX)\n\
- -framework <name> Use framework <name> (MacOSX)\n\
- -help Print this help message and exit\n\
- --help Same as -help\n\
- -h Same as -help\n\
- -I <dir> Add <dir> to the path searched for Caml object files\n\
- -failsafe fall back to static linking if DLL construction failed\n\
- -ldopt <opt> C option passed to the shared linker only\n\
- -linkall Build Caml archive with link-all behavior\n\
- -l<lib> Specify a dependent C library\n\
- -L<dir> Add <dir> to the path searched for C libraries\n\
- -ocamlc <cmd> Use <cmd> in place of \"ocamlc\"\n\
- -ocamlopt <cmd> Use <cmd> in place of \"ocamlopt\"\n\
- -o <name> Generated Caml library is named <name>.cma or <name>.cmxa\n\
- -oc <name> Generated C library is named dll<name>.so or lib<name>.a\n\
- -rpath <dir> Same as -dllpath <dir>\n\
- -R<dir> Same as -rpath\n\
- -verbose Print commands before executing them\n\
- -v same as -verbose\n\
- -version Print version and exit\n\
- -vnum Print version number and exit\n\
- -Wl,-rpath,<dir> Same as -dllpath <dir>\n\
- -Wl,-rpath -Wl,<dir> Same as -dllpath <dir>\n\
- -Wl,-R<dir> Same as -dllpath <dir>\n\
-"
+Usage: ocamlmklib [options] <.cmo|.cma|.cmx|.cmxa|.ml|.mli|.o|.a|.obj|.lib|.dll files>\
+\nOptions are:\
+\n -cclib <lib> C library passed to ocamlc -a or ocamlopt -a only\
+\n -ccopt <opt> C option passed to ocamlc -a or ocamlopt -a only\
+\n -custom disable dynamic loading\
+\n -dllpath <dir> Add <dir> to the run-time search path for DLLs\
+\n -F<dir> Specify a framework directory (MacOSX)\
+\n -framework <name> Use framework <name> (MacOSX)\
+\n -help Print this help message and exit\
+\n --help Same as -help\
+\n -h Same as -help\
+\n -I <dir> Add <dir> to the path searched for Caml object files\
+\n -failsafe fall back to static linking if DLL construction failed\
+\n -ldopt <opt> C option passed to the shared linker only\
+\n -linkall Build Caml archive with link-all behavior\
+\n -l<lib> Specify a dependent C library\
+\n -L<dir> Add <dir> to the path searched for C libraries\
+\n -ocamlc <cmd> Use <cmd> in place of \"ocamlc\"\
+\n -ocamlopt <cmd> Use <cmd> in place of \"ocamlopt\"\
+\n -o <name> Generated Caml library is named <name>.cma or <name>.cmxa\
+\n -oc <name> Generated C library is named dll<name>.so or lib<name>.a\
+\n -rpath <dir> Same as -dllpath <dir>\
+\n -R<dir> Same as -rpath\
+\n -verbose Print commands before executing them\
+\n -v same as -verbose\
+\n -version Print version and exit\
+\n -vnum Print version number and exit\
+\n -Wl,-rpath,<dir> Same as -dllpath <dir>\
+\n -Wl,-rpath -Wl,<dir> Same as -dllpath <dir>\
+\n -Wl,-R<dir> Same as -dllpath <dir>\
+\n"
let command cmd =
if !verbose then (print_string "+ "; print_string cmd; print_newline());
|