Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix deprecation warnings on newer OCaml compiler.

  • Loading branch information...
commit 16e830807c8a27d7336080e45446c7c522122ea6 1 parent 10b3ef8
@nadako nadako authored
Showing with 12 additions and 12 deletions.
  1. +1 −1  gencommon.ml
  2. +5 −5 gencs.ml
  3. +3 −3 genjava.ml
  4. +3 −3 genphp.ml
View
2  gencommon.ml
@@ -2177,7 +2177,7 @@ struct
| OpNotEq -> (* != -> !equals() *)
mk_paren { eexpr = TUnop(Ast.Not, Prefix, (equals_handler (run e1) (run e2))); etype = gen.gcon.basic.tbool; epos = e.epos }
| OpAdd ->
- if handle_strings && (is_string e.etype or is_string e1.etype or is_string e2.etype) then
+ if handle_strings && (is_string e.etype || is_string e1.etype || is_string e2.etype) then
{ e with eexpr = TBinop(op, mk_cast gen.gcon.basic.tstring (run e1), mk_cast gen.gcon.basic.tstring (run e2)) }
else
dyn_plus_handler e (run e1) (run e2)
View
10 gencs.ml
@@ -1976,7 +1976,7 @@ let configure gen =
in
let module_gen w md_def =
- List.fold_left (fun should md -> module_type_gen w md or should) false md_def.m_types
+ List.fold_left (fun should md -> module_type_gen w md || should) false md_def.m_types
in
(* generate source code *)
@@ -2307,16 +2307,16 @@ let configure gen =
| _, TConst(TNull) when is_null_expr e1 ->
false
| _ ->
- should_handle_opeq e1.etype or should_handle_opeq e2.etype
+ should_handle_opeq e1.etype || should_handle_opeq e2.etype
)
| TBinop (Ast.OpAssignOp Ast.OpAdd, e1, e2) ->
is_dynamic_expr e1 || is_null_expr e1 || is_string e.etype
- | TBinop (Ast.OpAdd, e1, e2) -> is_dynamic e1.etype or is_dynamic e2.etype or is_type_param e1.etype or is_type_param e2.etype or is_string e1.etype or is_string e2.etype or is_string e.etype
+ | TBinop (Ast.OpAdd, e1, e2) -> is_dynamic e1.etype || is_dynamic e2.etype || is_type_param e1.etype || is_type_param e2.etype || is_string e1.etype || is_string e2.etype || is_string e.etype
| TBinop (Ast.OpLt, e1, e2)
| TBinop (Ast.OpLte, e1, e2)
| TBinop (Ast.OpGte, e1, e2)
- | TBinop (Ast.OpGt, e1, e2) -> is_dynamic e.etype or is_dynamic_expr e1 or is_dynamic_expr e2 or is_string e1.etype or is_string e2.etype
- | TBinop (_, e1, e2) -> is_dynamic e.etype or is_dynamic_expr e1 or is_dynamic_expr e2
+ | TBinop (Ast.OpGt, e1, e2) -> is_dynamic e.etype || is_dynamic_expr e1 || is_dynamic_expr e2 || is_string e1.etype || is_string e2.etype
+ | TBinop (_, e1, e2) -> is_dynamic e.etype || is_dynamic_expr e1 || is_dynamic_expr e2
| TUnop (_, _, e1) -> is_dynamic_expr e1 || is_null_expr e1 (* we will see if the expression is Null<T> also, as the unwrap from Unop will be the same *)
| _ -> false)
(fun e1 e2 ->
View
6 genjava.ml
@@ -1951,12 +1951,12 @@ let configure gen =
(DynamicOperators.abstract_implementation gen (fun e -> match e.eexpr with
| TBinop (Ast.OpEq, e1, e2)
| TBinop (Ast.OpAdd, e1, e2)
- | TBinop (Ast.OpNotEq, e1, e2) -> is_dynamic e1.etype or is_dynamic e2.etype or is_type_param e1.etype or is_type_param e2.etype
+ | TBinop (Ast.OpNotEq, e1, e2) -> is_dynamic e1.etype || is_dynamic e2.etype || is_type_param e1.etype || is_type_param e2.etype
| TBinop (Ast.OpLt, e1, e2)
| TBinop (Ast.OpLte, e1, e2)
| TBinop (Ast.OpGte, e1, e2)
- | TBinop (Ast.OpGt, e1, e2) -> is_dynamic e.etype or is_dynamic_expr e1 or is_dynamic_expr e2 or is_string e1.etype or is_string e2.etype
- | TBinop (_, e1, e2) -> is_dynamic e.etype or is_dynamic_expr e1 or is_dynamic_expr e2
+ | TBinop (Ast.OpGt, e1, e2) -> is_dynamic e.etype || is_dynamic_expr e1 || is_dynamic_expr e2 || is_string e1.etype || is_string e2.etype
+ | TBinop (_, e1, e2) -> is_dynamic e.etype || is_dynamic_expr e1 || is_dynamic_expr e2
| TUnop (_, _, e1) -> is_dynamic_expr e1
| _ -> false)
(fun e1 e2 ->
View
6 genphp.ml
@@ -288,7 +288,7 @@ let escape_bin s =
let b = Buffer.create 0 in
for i = 0 to String.length s - 1 do
match Char.code (String.unsafe_get s i) with
- | c when c = Char.code('\\') or c = Char.code('"') or c = Char.code('$') ->
+ | c when c = Char.code('\\') || c = Char.code('"') || c = Char.code('$') ->
Buffer.add_string b "\\";
Buffer.add_char b (Char.chr c)
| c when c < 32 ->
@@ -2221,7 +2221,7 @@ let generate com =
if static then
(n = (prefixed_name false))
else
- ((n = (prefixed_name false)) or (n = (prefixed_name true)))
+ ((n = (prefixed_name false)) || (n = (prefixed_name true)))
) !lc_names in
unsupported ("method '" ^ (s_type_path c.cl_path) ^ "." ^ cf.cf_name ^ "' already exists here '" ^ (fst lc) ^ "' (different case?)") c.cl_pos
with Not_found ->
@@ -2300,7 +2300,7 @@ let generate com =
newline ctx;
gen_expr ctx e);
List.iter (generate_static_field_assign ctx c.cl_path) c.cl_ordered_statics;
- if c.cl_path = (["php"], "Boot") & com.debug then begin
+ if c.cl_path = (["php"], "Boot") && com.debug then begin
newline ctx;
print ctx "$%s = new _hx_array(array())" ctx.stack.Codegen.stack_var;
newline ctx;
Please sign in to comment.
Something went wrong with that request. Please try again.