summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2000-03-15 07:55:24 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2000-03-15 07:55:24 +0000
commit68366b25009f92c180dc690d9fc80f255add2494 (patch)
tree244ad918be03433c859dbd2281a3f80e61f42aeb
parent31f70a75d4f3afc3b412736254ba87020030e12d (diff)
sorry for the tabs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2960 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--otherlibs/labltk/browser/editor.ml2
-rw-r--r--otherlibs/labltk/browser/main.ml26
-rw-r--r--otherlibs/labltk/browser/shell.ml8
-rw-r--r--otherlibs/labltk/compiler/compile.ml2
-rw-r--r--otherlibs/labltk/support/slave.ml2
-rw-r--r--otherlibs/systhreads/threadUnix.mli2
-rw-r--r--parsing/lexer.mll16
-rw-r--r--typing/ctype.ml21
-rw-r--r--typing/printtyp.ml8
-rw-r--r--typing/typecore.ml12
10 files changed, 53 insertions, 46 deletions
diff --git a/otherlibs/labltk/browser/editor.ml b/otherlibs/labltk/browser/editor.ml
index d042524c0..a4f194223 100644
--- a/otherlibs/labltk/browser/editor.ml
+++ b/otherlibs/labltk/browser/editor.ml
@@ -35,7 +35,7 @@ let compiler_preferences () =
in
let chkbuttons, setflags = List.split
(List.map
- fun:(fun (text, ref, invert) -> mk_chkbutton :text :ref :invert)
+ fun:(fun (text, ref, invert) -> mk_chkbutton :text :ref :invert)
[ "No pervasives", Clflags.nopervasives, false;
"No warnings", Typecheck.nowarnings, false;
"Modern", Clflags.classic, true;
diff --git a/otherlibs/labltk/browser/main.ml b/otherlibs/labltk/browser/main.ml
index e59d65781..5caf9d564 100644
--- a/otherlibs/labltk/browser/main.ml
+++ b/otherlibs/labltk/browser/main.ml
@@ -20,20 +20,20 @@ let _ =
Arg.parse
keywords:[ "-I", Arg.String (fun s -> path := s :: !path),
"<dir> Add <dir> to the list of include directories";
- "-modern", Arg.Unit (fun () -> Clflags.classic := false),
- "Use strict label syntax";
- "-w", Arg.String (fun s -> Shell.warnings := s),
+ "-modern", Arg.Unit (fun () -> Clflags.classic := false),
+ "Use strict label syntax";
+ "-w", Arg.String (fun s -> Shell.warnings := s),
"<flags> Enable or disable warnings according to <flags>:\n\
- \032 A/a enable/disable all warnings\n\
- \032 C/c enable/disable suspicious comment\n\
- \032 F/f enable/disable partially applied function\n\
- \032 M/m enable/disable overriden method\n\
- \032 P/p enable/disable partial match\n\
- \032 S/s enable/disable non-unit statement\n\
- \032 U/u enable/disable unused match case\n\
- \032 V/v enable/disable hidden instance variable\n\
- \032 X/x enable/disable all other warnings\n\
- \032 default setting is A (all warnings enabled)" ]
+ \032 A/a enable/disable all warnings\n\
+ \032 C/c enable/disable suspicious comment\n\
+ \032 F/f enable/disable partially applied function\n\
+ \032 M/m enable/disable overriden method\n\
+ \032 P/p enable/disable partial match\n\
+ \032 S/s enable/disable non-unit statement\n\
+ \032 U/u enable/disable unused match case\n\
+ \032 V/v enable/disable hidden instance variable\n\
+ \032 X/x enable/disable all other warnings\n\
+ \032 default setting is A (all warnings enabled)" ]
others:(fun name -> raise(Arg.Bad("don't know what to do with " ^ name)))
errmsg:"ocamlbrowser :";
Config.load_path := List.rev !path @ [Config.standard_library];
diff --git a/otherlibs/labltk/browser/shell.ml b/otherlibs/labltk/browser/shell.ml
index 4f7dab265..aab1353dd 100644
--- a/otherlibs/labltk/browser/shell.ml
+++ b/otherlibs/labltk/browser/shell.ml
@@ -115,8 +115,8 @@ object (self)
let buf = String.create :len in
let len = Unix.read fd :buf pos:0 :len in
if len > 0 then begin
- self#insert (String.sub buf pos:0 :len);
- Text.mark_set textw mark:"input" index:(`Mark"insert",[`Char(-1)])
+ self#insert (String.sub buf pos:0 :len);
+ Text.mark_set textw mark:"input" index:(`Mark"insert",[`Char(-1)])
end;
len
with Unix.Unix_error _ -> 0
@@ -207,7 +207,7 @@ object (self)
self#insert (Str.global_replace pat:~"\r\n" with:"\n"
(Buffer.contents ibuffer));
Buffer.reset ibuffer;
- Text.mark_set textw mark:"input" index:(`Mark"insert",[`Char(-1)])
+ Text.mark_set textw mark:"input" index:(`Mark"insert",[`Char(-1)])
end;
Mutex.unlock imutex;
Timer.set ms:100 callback:read_buffer
@@ -215,7 +215,7 @@ object (self)
read_buffer ()
end else begin
try
- List.iter [in1;err1] fun:
+ List.iter [in1;err1] fun:
begin fun fd ->
Fileevent.add_fileinput :fd
callback:(fun () -> ignore (self#read :fd len:1024))
diff --git a/otherlibs/labltk/compiler/compile.ml b/otherlibs/labltk/compiler/compile.ml
index 9da88edae..888668d30 100644
--- a/otherlibs/labltk/compiler/compile.ml
+++ b/otherlibs/labltk/compiler/compile.ml
@@ -721,7 +721,7 @@ let write_external :w def =
end
with
| Not_found ->
- raise (Compiler_Error ("can't find external file: " ^ fname))
+ raise (Compiler_Error ("can't find external file: " ^ fname))
end
| _ -> raise (Compiler_Error "invalid external definition")
diff --git a/otherlibs/labltk/support/slave.ml b/otherlibs/labltk/support/slave.ml
index 2539e2426..5352285c3 100644
--- a/otherlibs/labltk/support/slave.ml
+++ b/otherlibs/labltk/support/slave.ml
@@ -19,7 +19,7 @@
* NOTE: camltk has not fully been initialised yet
*)
external tcl_eval : string -> string
- = "camltk_tcl_eval"
+ = "camltk_tcl_eval"
let tcl_command s = ignore (tcl_eval s);;
open Printf
diff --git a/otherlibs/systhreads/threadUnix.mli b/otherlibs/systhreads/threadUnix.mli
index 23693e6c8..12e2e7522 100644
--- a/otherlibs/systhreads/threadUnix.mli
+++ b/otherlibs/systhreads/threadUnix.mli
@@ -68,7 +68,7 @@ val sleep : int -> unit
(*** Sockets *)
val socket : domain:Unix.socket_domain ->
- type:Unix.socket_type -> proto:int -> Unix.file_descr
+ type:Unix.socket_type -> proto:int -> Unix.file_descr
val accept : Unix.file_descr -> Unix.file_descr * Unix.sockaddr
val connect : Unix.file_descr -> Unix.sockaddr -> unit
val recv : Unix.file_descr -> buf:string ->
diff --git a/parsing/lexer.mll b/parsing/lexer.mll
index 11bcb483f..e5b7fc8c9 100644
--- a/parsing/lexer.mll
+++ b/parsing/lexer.mll
@@ -172,6 +172,7 @@ let symbolchar =
['!' '$' '%' '&' '*' '+' '-' '.' '/' ':' '<' '=' '>' '?' '@' '^' '|' '~']
let symbolchar2 =
['!' '$' '%' '&' '*' '+' '-' '.' '/' '<' '=' '>' '?' '@' '^' '|' '~']
+(* ['!' '$' '&' '*' '+' '-' '.' '/' ':' '<' '=' '>' '?' '@' '^' '|' '~'] *)
let decimal_literal = ['0'-'9']+
let hex_literal = '0' ['x' 'X'] ['0'-'9' 'A'-'F' 'a'-'f']+
let oct_literal = '0' ['o' 'O'] ['0'-'7']+
@@ -186,13 +187,18 @@ rule token = parse
{ UNDERSCORE }
| lowercase identchar * ':' [ ^ ':' '=' '>']
{ let s = Lexing.lexeme lexbuf in
- lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_curr_pos - 1;
- LABEL (String.sub s 0 (String.length s - 2)) }
+ lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_curr_pos - 1;
+ LABEL (String.sub s 0 (String.length s - 2)) }
+(*
+ | lowercase identchar * ':'
+ { let s = Lexing.lexeme lexbuf in
+ LABEL (String.sub s 0 (String.length s - 1)) }
+ | '%' lowercase identchar *
+*)
| ':' lowercase identchar *
{ let s = Lexing.lexeme lexbuf in
- let l = String.length s - 1 in
- (* lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_curr_pos - l; *)
- LABELID (String.sub s 1 l) }
+ let l = String.length s - 1 in
+ LABELID (String.sub s 1 l) }
| lowercase identchar *
{ let s = Lexing.lexeme lexbuf in
try
diff --git a/typing/ctype.ml b/typing/ctype.ml
index b01378474..dd307018f 100644
--- a/typing/ctype.ml
+++ b/typing/ctype.ml
@@ -2283,25 +2283,26 @@ let rec normalize_type_rec env ty =
let row = row_repr row in
let fields = List.map
(fun (l,f) ->
- let f = row_field_repr f in
- begin match f with Reither(b, ty::(_::_ as tyl), e) ->
+ let f = row_field_repr f in l,
+ match f with Reither(b, ty::(_::_ as tyl), e) ->
let tyl' =
- List.fold_left
+ List.fold_left
(fun tyl ty ->
if List.exists (fun ty' -> equal env false [ty] [ty']) tyl
then tyl else ty::tyl)
[ty] tyl
in
if List.length tyl' < List.length tyl + 1 then
- e := Some(Reither(b, List.rev tyl', ref None))
- | _ -> ()
- end;
- l,f)
+ let f = Reither(b, List.rev tyl', ref None) in
+ e := Some f;
+ f
+ else f
+ | _ -> f)
row.row_fields
and bound = List.fold_left
- (fun tyl ty ->
- let ty = repr ty in if List.memq ty tyl then tyl else ty :: tyl)
- [] row.row_bound
+ (fun tyl ty ->
+ let ty = repr ty in if List.memq ty tyl then tyl else ty :: tyl)
+ [] row.row_bound
in ty.desc <- Tvariant {row with row_fields = fields; row_bound = bound}
| _ -> ()
end;
diff --git a/typing/printtyp.ml b/typing/printtyp.ml
index d0b17a86c..f7e9a87da 100644
--- a/typing/printtyp.ml
+++ b/typing/printtyp.ml
@@ -237,7 +237,7 @@ let rec typexp sch prio0 ppf ty =
fields in
let all_present = List.length present = List.length fields in
let pr_present =
- print_list (fun ppf (s, _) -> fprintf ppf "`%s" s)
+ print_list (fun ppf (s, _) -> fprintf ppf "`%s" s)
(fun () -> fprintf ppf "@ |")
in
begin match row.row_name with
@@ -248,7 +248,7 @@ let rec typexp sch prio0 ppf ty =
| [] -> ()
| l ->
if not all_present then
- fprintf ppf "@[<hov>[>%a]@]" pr_present l in
+ fprintf ppf "@[<hov>[>%a]@]" pr_present l in
fprintf ppf "@[%a%s%a%a@]"
(typargs sch) tyl sharp_mark path p print_present present
| _ ->
@@ -267,7 +267,7 @@ let rec typexp sch prio0 ppf ty =
| [] -> ()
| l ->
if not all_present then
- fprintf ppf "@ @[<hov>>%a@]" pr_present l in
+ fprintf ppf "@ @[<hov>>%a@]" pr_present l in
let print_fields =
print_list (row_field sch) (fun () -> fprintf ppf "@ |") in
@@ -419,7 +419,7 @@ let rec type_decl kwd id ppf decl =
print_constraints params
| Type_record lbls ->
fprintf ppf "@[<2>@[<hv 2>%a = {%a@;<1 -2>}@]@ %a@]"
- print_name_args decl
+ print_name_args decl
(print_list_init label (fun () -> fprintf ppf "@ ")) lbls
print_constraints params
end
diff --git a/typing/typecore.ml b/typing/typecore.ml
index f6df2f25b..ebdb56dd1 100644
--- a/typing/typecore.ml
+++ b/typing/typecore.ml
@@ -948,11 +948,11 @@ and type_application env funct sargs =
try
filter_arrow env ty_fun l1
with Unify _ ->
- let ty_fun =
- match expand_head env ty_fun with
- {desc=Tarrow _} as ty -> ty
- | _ -> ty_fun
- in
+ let ty_fun =
+ match expand_head env ty_fun with
+ {desc=Tarrow _} as ty -> ty
+ | _ -> ty_fun
+ in
let ty_res = result_type (omitted @ !ignored) ty_fun in
match ty_res with
{desc=Tarrow _} ->
@@ -1001,7 +1001,7 @@ and type_application env funct sargs =
if is_optional l &&
(List.mem_assoc "" sargs || List.mem_assoc "" more_sargs)
then begin
- ignored := (l,ty,lv) :: !ignored;
+ ignored := (l,ty,lv) :: !ignored;
Some (option_none ty Location.none)
end else None
in