Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[cleanup] remove chars: compiler

  • Loading branch information...
commit 0ab80d5fe4c6e479081fae4305804662ff2d250d 1 parent 53c835a
@fpessaux fpessaux authored François-Régis Sinot committed
Showing with 6 additions and 122 deletions.
  1. +0 −4 libbase/bslServerLib.ml
  2. +1 −4 libbsl/bslRegisterParser.trx
  3. +0 −1  libbsl/bslTypesGeneration.ml
  4. +0 −7 libqmlcompil/qmlAst.ml
  5. +0 −2  libqmlcompil/qmlAstCons.ml
  6. +0 −2  libqmlcompil/qmlAstCons.mli
  7. +0 −1  libqmlcompil/qmlAstUtils.ml
  8. +2 −14 libqmlcompil/qmlPatternAnalysis.ml
  9. +0 −1  libqmlcompil/qmlPrint.ml
  10. +0 −2  libqmlcompil/typer_w/w_CoreTypes.ml
  11. +0 −1  libqmlcompil/typer_w/w_CoreTypes.mli
  12. +0 −1  libqmlcompil/typer_w/w_Infer.ml
  13. +0 −1  libqmlcompil/typer_w/w_PublicExport.ml
  14. +0 −1  libqmlcompil/typer_w/w_TypingEnv.ml
  15. +0 −1  ocamllang/ocaml.ml
  16. +0 −1  ocamllang/ocamlPrint.ml
  17. +1 −2  ocamllang/ocaml_types.trx
  18. +0 −1  opadoc/common/opaDocXhtml.opa
  19. +0 −1  opadoc/generator/opaApiFile.opa
  20. +1 −3 opalang/opaPrint.ml
  21. +0 −6 opalang/opaToQml.ml
  22. +0 −2  opalang/surfaceAst.ml
  23. +0 −3  opalang/surfaceAstCons.ml
  24. +0 −3  opalang/surfaceAstConsSig.ml
  25. +0 −7 opalang/surfaceAstHelper.ml
  26. +0 −2  opalang/syntax/opa_parser.trx
  27. +0 −3  opalang/syntax/parser_utils.ml
  28. +0 −2  opalang/syntax/parser_utils.mli
  29. +0 −3  opatop/opaTopValue.ml
  30. +0 −1  opatop/opaTopValue.mli
  31. +0 −6 opatop/serverLib.ml
  32. +0 −15 protocols/mlidl.ml
  33. +0 −1  protocols/tools.ml
  34. +0 −5 protocols/wsdl2ml.ml
  35. +0 −1  qmlflat/flat/flat_Common.ml
  36. +0 −1  qmlflat/flat/flat_MatchGeneration.ml
  37. +0 −3  qmlflat/serverLib.ml
  38. +0 −2  qmljsimp/imp_Bsl.ml
  39. +1 −3 qmljsimp/imp_Common.ml
  40. +0 −2  qmlpasses/pass_ExplicitInstantiation.ml
View
4 libbase/bslServerLib.ml
@@ -270,16 +270,12 @@ module type S = sig
*)
(** *)
- type ty_char
type ty_float
type ty_int
type ty_null
type ty_string
(** *)
- val wrap_char : char -> ty_char
- val unwrap_char : ty_char -> char
-
val wrap_float : float -> ty_float
val unwrap_float : ty_float -> float
View
5 libbsl/bslRegisterParser.trx
@@ -379,14 +379,11 @@ b_BASE <-
/ b_External
/ "(" spacing b_ENTRY spacing ")" {{ __3 }}
-b_Const <- (CintError / Cint / Cfloat / Cstring / Cchar ) {{ B.Const (pos(), __1) }}
+b_Const <- (Cint / Cfloat / Cstring) {{ B.Const (pos(), __1) }}
-CintError <- "int64" ![a-zA-Z]
- {{ error "@{<bright>int64@} are not supported for external primitives,@ use an @{<bright>int@} or use an @{<bright>external type@}@\n" }}
Cint <- "int" ![a-zA-Z] {{ Q.TyInt }}
Cfloat <- "float" ![a-zA-Z] {{ Q.TyFloat }}
Cstring <- "string" ![a-zA-Z] {{ Q.TyString }}
-Cchar <- "char" ![a-zA-Z] {{ Q.TyChar }}
b_TypeVar <-
/ "'" name
View
1  libbsl/bslTypesGeneration.ml
@@ -154,7 +154,6 @@ struct
match t with
| B.Const (_, c) -> (
match c with
- | Q.TyChar -> serverlib fmt opa_char
| Q.TyFloat -> serverlib fmt opa_float
| Q.TyInt -> serverlib fmt opa_int
| Q.TyNull -> serverlib fmt opa_null
View
7 libqmlcompil/qmlAst.ml
@@ -62,7 +62,6 @@ type const_expr =
| Int of int (** simplify the life in opa / ml code generator *)
| Float of float
| String of string
- | Char of char
(**
The type of a simple value.
@@ -70,7 +69,6 @@ type const_expr =
*)
type const_ty =
- | TyChar
| TyFloat
| TyInt
| TyNull (** empty type: nothing should really have this type *)
@@ -84,14 +82,12 @@ struct
| Int _ -> TyInt
| Float _ -> TyFloat
| String _ -> TyString
- | Char _ -> TyChar
(** Return a human-readable version of a simple value.*)
let string_of_expr = function
| Int i -> string_of_int i
| Float f -> string_of_float f
| String s -> Printf.sprintf "%S" s
- | Char c -> Printf.sprintf "%C" c
let pp_expr fmt expr = Format.pp_print_string fmt (string_of_expr expr)
@@ -101,7 +97,6 @@ struct
(** if we reswitch to Int64.t, to preserve confusion in declaration of type (e.g. by using register directives in libbsl) it is preferable to print int64 instead of int *)
| TyFloat -> "float"
| TyString -> "string"
- | TyChar -> "char"
| TyNull -> "null"
let pp_ty fmt ty = Format.pp_print_string fmt (string_of_ty ty)
@@ -118,7 +113,6 @@ struct
| TyInt -> "long long int"
| TyFloat -> "double"
| TyString -> "char *"
- | TyChar -> "char"
| TyNull -> assert false (* "void *" ?? *)
(** meta : keep it not too far from the definition *)
@@ -126,7 +120,6 @@ struct
| TyInt -> "TyInt"
| TyFloat -> "TyFloat"
| TyString -> "TyString"
- | TyChar -> "TyChar"
| TyNull -> "TyNull"
end
View
2  libqmlcompil/qmlAstCons.ml
@@ -204,7 +204,6 @@ struct
let int i = const (Q.Int i)
let float f = const (Q.Float f)
let string s = const (Q.String s)
- let char c = const (Q.Char c)
let coerce e t = Q.Coerce (Annot.refresh (Q.Label.expr e), e, t)
@@ -960,7 +959,6 @@ struct
let int ?(label=Annot.next_label nopos) i = const ~label (Q.Int i)
let float ?(label=Annot.next_label nopos) f = const ~label (Q.Float f)
let string ?(label=Annot.next_label nopos) s = const ~label (Q.String s)
- let char ?(label=Annot.next_label nopos) c = const ~label (Q.Char c)
let letin ?(label=Annot.next_label nopos) l e = Q.LetIn (label, l, e)
let letrecin ?(label=Annot.next_label nopos) l e = Q.LetRecIn (label, l, e)
View
2  libqmlcompil/qmlAstCons.mli
@@ -139,7 +139,6 @@ sig
val int : int -> QmlAst.expr
val float : float -> QmlAst.expr
val string : string -> QmlAst.expr
- val char : char -> QmlAst.expr
val unit : unit -> QmlAst.expr
val _false: unit -> QmlAst.expr
val _true: unit -> QmlAst.expr
@@ -486,7 +485,6 @@ sig
val int : ?label:Annot.label -> int -> QmlAst.expr
val float : ?label:Annot.label -> float -> QmlAst.expr
val string : ?label:Annot.label -> string -> QmlAst.expr
- val char : ?label:Annot.label -> char -> QmlAst.expr
val directive : ?label:Annot.label -> QmlAst.qml_directive -> QmlAst.expr list -> QmlAst.ty list -> QmlAst.expr
View
1  libqmlcompil/qmlAstUtils.ml
@@ -353,7 +353,6 @@ struct
| Q.Int a, Q.Int b -> Pervasives.compare a b
| Q.Float a, Q.Float b -> Pervasives.compare a b
| Q.String a, Q.String b -> String.compare a b
- | Q.Char a, Q.Char b -> Char.compare a b
| _ -> assert false
let equal a b = compare a b = 0
View
16 libqmlcompil/qmlPatternAnalysis.ml
@@ -1160,11 +1160,7 @@ struct
| Q.Int i, Q.Int i' -> if i+1=i' then [] else [Q.Int( i+1 )]
| Q.Float f, Q.Float f' -> let f'' = (f+.f')/.2.0 in if f<f'' && f''< f' then [Q.Float f''] else []
| Q.String s, Q.String s' -> [Q.String (s^"_"^s')]
- | Q.Char c, Q.Char c' ->
- let c = Char.code c in
- let c' = Char.code c' in
- if c+1=c' then [] else [Q.Char( Char.chr (c+1))]
- | Q.Char _, _ | Q.String _ , _ | Q.Int _ , _ | Q.Float _,_ -> assert false
+ | Q.String _ , _ | Q.Int _ , _ | Q.Float _,_ -> assert false
in
let outside first last = match first,last with
| Q.Int i, Q.Int i' ->
@@ -1178,15 +1174,7 @@ struct
else [Q.Float (f +. 1.0)]
else [Q.Float (f' -. 1.0)]
| Q.String _, Q.String s' -> [ Q.String (s'^", me and many many others") ]
- | Q.Char c, Q.Char c' ->
- let c = Char.code c in
- let c' = Char.code c' in
- if c = 0 then
- if c' = 255 then []
- else [Q.Char (Char.chr (c'+1))]
- else [Q.Char (Char.chr (c'-1))]
- | Q.Char _, _ | Q.String _ , _ | Q.Int _ , _ | Q.Float _,_ -> assert false
- in
+ | Q.String _ , _ | Q.Int _ , _ | Q.Float _,_ -> assert false in
let first = List.hd l in
let rec aux last l =
match last,l with
View
1  libqmlcompil/qmlPrint.ml
@@ -804,7 +804,6 @@ let sexp_tyv f t = Format.pp_print_string f (QmlTypeVars.TypeVar.to_string t)
let sexp_rowv f t = Format.pp_print_string f (QmlTypeVars.RowVar.to_string t)
let sexp_colv f t = Format.pp_print_string f (QmlTypeVars.ColVar.to_string t)
let rec sexp_ty f = function
- | Q.TypeConst Q.TyChar -> Format.fprintf f "C"
| Q.TypeConst Q.TyFloat -> Format.fprintf f "F"
| Q.TypeConst Q.TyInt -> Format.fprintf f "I"
| Q.TypeConst Q.TyNull -> Format.fprintf f "Null"
View
2  libqmlcompil/typer_w/w_CoreTypes.ml
@@ -446,8 +446,6 @@ let type_float () = type_named (QmlAst.TypeIdent.of_string Opacapi.Types.float)
let type_string () = type_named (QmlAst.TypeIdent.of_string Opacapi.Types.string) [] None
-let type_char () = type_named (QmlAst.TypeIdent.of_string Opacapi.Types.char) [] None
-
(* ************************************************************************** *)
View
1  libqmlcompil/typer_w/w_CoreTypes.mli
@@ -70,7 +70,6 @@ val type_int: unit -> W_Algebra.simple_type
val type_bool: unit -> W_Algebra.simple_type
val type_float: unit -> W_Algebra.simple_type
val type_string: unit -> W_Algebra.simple_type
-val type_char: unit -> W_Algebra.simple_type
val type_arrow:
W_Algebra.simple_type list -> W_Algebra.simple_type -> W_Algebra.simple_type
val type_closed_record:
View
1  libqmlcompil/typer_w/w_Infer.ml
@@ -29,7 +29,6 @@ let infer_constant_type = function
| QmlAst.Int _ -> W_CoreTypes.type_int ()
| QmlAst.Float _ -> W_CoreTypes.type_float ()
| QmlAst.String _ -> W_CoreTypes.type_string ()
- | QmlAst.Char _ -> W_CoreTypes.type_char ()
View
1  libqmlcompil/typer_w/w_PublicExport.ml
@@ -102,7 +102,6 @@ let simple_type_to_qml_type initial_ty =
| "int" -> QmlAst.TypeConst QmlAst.TyInt
| "float" -> QmlAst.TypeConst QmlAst.TyFloat
| "string" -> QmlAst.TypeConst QmlAst.TyString
- | "char" -> QmlAst.TypeConst QmlAst.TyChar
| _ ->
(* The general and default case. Attention, ni QML we
never export the unwounded representation of the type,
View
1  libqmlcompil/typer_w/w_TypingEnv.ml
@@ -299,7 +299,6 @@ let qml_type_to_simple_type qml_tydef_env initial_qml_ty ~is_type_annotation =
match qml_ty with
| QmlAst.TypeConst const_ty -> (
match const_ty with
- | QmlAst.TyChar -> W_CoreTypes.type_char ()
| QmlAst.TyFloat -> W_CoreTypes.type_float ()
| QmlAst.TyInt -> W_CoreTypes.type_int ()
| QmlAst.TyString -> W_CoreTypes.type_string ()
View
1  ocamllang/ocaml.ml
@@ -43,7 +43,6 @@ type const_type_expr =
| TypeInt64
| TypeFloat
| TypeBool
- | TypeChar
| TypeUnit
(* Module.Module.name *)
View
1  ocamllang/ocamlPrint.ml
@@ -116,7 +116,6 @@ struct
| TypeInt64 -> output_string oc "int64"
| TypeFloat -> output_string oc "float"
| TypeBool -> output_string oc "bool"
- | TypeChar -> output_string oc "char"
| TypeUnit -> output_string oc "unit"
let type_name oc = output_concat_map oc "." output_string
View
3  ocamllang/ocaml_types.trx
@@ -19,13 +19,12 @@ read default.trx global (spacing)
spacing <- (Default.space $ / Default.mlcomment)* $
read ocaml_keywords.trx
-typeconst <- (IntT / Int64T / FloatT / StringT / UnitT / CharT / BoolT) {{ TypeConst __1 }}
+typeconst <- (IntT / Int64T / FloatT / StringT / UnitT / BoolT) {{ TypeConst __1 }}
IntT <- "int" {{ TypeInt }}
Int64T <- "int64" {{ TypeInt64 }}
FloatT <- "float" {{ TypeFloat }}
StringT <- "string" {{ TypeString }}
UnitT <- "unit" {{ TypeUnit }}
-CharT <- "char" {{ TypeChar }}
BoolT <- "bool" {{ TypeBool }}
typeIdent_cont <- [a-zA-Z0-9_]
View
1  opadoc/common/opaDocXhtml.opa
@@ -137,7 +137,6 @@ OpaDocXhtml = {{
else id
rec aux_ty_const(ty_const) =
match ty_const with
- | {TyChar} -> <>char</>
| {TyInt} -> <>int</>
| {TyFloat} -> <>float</>
| {TyString} -> <>string</>
View
1  opadoc/generator/opaApiFile.opa
@@ -65,7 +65,6 @@ OpaApiFile = {{
end
rec aux_ty_const(table, ty_const) =
match ty_const with
- | {TyChar} -> associate_id_val("char", val, table)
| {TyInt} -> associate_id_val("int", val, table)
| {TyFloat} -> associate_id_val("float", val, table)
| {TyString} -> associate_id_val("string", val, table)
View
4 opalang/opaPrint.ml
@@ -40,7 +40,7 @@ let keyword = function
| "match" | "with" | "type" | "do" | "if" | "then" | "else" | "as" | "_" -> true
| _ -> false
let basic_type = function
- | "int" | "char" | "string" | "float" -> true
+ | "int" | "string" | "float" -> true
| _ -> false
let operator_regexp = Str.regexp "[-.+\\^*/<>=@|&!]+"
let classify_string s =
@@ -183,7 +183,6 @@ object (self)
| CInt i -> Format.pp_print_string f (Big_int.string_of_big_int i)
| CFloat float -> Format.pp_print_float f float
| CString s -> pp f "\"%s\"" (QmlPrint.escaped_string s)
- | CChar int -> try pp f "%C" (Char.chr int) with Invalid_argument _ -> pp f "'\\u%#x'" int
method field f s =
Format.pp_print_string f (
@@ -217,7 +216,6 @@ object (self)
| TyInt -> "int"
| TyFloat -> "float"
| TyString -> "string"
- | TyChar -> "char"
)
method rowvar f _ = Format.pp_print_string f "..."
method colvar f _ = Format.pp_print_string f "..."
View
6 opalang/opaToQml.ml
@@ -238,7 +238,6 @@ struct
| SA.TyInt -> QA.TyInt
| SA.TyFloat -> QA.TyFloat
| SA.TyString -> QA.TyString
- | SA.TyChar -> QA.TyChar
and ty x = ty_node (fst x)
and ty_node = function
@@ -351,11 +350,6 @@ struct
Pervasives.max_int)
| SA.CFloat f -> QA.Float f
| SA.CString s -> QA.String s
- | SA.CChar i ->
- try QA.Char (Char.chr i)
- with Invalid_argument "Char.chr" ->
- let context = OpaError.Context.annot opa_annot in
- OpaError.error context "Character %d is not representable@." i
let ident = Arg.exprident
View
2  opalang/surfaceAst.ml
@@ -77,7 +77,6 @@ type const_expr_node =
| CFloat of float
(* | CFixed of fixed*)(**This is actually a user-level data structure.*)
| CString of string (**A UTF-8 encoded string.*)
- | CChar of int (**A unicode character, represented by its number.*)
and const_expr = const_expr_node label (* cf libqmlcompil/qmlLoc.ml *)
@@ -202,7 +201,6 @@ and const_ty_node =
| TyInt
| TyFloat
| TyString
- | TyChar
and 'ident rowvar = Rowvar of 'ident
and 'ident colvar = Colvar of 'ident
View
3  opalang/surfaceAstCons.ml
@@ -150,7 +150,6 @@ struct
let string ?(label=w()) () = (TypeConst TyString, c label)
let int ?(label=w()) () = (TypeConst TyInt, c label)
let float ?(label=w()) () = (TypeConst TyFloat, c label)
- let char ?(label=w()) () = (TypeConst TyChar, c label)
let bool ?label () = name ?label Opacapi.Types.bool
end
@@ -207,8 +206,6 @@ struct
let big_int ?label i = constant ?label (CInt i)
let int ?label i = big_int ?label (Big_int.big_int_of_int i)
let bool ?label b = if b then true_ ?label () else false_ ?label ()
- let unicode_char ?label code = constant ?label (CChar code)
- let char ?label c = unicode_char ?label (Char.code c)
let ident ?(label=w()) i = (Ident i, c label)
let var = ident
View
3  opalang/surfaceAstConsSig.ml
@@ -65,7 +65,6 @@ sig
val string : ?label:annot -> unit -> ident ty
val int : ?label:annot -> unit -> ident ty
val float : ?label:annot -> unit -> ident ty
- val char : ?label:annot -> unit -> ident ty
val bool : ?label:annot -> unit -> ident ty
end
@@ -118,8 +117,6 @@ sig
val float : ?label:annot -> float -> (ident, _) expr
val big_int : ?label:annot -> Big_int.big_int -> (ident, _) expr
val int : ?label:annot -> int -> (ident, _) expr
- val unicode_char : ?label:annot -> int -> (ident, _) expr
- val char : ?label:annot -> char -> (ident, _) expr
val ident : ?label:annot -> ident -> (ident, _) expr
val var : ?label:annot -> ident -> (ident, _) expr
View
7 opalang/surfaceAstHelper.ml
@@ -291,12 +291,6 @@ struct
| (Const (CString s), _) -> Some s
| _ -> None
let get_string x = exn_of_opt Exit get_string_opt x
-
- let get_char_opt e =
- match Coerce.remove e with
- | (Const (CChar c), _) -> Some c
- | _ -> None
- let get_char x = exn_of_opt Exit get_char_opt x
end
module Datatype =
@@ -376,7 +370,6 @@ struct
| CInt _ -> TyInt
| CFloat _ -> TyFloat
| CString _ -> TyString
- | CChar _ -> TyChar
let type_of x = type_of_node (fst x)
end
View
2  opalang/syntax/opa_parser.trx
@@ -1003,7 +1003,6 @@ opa_in_braces <- lbrace expr:e rbrace {{ e }}
const <- float:f {{ CFloat f }}
/ int:i {{ CInt (Big_int.big_int_of_int i) }}
/ string:s {{ CString s }}
- / char:c {{ CChar c}}
(**
{6 Types}
@@ -1018,7 +1017,6 @@ type_const = deco just_type_const;
just_type_const <- (=exact_ident("int")) {{TypeConst TyInt}}
/ (=exact_ident("float")) {{TypeConst TyFloat}}
/ (=exact_ident("string")) {{TypeConst TyString}}
- / (=exact_ident("char")) {{TypeConst TyChar}}
(**
{7 Type variables}
View
3  opalang/syntax/parser_utils.ml
@@ -97,7 +97,6 @@ let const_ty_to_string = function
| TyInt -> Opacapi.Types.int
| TyFloat -> Opacapi.Types.float
| TyString -> Opacapi.Types.string
- | TyChar -> Opacapi.Types.char
end
| _ -> assert false
let isolate s = sprintf "`%s'" s
@@ -401,7 +400,6 @@ let type_const t label = (TypeConst t, copy_label label)
let tyint label = type_const TyInt label
let tyfloat label = type_const TyFloat label
let tystring label = type_const TyString label
-let tychar label = type_const TyChar label
let tyvoid_ = TypeRecord (TyRow ([], None))
let tyvoid label = (tyvoid_, copy_label label)
@@ -470,7 +468,6 @@ let int = cur2 int2
let floatint2 (i,label) = float2 (float_of_int i, label)
let intfloat2 (f,label) = int2 (int_of_float f, label)
let bool b label = if b then true_ label else false_ label
-let char c label = (Const (CChar (Char.code c)), copy_label label)
(*
* More Utils on directives
View
2  opalang/syntax/parser_utils.mli
@@ -161,7 +161,6 @@ val int : int -> annot -> ('a, 'b) expr
val floatint2 : int * annot -> ('a, 'b) expr
val intfloat2 : float * annot -> ('a, 'b) expr
val bool : bool -> annot -> ('a, 'b) coerced_expr
-val char : char -> annot -> ('a, 'b) expr
(** Lambda, application *)
@@ -294,7 +293,6 @@ val type_const : const_ty_node -> annot -> 'a ty
val tyint : annot -> 'a ty
val tyfloat : annot -> 'a ty
val tystring : annot -> 'a ty
-val tychar : annot -> 'a ty
val tyvoid_ : 'a ty_node
val tyvoid : annot -> 'a ty
View
3  opatop/opaTopValue.ml
@@ -208,7 +208,6 @@ struct
let t_int ?(pos=nopos) i = V_const (pos, Q.Int i)
let t_float ?(pos=nopos) f = V_const (pos, Q.Float f)
let t_string ?(pos=nopos) s = V_const (pos, Q.String s)
- let t_char ?(pos=nopos) c = V_const (pos, Q.Char c)
let t_void ?(pos=nopos) () = V_record (pos, StringMap.empty, ref None)
let t_int64 ?(pos=nopos) i = V_const (pos, Q.Int (Int64.to_int i))
@@ -243,7 +242,6 @@ struct
| B.Const (pos, Q.TyInt) -> t_int ~pos (Obj.magic x)
| B.Const (pos, Q.TyFloat) -> t_float ~pos (Obj.magic x)
| B.Const (pos, Q.TyString) -> t_string ~pos (Obj.magic x)
- | B.Const (pos, Q.TyChar) -> t_char ~pos (Obj.magic x)
| B.Const (pos, Q.TyNull) -> t_null ~pos ()
(* If a type is still an alpha, that means that it is a opa-value represented by itself *)
@@ -294,7 +292,6 @@ struct
| B.Const (_, Q.TyInt) , V_const (_, Q.Int i) -> Obj.magic i
| B.Const (_, Q.TyFloat) , V_const (_, Q.Float f) -> Obj.magic f
| B.Const (_, Q.TyString) , V_const (_, Q.String s) -> Obj.magic s
- | B.Const (_, Q.TyChar) , V_const (_, Q.Char c) -> Obj.magic c
| B.Const (_, Q.TyNull) , _ -> Obj.magic 0
| B.Void _, V_record (_, m, r) when StringMap.is_empty m && !r = None -> Obj.magic ()
View
1  opatop/opaTopValue.mli
@@ -158,7 +158,6 @@ sig
val t_int : ?pos:pos -> int -> t
val t_float : ?pos:pos -> float -> t
val t_string : ?pos:pos -> string -> t
- val t_char : ?pos:pos -> char -> t
val t_int64 : ?pos:pos -> Int64.t -> t
val t_void : ?pos:pos -> unit -> t
View
6 opatop/serverLib.ml
@@ -230,12 +230,6 @@ type ty_int = V.t
type ty_null = V.t
type ty_string = V.t
-let wrap_char c = V.Proj.t_char c
-let unwrap_char = function
- | V.V_const (_, Q.Char c) -> c
- | t ->
- fail t "SL.unwrap_char, expecting a char@\n"
-
let wrap_float c = V.Proj.t_float c
let unwrap_float = function
| V.V_const (_, Q.Float f) -> f
View
15 protocols/mlidl.ml
@@ -286,7 +286,6 @@ let type_ocaml_cte = function
| O.TypeInt64 -> "int64"
| O.TypeFloat -> "float"
| O.TypeBool -> "bool"
- | O.TypeChar -> "char"
| O.TypeUnit -> "unit"
let rec type_ocaml_te tyns = function
@@ -336,7 +335,6 @@ let type_opa_cte = function
| O.TypeInt64 -> "int64"
| O.TypeFloat -> "float"
| O.TypeBool -> "bool"
- | O.TypeChar -> "char"
| O.TypeUnit -> "void"
let rec type_opa_te tyns = function
@@ -392,7 +390,6 @@ let opa_arg_type_cte = function
| O.TypeInt64 -> "opa[int]"
| O.TypeFloat -> "opa[float]"
| O.TypeBool -> "opa[bool]"
- | O.TypeChar -> "opa[char]"
| O.TypeUnit -> "opa[void]"
let rec opa_arg_type_te name = function
@@ -409,7 +406,6 @@ let type_sl_cte = function
| O.TypeInt64 -> "ServerLib.ty_int"
| O.TypeFloat -> "ServerLib.ty_float"
| O.TypeBool -> "ServerLib.ty_bool"
- | O.TypeChar -> "ServerLib.ty_char"
| O.TypeUnit -> "ServerLib.ty_void"
let rec type_sl_te tyns withmod = function
@@ -490,7 +486,6 @@ and enc = {
int64_to_string : string*string;
float_to_string : string*string;
bool_to_string : string*string;
- char_to_string : string*string;
unit_to_string : string*string;
option_pre : string; option_post : string;
list_pre : string; list_post : string;
@@ -680,7 +675,6 @@ let abs_output_cte enc o t = function
| O.TypeInt64 -> enc.lang.output_v enc (fst enc.enc.int64_to_string) o t (snd enc.enc.int64_to_string)
| O.TypeFloat -> enc.lang.output_v enc (fst enc.enc.float_to_string) o t (snd enc.enc.float_to_string)
| O.TypeBool -> enc.lang.output_v enc (fst enc.enc.bool_to_string) o t (snd enc.enc.bool_to_string)
- | O.TypeChar -> enc.lang.output_v enc (fst enc.enc.char_to_string) o t (snd enc.enc.char_to_string)
| O.TypeUnit -> enc.lang.output_v enc (fst enc.enc.unit_to_string) o t (snd enc.enc.unit_to_string)
let rec abs_output_te enc o t tyns = function
@@ -785,7 +779,6 @@ let abs_input2_cte enc = function
| O.TypeInt64 -> enc.prs.input_v enc enc.prs.int64_pat
| O.TypeFloat -> enc.prs.input_v enc enc.prs.float_pat
| O.TypeBool -> enc.prs.input_v enc enc.prs.bool_pat
- | O.TypeChar -> enc.prs.input_v enc enc.prs.char_pat
| O.TypeUnit -> enc.prs.input_v enc enc.prs.unit_pat
let input_fix enc str success =
@@ -1105,7 +1098,6 @@ let abs_input_cte enc = function
| O.TypeInt64 -> enc.prs.input_v enc enc.prs.int64_pat
| O.TypeFloat -> enc.prs.input_v enc enc.prs.float_pat
| O.TypeBool -> enc.prs.input_v enc enc.prs.bool_pat
- | O.TypeChar -> enc.prs.input_v enc enc.prs.char_pat
| O.TypeUnit -> enc.prs.input_v enc enc.prs.unit_pat
let rec abs_input_te enc tyns = function
@@ -1237,7 +1229,6 @@ let opa_enc1 = {
int64_to_string = "__i64", "Int.to_string";
float_to_string = "__f", "Float.to_string";
bool_to_string = "__b", "Bool.to_string";
- char_to_string = "__c", "Char.to_string";
unit_to_string = "__u", "(_ -> \"()\")";
list_pre = "\\{List=["; list_post = "]\\}"; lst_pre = "("; lst_sep1 = ";"; lst_sep2 = ""; lst_post = ")";
tuple_pre = (fun _ -> "\\{Tuple=["); tuple_post = "]\\}"; tup_pre = "("; tup_sep1 = ","; tup_sep2 = ","; tup_post = ")";
@@ -1383,7 +1374,6 @@ let ocaml_enc1 = {
int64_to_string = "__i64", "Int64.to_string";
float_to_string = "__f", "string_of_float";
bool_to_string = "__b", "string_of_bool";
- char_to_string = "__c", "(fun c -> String.make 1 c)";
unit_to_string = "__u", "(fun () -> \"()\")";
list_pre = "{List=["; list_post = "]}";
lst_pre = "("; lst_sep1 = ";"; lst_sep2 = ""; lst_post = ")";
@@ -1507,7 +1497,6 @@ let opa_tojson_encoding = {
int64_to_string = "__i64", "Int";
float_to_string = "__f", "Float";
bool_to_string = "__b", "Bool";
- char_to_string = "__c", "Char";
unit_to_string = "", "{Void}";
tuple_pre = (fun _ -> "{Record=["); tuple_post = "]}";
tup_pre = "("; tup_sep1 = ","; tup_sep2 = ","; tup_post = ")"; make_tup = (fun s -> "\""^s^"\"");
@@ -1541,7 +1530,6 @@ let opa_tojson_ll_encoding = {
int64_to_string = "__i64", "to_int";
float_to_string = "__f", "to_float";
bool_to_string = "__b", "to_bool";
- char_to_string = "__c", "(c -> String (String.make 1 c))";
unit_to_string = "", "to_void()";
tuple_pre = (fun _ -> "opar2mlr(["); tuple_post = "])";
tup_pre = "("; tup_sep1 = ","; tup_sep2 = ","; tup_post = ")"; make_tup = (fun s -> "\""^s^"\"");
@@ -1575,7 +1563,6 @@ let ocaml_tojson_encoding = {
int64_to_string = "__i64", "JsonTypes.Int";
float_to_string = "__f", "JsonTypes.Float";
bool_to_string = "__b", "JsonTypes.Bool";
- char_to_string = "__c", "(fun c -> JsonTypes.String (String.make 1 c))";
unit_to_string = "__u", "(fun () -> JsonTypes.Void)";
tuple_pre = (fun _ -> "JsonTypes.Record ["); tuple_post = "]";
tup_pre = "("; tup_sep1 = ", "; tup_sep2 = "; "; tup_post = ")"; make_tup = (fun s -> "\""^s^"\"");
@@ -1615,7 +1602,6 @@ let ocaml_wrap_encoding () = {
int64_to_string = "__i64", "ServerLib.wrap_int";
float_to_string = "__f", "ServerLib.wrap_float";
bool_to_string = "__b", "ServerLib.wrap_bool";
- char_to_string = "__c", "ServerLib.wrap_char";
unit_to_string = "__u", "wrap_unit";
record_pre = (fun _ -> "wrap_rcrd ["); record_post = "]";
tuple_pre = (fun i -> sprintf "wrap_tuple%d(" i); tuple_post = ")";
@@ -1658,7 +1644,6 @@ let ocaml_unwrap_encoding () = {
int64_to_string = "__i64", "ServerLib.unwrap_int";
float_to_string = "__f", "ServerLib.unwrap_float";
bool_to_string = "__b", "ServerLib.unwrap_bool";
- char_to_string = "__c", "ServerLib.unwrap_char";
unit_to_string = "__u", "unwrap_unit";
tuple_pre = (fun _ -> "("); tuple_post = ")";
tup_pre = ""; tup_sep1 = ""; tup_sep2 = ", "; tup_post = ""; make_tup = (fun s -> "");
View
1  protocols/tools.ml
@@ -35,7 +35,6 @@ let consttype_to_string = function
| O.TypeBool -> "bool"
| O.TypeInt64 -> "int64"
| O.TypeInt -> "int"
- | O.TypeChar -> "char"
| O.TypeFloat -> "float"
| O.TypeUnit -> "unit"
| _ -> "string"
View
5 protocols/wsdl2ml.ml
@@ -658,7 +658,6 @@ let make_type_const pname ai te =
| O.TypeConst O.TypeInt64 -> "i64",1
| O.TypeConst O.TypeFloat -> "f",1
| O.TypeConst O.TypeBool -> "b",1
- | O.TypeConst O.TypeChar -> "c",1
| O.TypeConst O.TypeUnit -> "()",0
| O.TypeName ([], ["int"]) -> "i",1
| O.TypeName ([], ["WC";"t_dateTime"]) -> "dT",1
@@ -833,7 +832,6 @@ let make_string_const ai cte =
| O.TypeInt64 -> "Int64.to_string","i64",1
| O.TypeFloat -> "string_of_float","f",1
| O.TypeBool -> "string_of_bool","b",1
- | O.TypeChar -> "(String.make 1)","c",1
| O.TypeUnit -> "","()",0
in
let arg = cname^(if cnt > 0 then string_of_int ai else "") in
@@ -890,7 +888,6 @@ let ph_type_const pname ai te =
| O.TypeConst O.TypeInt64 -> "Int64.to_string","i64","",1
| O.TypeConst O.TypeFloat -> "string_of_float","f","",1
| O.TypeConst O.TypeBool -> "string_of_bool","b","",1
- | O.TypeConst O.TypeChar -> "(String.make 1)","c","",1
| O.TypeConst O.TypeUnit -> "","()","",0
| O.TypeName ([], ["int"]) -> "string_of_int","i","",1
| O.TypeName ([], ["WC";"t_dateTime"]) -> "WC.string_of_dateTime","dT","",1
@@ -1036,7 +1033,6 @@ let make_toxml_const ai cte =
| O.TypeInt64 -> "Int64.to_string","i64",1
| O.TypeFloat -> "string_of_float","f",1
| O.TypeBool -> "string_of_bool","b",1
- | O.TypeChar -> "(String.make 1)","c",1
| O.TypeUnit -> "","()",0
in
let arg = cname^(if cnt > 0 then string_of_int ai else "") in
@@ -1234,7 +1230,6 @@ let make_fromxml_const ai cte =
| O.TypeInt64 -> "WC.fx \"int64\" Int64.of_string","i64",1
| O.TypeFloat -> "WC.fx \"float\" float_of_string","f",1
| O.TypeBool -> "WC.fx \"bool\" bool_of_string","b",1
- | O.TypeChar -> "(fun str -> str.[0])","c",1
| O.TypeUnit -> "(fun u -> u)","()",0
in
let arg = cname^(if cnt > 0 then string_of_int ai else "") in
View
1  qmlflat/flat/flat_Common.ml
@@ -104,7 +104,6 @@ struct
| Q.Int i -> Ocaml.Int i
| Q.Float f -> Ocaml.Float f
| Q.String s -> Ocaml.String s
- | Q.Char c -> Ocaml.Char c
(*
Ident are now shared between ocamlAst and QmlAst
View
1  qmlflat/flat/flat_MatchGeneration.ml
@@ -249,7 +249,6 @@ struct
| Q.Int i -> Ocaml.Cons.pat_int i
| Q.Float i -> Ocaml.Cons.pat_float i
| Q.String i -> Ocaml.Cons.pat_string i
- | Q.Char i -> Ocaml.Cons.pat_char i
)
| T_PatVar (_, ident) ->
View
3  qmlflat/serverLib.ml
@@ -211,9 +211,6 @@ type ty_int = int
type ty_null = unit
type ty_string = string
-external wrap_char : char -> ty_char = "%identity"
-external unwrap_char : ty_char -> char = "%identity"
-
external wrap_float : float -> ty_float = "%identity"
external unwrap_float : ty_float -> float = "%identity"
View
2  qmljsimp/imp_Bsl.ml
@@ -177,7 +177,6 @@ struct
if env.options.Qml2jsOptions.check_bsl_types then
let typer =
match c with
- | QmlAst.TyChar -> Imp_Common.ClientLib.type_char
| QmlAst.TyFloat -> Imp_Common.ClientLib.type_float
| QmlAst.TyInt -> Imp_Common.ClientLib.type_int
| QmlAst.TyNull -> assert false
@@ -217,7 +216,6 @@ struct
match t with
| B.Const (_, c) -> (
match c with
- | QmlAst.TyChar -> Imp_Common.ClientLib.type_char
| QmlAst.TyFloat -> Imp_Common.ClientLib.type_float
| QmlAst.TyInt -> Imp_Common.ClientLib.type_int
| QmlAst.TyNull -> assert false
View
4 qmljsimp/imp_Common.ml
@@ -199,7 +199,7 @@ let maybe_js_false gamma ty =
| Q.TypeConst ct -> (
(* In fact, all basic types are "dangerous". *)
match ct with
- | Q.TyChar | Q.TyFloat | Q.TyInt | Q.TyString -> true
+ | Q.TyFloat | Q.TyInt | Q.TyString -> true
| Q.TyNull -> assert false
)
| Q.TypeSumSugar _ ->
@@ -230,5 +230,3 @@ let const const =
JsCons.Expr.float f
| Q.String s ->
JsCons.Expr.string s
- | Q.Char c ->
- JsCons.Expr.string (String.make 1 c)
View
2  qmlpasses/pass_ExplicitInstantiation.ml
@@ -396,7 +396,6 @@ let rep_of_unit_field annotmap gamma name =
(** Construct an expression that represents type of simple value. This
expression is typed by OpaType.ty_const. *)
let rep_of_const_ty annotmap gamma = function
- | Q.TyChar -> rep_of_unit_field annotmap gamma "TyChar"
| Q.TyFloat -> rep_of_unit_field annotmap gamma "TyFloat"
| Q.TyInt -> rep_of_unit_field annotmap gamma "TyInt"
| Q.TyString -> rep_of_unit_field annotmap gamma "TyString"
@@ -499,7 +498,6 @@ object (self)
method const_ty annotmap ty =
let annotmap, e =
match ty with
- | Q.TyChar -> rep_of_unit_field annotmap env.gamma "TyChar"
| Q.TyFloat -> rep_of_unit_field annotmap env.gamma "TyFloat"
| Q.TyInt -> rep_of_unit_field annotmap env.gamma "TyInt"
| Q.TyString -> rep_of_unit_field annotmap env.gamma "TyString"
Please sign in to comment.
Something went wrong with that request. Please try again.