diff options
-rw-r--r-- | stdlib/arg.mli | 8 | ||||
-rw-r--r-- | stdlib/filename.ml | 4 | ||||
-rw-r--r-- | stdlib/filename.mli | 10 | ||||
-rw-r--r-- | stdlib/list.mli | 4 | ||||
-rw-r--r-- | stdlib/string.mli | 2 | ||||
-rw-r--r-- | test/Makefile.Mac | 39 | ||||
-rw-r--r-- | testasmcomp/arm.S | 12 | ||||
-rw-r--r-- | testlabl/tests.ml | 22 | ||||
-rw-r--r-- | tools/dumpobj.ml | 2 | ||||
-rw-r--r-- | tools/ocaml2to3.mll | 46 | ||||
-rw-r--r-- | toplevel/genprintval.ml | 50 | ||||
-rw-r--r-- | toplevel/trace.ml | 4 | ||||
-rw-r--r-- | utils/clflags.ml | 2 |
13 files changed, 104 insertions, 101 deletions
diff --git a/stdlib/arg.mli b/stdlib/arg.mli index 7f9739d3b..77911b0e7 100644 --- a/stdlib/arg.mli +++ b/stdlib/arg.mli @@ -2,7 +2,7 @@ (* *) (* Objective Caml *) (* *) -(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) +(* Damien Doligez, projet Para, INRIA Rocquencourt *) (* *) (* Copyright 1996 Institut National de Recherche en Informatique et *) (* en Automatique. All rights reserved. This file is distributed *) @@ -52,7 +52,7 @@ type spec = with a keyword. *) val parse : keywords:(string * spec * string) list -> - others:(string -> unit) -> errmsg:string -> unit + others:(string -> unit) -> errmsg:string -> unit (* [Arg.parse speclist anonfun usage_msg] parses the command line. [speclist] is a list of triples [(key, spec, doc)]. @@ -85,7 +85,7 @@ exception Bad of string message to reject invalid arguments. *) -val usage: keywords:(string * spec * string) list -> errmsg:string -> unit +val usage : keywords:(string * spec * string) list -> errmsg:string -> unit (* [Arg.usage speclist usage_msg] prints an error message including the list of valid options. This is the same message that @@ -93,7 +93,7 @@ val usage: keywords:(string * spec * string) list -> errmsg:string -> unit [speclist] and [usage_msg] are the same as for [Arg.parse]. *) -val current: int ref;; +val current : int ref;; (* Position (in [Sys.argv]) of the argument being processed. You can change this value, e.g. to force [Arg.parse] to skip some arguments. diff --git a/stdlib/filename.ml b/stdlib/filename.ml index 39acb16e0..62dd893f0 100644 --- a/stdlib/filename.ml +++ b/stdlib/filename.ml @@ -208,8 +208,8 @@ let quote s = Buffer.add_char b '\''; for i = 0 to l - 1 do if s.[i] = '\'' - then Buffer.add_string b quotequote - else Buffer.add_char b s.[i] + then Buffer.add_string b quotequote + else Buffer.add_char b s.[i] done; Buffer.add_char b '\''; Buffer.contents b diff --git a/stdlib/filename.mli b/stdlib/filename.mli index b414ee371..1be8239a3 100644 --- a/stdlib/filename.mli +++ b/stdlib/filename.mli @@ -36,7 +36,7 @@ val check_suffix : string -> suff:string -> bool (* [check_suffix name suff] returns [true] if the filename [name] ends with the suffix [suff]. *) val chop_suffix : string -> suff:string -> string - (* [chop_suffix name suff] removes the suffix [suff] from + (* [chop_suffix name suff] removes the suffix [suff] from the filename [name]. The behavior is undefined if [name] does not end with the suffix [suff]. *) val chop_extension : string -> string @@ -52,7 +52,7 @@ val dirname : string -> string current directory to [dirname name] (with [Sys.chdir]), references to [basename name] (which is a relative file name) designate the same file as [name] before the call to [Sys.chdir]. *) -val temp_file: prefix:string -> suffix:string -> string +val temp_file : prefix:string -> suffix:string -> string (* [temp_file prefix suffix] returns the name of a non-existent temporary file in the temporary directory. The base name of the temporary file is formed by concatenating @@ -65,7 +65,7 @@ val temp_file: prefix:string -> suffix:string -> string Under MacOS, the name of the temporary directory is given by the environment variable [TempFolder]; if not set, temporary files are created in the current directory. *) -val quote: string -> string;; +val quote : string -> string;; (* Return a quoted version of a file name, suitable for use as - one argument in a shell command line, escaping any shell - meta-characters. *) + one argument in a shell command line, escaping any shell + meta-characters. *) diff --git a/stdlib/list.mli b/stdlib/list.mli index 90d224db1..8e068e9b4 100644 --- a/stdlib/list.mli +++ b/stdlib/list.mli @@ -90,13 +90,13 @@ val rev_map2 : fun:('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list [List.rev (List.map2 f l)], but is tail-recursive and more efficient. *) val fold_left2 : - fun:(acc:'a -> 'b -> 'c -> 'a) -> acc:'a -> 'b list -> 'c list -> 'a + fun:(acc:'a -> 'b -> 'c -> 'a) -> acc:'a -> 'b list -> 'c list -> 'a (* [List.fold_left2 f a [b1; ...; bn] [c1; ...; cn]] is [f (... (f (f a b1 c1) b2 c2) ...) bn cn]. Raise [Invalid_argument] if the two lists have different lengths. *) val fold_right2 : - fun:('a -> 'b -> acc:'c -> 'c) -> 'a list -> 'b list -> acc:'c -> 'c + fun:('a -> 'b -> acc:'c -> 'c) -> 'a list -> 'b list -> acc:'c -> 'c (* [List.fold_right2 f [a1; ...; an] [b1; ...; bn] c] is [f a1 b1 (f a2 b2 (... (f an bn c) ...))]. Raise [Invalid_argument] if the two lists have diff --git a/stdlib/string.mli b/stdlib/string.mli index 270667782..9894ebcea 100644 --- a/stdlib/string.mli +++ b/stdlib/string.mli @@ -126,7 +126,7 @@ val uncapitalize: string -> string external unsafe_get : string -> int -> char = "%string_unsafe_get" external unsafe_set : string -> int -> char -> unit = "%string_unsafe_set" external unsafe_blit : - src:string -> src_pos:int -> + src:string -> src_pos:int -> dst:string -> dst_pos:int -> len:int -> unit = "blit_string" "noalloc" external unsafe_fill : string -> pos:int -> len:int -> char -> unit diff --git a/test/Makefile.Mac b/test/Makefile.Mac index 0d21ad338..61153dfbe 100644 --- a/test/Makefile.Mac +++ b/test/Makefile.Mac @@ -18,7 +18,8 @@ CAMLLEX = ::boot:ocamlrun ::lex:ocamllex CAMLDEP = ::boot:ocamlrun ::tools:ocamldep CAMLRUN = ::byterun:ocamlrun -BYTE_EXE = fib.byt takc.byt taku.byt sieve.byt quicksort.byt quicksort.fast.byt ¶ +BYTE_EXE = fib.byt takc.byt taku.byt sieve.byt quicksort.byt ¶ + quicksort.fast.byt ¶ fft.byt fft.fast.byt soli.byt soli.fast.byt boyer.byt kb.byt ¶ nucleic.byt genlex.byt bdd.byt @@ -90,15 +91,16 @@ clean ÄÄ # Regression test test Ä {BYTE_EXE} - for prog in `echo {BYTE_EXE} | streamedit -e '1 replace /.byt/ "" -c °'` - echo {prog} - if "`exists :Results:{prog}.runtest.Mac`" - :Results:{prog}.runtest.Mac test {CAMLRUN} {prog}.byt - else - {CAMLRUN} {prog}.byt > "{tempfolder}ocaml-test" - equal -d "{tempfolder}ocaml-test" :Results:{prog}.out - end - end + set echo 0 + for prog in `echo {BYTE_EXE} | streamedit -e '1 replace /.byt/ "" -c °'` + echo {prog} + if "`exists :Results:{prog}.runtest.Mac`" + :Results:{prog}.runtest.Mac test {CAMLRUN} {prog}.byt + else + {CAMLRUN} {prog}.byt > "{tempfolder}ocaml-test" + equal -d "{tempfolder}ocaml-test" :Results:{prog}.out + end + end clean ÄÄ delete -i :Lex:testscanner.ml "{tempfolder}ocaml-test" @@ -106,14 +108,15 @@ clean ÄÄ # Benchmark bench Ä {BYTE_EXE} - for prog in `echo {BYTE_EXE} | streamedit -e '1 replace /.byt/ "" -c °'` - echo {prog} - if "`exists :Results:{prog}.runtest.Mac`" - :Results:{prog}.runtest.Mac bench {CAMLRUN} {prog}.byt - else - time "{CAMLRUN} {prog}.byt ·dev:null" - end - end + set echo 0 + for prog in `echo {BYTE_EXE} | streamedit -e '1 replace /.byt/ "" -c °'` + echo {prog} + if "`exists :Results:{prog}.runtest.Mac`" + :Results:{prog}.runtest.Mac bench {CAMLRUN} {prog}.byt + else + time "{CAMLRUN} {prog}.byt ·dev:null" + end + end # Dependencies diff --git a/testasmcomp/arm.S b/testasmcomp/arm.S index 64b94a12e..196a3f397 100644 --- a/testasmcomp/arm.S +++ b/testasmcomp/arm.S @@ -12,11 +12,11 @@ /* $Id$ */ -fp .req r11 -ip .req r12 -sp .req r13 -lr .req r14 -pc .req r15 +fp .req r11 +ip .req r12 +sp .req r13 +lr .req r14 +pc .req r15 .text @@ -26,7 +26,7 @@ pc .req r15 call_gen_code: mov ip, sp stmfd sp!, {r4, r5, r6, r7, r8, r9, fp, ip, lr, pc} - sub fp, ip, #4 + sub fp, ip, #4 @ r0 is function to call @ r1, r2, r3 are arguments 1, 2, 3 mov r4, r0 diff --git a/testlabl/tests.ml b/testlabl/tests.ml index a37fefda7..c39d152fb 100644 --- a/testlabl/tests.ml +++ b/testlabl/tests.ml @@ -9,14 +9,14 @@ let sub s ?:pos{=0} ?:len{=String.length s - pos} () = String.sub s pos len let cCAMLtoTKpack_options w = function - `After v1 -> "-after" - | `Anchor v1 -> "-anchor" - | `Before v1 -> "-before" - | `Expand v1 -> "-expand" - | `Fill v1 -> "-fill" - | `In v1 -> "-in" - | `Ipadx v1 -> "-ipadx" - | `Ipady v1 -> "-ipady" - | `Padx v1 -> "-padx" - | `Pady v1 -> "-pady" - | `Side v1 -> "-side" + `After v1 -> "-after" + | `Anchor v1 -> "-anchor" + | `Before v1 -> "-before" + | `Expand v1 -> "-expand" + | `Fill v1 -> "-fill" + | `In v1 -> "-in" + | `Ipadx v1 -> "-ipadx" + | `Ipady v1 -> "-ipady" + | `Padx v1 -> "-padx" + | `Pady v1 -> "-pady" + | `Side v1 -> "-side" diff --git a/tools/dumpobj.ml b/tools/dumpobj.ml index d74786edf..16fbf973a 100644 --- a/tools/dumpobj.ml +++ b/tools/dumpobj.ml @@ -355,7 +355,7 @@ let op_shapes = [ ];; let print_instr ic = - printf "%8d" (currpc ic); + printf "%8d " (currpc ic); let op = inputu ic in if op >= Array.length names_of_instructions || op < 0 then (print_string "*** unknown opcode : "; print_int op) diff --git a/tools/ocaml2to3.mll b/tools/ocaml2to3.mll index e0745b0e6..89957b0c9 100644 --- a/tools/ocaml2to3.mll +++ b/tools/ocaml2to3.mll @@ -52,7 +52,7 @@ let b = Buffer.create 1024 ;; let blank = [' ' '\010' '\013' '\009' '\012'] let lowercase = ['a'-'z' '\223'-'\246' '\248'-'\255' '_'] let uppercase = ['A'-'Z' '\192'-'\214' '\216'-'\222'] -let identchar = +let identchar = ['A'-'Z' 'a'-'z' '_' '\192'-'\214' '\216'-'\246' '\248'-'\255' '\'' '0'-'9'] let symbolchar = ['!' '$' '%' '&' '*' '+' '-' '.' '/' ':' '<' '=' '>' '?' '@' '^' '|' '~'] @@ -68,7 +68,7 @@ let float_literal = rule token = parse lowercase identchar * ':' [ ^ ':' '=' '>'] { let s = Lexing.lexeme lexbuf in - lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_curr_pos - 2; + lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_curr_pos - 2; Buffer.add_string b (String.sub s 0 (String.length s - 2)); Buffer.add_string b " "; modified := true; @@ -89,7 +89,7 @@ rule token = parse Buffer.add_string b "(*"; comment lexbuf; token lexbuf } - | "?" + | "?" { Buffer.add_string b "??"; modified := true; token lexbuf } @@ -106,41 +106,41 @@ rule token = parse | "#" | "&" | "&&" - | "`" - | "'" - | "(" - | ")" - | "*" - | "," + | "`" + | "'" + | "(" + | ")" + | "*" + | "," | "??" | "->" - | "." + | "." | ".." - | ":" + | ":" | "::" | ":=" | ":>" - | ";" + | ";" | ";;" - | "<" + | "<" | "<-" - | "=" - | "[" + | "=" + | "[" | "[|" | "[<" - | "]" - | "{" + | "]" + | "{" | "{=" | "{<" - | "|" + | "|" | "||" | "|]" - | ">" + | ">" | ">]" - | "}" + | "}" | ">}" | "!=" - | "-" + | "-" | "-." | ['!' '~'] symbolchar * | '?' symbolchar2 * @@ -214,7 +214,7 @@ let convert_file name = try token (Lexing.from_channel ic); close_in ic with exn -> close_in ic; raise exn end; - if !modified then begin + if !modified then begin let backup = name ^ ".bak" in if Sys.file_exists backup then Sys.remove backup; Sys.rename name backup; @@ -240,4 +240,4 @@ let _ = Printexc.catch convert_file name done -} +} diff --git a/toplevel/genprintval.ml b/toplevel/genprintval.ml index 1fb94e064..32b996ce3 100644 --- a/toplevel/genprintval.ml +++ b/toplevel/genprintval.ml @@ -319,33 +319,33 @@ module Make(O : OBJ) = struct | Datarepr.Constr_not_found -> (* raised by find_constr_by_tag *) print_string "<unknown constructor>" end - | Tvariant row -> - let row = Btype.row_repr row in - if O.is_block obj then begin - let tag : int = O.obj (O.field obj 0) in - if prio > 1 then (open_box 2; print_char '('); - print_char '`'; - List.iter - (fun (l,f) -> if Btype.hash_variant l = tag then - match Btype.row_field_repr f with - Rpresent(Some ty) -> - print_string l; print_space (); - cautious (print_val 2 (depth - 1) (O.field obj 1)) ty - | _ -> ()) - row.row_fields; - if prio >1 then (print_char ')'; close_box ()) - end else begin - let tag : int = O.obj obj in - print_char '`'; - List.iter - (fun (l,_) -> - if Btype.hash_variant l = tag then print_string l) - row.row_fields - end + | Tvariant row -> + let row = Btype.row_repr row in + if O.is_block obj then begin + let tag : int = O.obj (O.field obj 0) in + if prio > 1 then (open_box 2; print_char '('); + print_char '`'; + List.iter + (fun (l,f) -> if Btype.hash_variant l = tag then + match Btype.row_field_repr f with + Rpresent(Some ty) -> + print_string l; print_space (); + cautious (print_val 2 (depth - 1) (O.field obj 1)) ty + | _ -> ()) + row.row_fields; + if prio >1 then (print_char ')'; close_box ()) + end else begin + let tag : int = O.obj obj in + print_char '`'; + List.iter + (fun (l,_) -> + if Btype.hash_variant l = tag then print_string l) + row.row_fields + end | Tobject (_, _) -> print_string "<obj>" - | Tsubst ty -> - print_val prio (depth - 1) obj ty + | Tsubst ty -> + print_val prio (depth - 1) obj ty | Tfield(_, _, _, _) | Tnil | Tlink _ -> fatal_error "Printval.print_value" diff --git a/toplevel/trace.ml b/toplevel/trace.ml index bfc657b52..46d60919b 100644 --- a/toplevel/trace.ml +++ b/toplevel/trace.ml @@ -77,7 +77,7 @@ let rec instrument_result env name clos_typ = open_box 2; Printtyp.longident starred_name; print_string " <--"; print_space(); - print_label l; + print_label l; print_value !toplevel_env arg t1; close_box(); print_newline(); try @@ -105,7 +105,7 @@ let instrument_closure env name clos_typ = (fun actual_code closure arg -> open_box 2; Printtyp.longident name; print_string " <--"; print_space(); - print_label l; + print_label l; print_value !toplevel_env arg t1; close_box(); print_newline(); try diff --git a/utils/clflags.ml b/utils/clflags.ml index 3104a0981..5ad786c9f 100644 --- a/utils/clflags.ml +++ b/utils/clflags.ml @@ -30,7 +30,7 @@ and link_everything = ref false (* -linkall *) and custom_runtime = ref false (* -custom *) and output_c_object = ref false (* -output-obj *) and ccopts = ref ([] : string list) (* -ccopt *) -and classic = ref true (* -modern *) +and classic = ref true (* -modern *) and nopervasives = ref false (* -nopervasives *) and preprocessor = ref(None : string option) (* -pp *) and thread_safe = ref false (* -thread *) |