Displaying 15 results from an estimated 15 matches for "split_on_char".
2019 Jun 27
0
[PATCH 5/9] Rust bindings: Add generator of structs for optional arguments
...rust.ml
@@ -29,10 +29,32 @@ open Structs
open C
open Events
+(* Utilities for Rust *)
+(* Are there corresponding functions to them? *)
+(* Should they be placed in utils.ml? *)
let rec indent n = match n with
| x when x > 0 -> pr " "; indent (x - 1)
| _ -> ()
+(* split_on_char exists since OCaml 4.04 *)
+(* but current requirements: >=4.01 *)
+let split_on_char c = Str.split (Str.regexp (String.make 1 c))
+
+let snake2caml name =
+ let l = split_on_char '_' name in
+ let l = List.map (fun x -> String.capitalize_ascii x) l in
+ String.concat ""...
2019 Jul 29
0
Re: [PATCH] Rust bindings: Add Rust bindings
...t n = match n with
> > + | x when x > 0 -> pr " "; indent (x - 1)
> > + | _ -> ()
>
> A small nit here:
>
> let rec indent = function
> | x when x > 0 -> pr " "; indent (x - 1)
> | _ -> ()
>
> > +
> > +(* split_on_char exists since OCaml 4.04 *)
> > +(* but current requirements: >=4.01 *)
> > +let split_on_char c = Str.split (Str.regexp (String.make 1 c))
>
> The generator uses the internal mlstdutils shared code, see
> common/mlstdutils. One of the things provided are extra functions for...
2019 Jul 17
0
Re: [PATCH] Rust bindings: Add Rust bindings
...;+open C
>+open Events
>+
>+(* Utilities for Rust *)
>+(* Are there corresponding functions to them? *)
>+(* Should they be placed in utils.ml? *)
>+let rec indent n = match n with
>+ | x when x > 0 -> pr " "; indent (x - 1)
>+ | _ -> ()
>+
>+(* split_on_char exists since OCaml 4.04 *)
>+(* but current requirements: >=4.01 *)
>+let split_on_char c = Str.split (Str.regexp (String.make 1 c))
>+
>+let snake2caml name =
>+ let l = split_on_char '_' name in
>+ let l = List.map (fun x -> String.capitalize_ascii x) l in
>+...
2019 Jul 17
2
[PATCH] Rust bindings: Add Rust bindings
...en Optgroups
+open Actions
+open Structs
+open C
+open Events
+
+(* Utilities for Rust *)
+(* Are there corresponding functions to them? *)
+(* Should they be placed in utils.ml? *)
+let rec indent n = match n with
+ | x when x > 0 -> pr " "; indent (x - 1)
+ | _ -> ()
+
+(* split_on_char exists since OCaml 4.04 *)
+(* but current requirements: >=4.01 *)
+let split_on_char c = Str.split (Str.regexp (String.make 1 c))
+
+let snake2caml name =
+ let l = split_on_char '_' name in
+ let l = List.map (fun x -> String.capitalize_ascii x) l in
+ String.concat ""...
2017 Sep 01
0
[supermin][PATCH] os-release: use ID_LIKE as a fallback for SUSE detection
...lines in
let id = ref "" in
+ let id_like = ref [] in
List.iter (
fun line ->
@@ -65,10 +67,11 @@ and parse () =
else value in
match field with
| "ID" -> id := value
+ | "ID_LIKE" -> id_like := String.split_on_char ' ' value
| _ -> ()
) lines;
- Some { id = !id; }
+ Some { id = !id; id_like = !id_like }
) else
None
@@ -76,3 +79,8 @@ let get_id () =
match get_data () with
| None -> ""
| Some d -> d.id
+
+let get_id_like () =
+ match get_data...
2017 Sep 01
0
[supermin][PATCH v2] os-release: use ID_LIKE as a fallback for SUSE detection
...istros all have in common suse in ID_LIKE field. The ID field
could be varying and is even set to 'Dummy' when building the packages.
If the usual values for openSUSE/SLE can't be found in ID, try with
ID_LIKE.
---
Diff with v1:
* Use Utils.string_split rather than too recent String.split_on_char
src/os_release.ml | 10 +++++++++-
src/os_release.mli | 7 +++++++
src/ph_rpm.ml | 1 +
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/os_release.ml b/src/os_release.ml
index b2de259..abf2bea 100644
--- a/src/os_release.ml
+++ b/src/os_release.ml
@@ -29,6 +29,7 @@ let...
2019 Jul 26
4
Re: [PATCH] Rust bindings: Add Rust bindings
...commit to just move some
code.
> +let rec indent n = match n with
> + | x when x > 0 -> pr " "; indent (x - 1)
> + | _ -> ()
A small nit here:
let rec indent = function
| x when x > 0 -> pr " "; indent (x - 1)
| _ -> ()
> +
> +(* split_on_char exists since OCaml 4.04 *)
> +(* but current requirements: >=4.01 *)
> +let split_on_char c = Str.split (Str.regexp (String.make 1 c))
The generator uses the internal mlstdutils shared code, see
common/mlstdutils. One of the things provided are extra functions for
the String module, and...
2019 Jul 23
2
Re: [PATCH] Rust bindings: Add Rust bindings
...gt; +open Events
> +
> +(* Utilities for Rust *)
> +(* Are there corresponding functions to them? *)
> +(* Should they be placed in utils.ml? *)
> +let rec indent n = match n with
> + | x when x > 0 -> pr " "; indent (x - 1)
> + | _ -> ()
> +
> +(* split_on_char exists since OCaml 4.04 *)
> +(* but current requirements: >=4.01 *)
> +let split_on_char c = Str.split (Str.regexp (String.make 1 c))
> +
> +let snake2caml name =
> + let l = split_on_char '_' name in
> + let l = List.map (fun x -> String.capitalize_ascii x) l in...
2019 Jul 20
2
Re: [PATCH] Rust bindings: Add Rust bindings
...;+(* Utilities for Rust *)
> >+(* Are there corresponding functions to them? *)
> >+(* Should they be placed in utils.ml? *)
> >+let rec indent n = match n with
> >+ | x when x > 0 -> pr " "; indent (x - 1)
> >+ | _ -> ()
> >+
> >+(* split_on_char exists since OCaml 4.04 *)
> >+(* but current requirements: >=4.01 *)
> >+let split_on_char c = Str.split (Str.regexp (String.make 1 c))
> >+
> >+let snake2caml name =
> >+ let l = split_on_char '_' name in
> >+ let l = List.map (fun x -> String.c...
2023 Oct 10
5
[PATCH libnbd 0/4] Miscellaneous Rust cleanups
Add an overview libnbd-rust(3) man page pointing to the real
documentation. This is like OCaml & Golang.
When reviewing the real rustdocs I noticed they basically converted
the man pages into plain text, resulting in lots of problems such as
internal links not working, no `code` annotations, etc. So I wrote a
simple POD to rustdoc translator. It is by no means perfect, but it
fixes many of
2019 Jul 20
0
[PATCH] Rust bindings: Add Rust bindings
...en Optgroups
+open Actions
+open Structs
+open C
+open Events
+
+(* Utilities for Rust *)
+(* Are there corresponding functions to them? *)
+(* Should they be placed in utils.ml? *)
+let rec indent n = match n with
+ | x when x > 0 -> pr " "; indent (x - 1)
+ | _ -> ()
+
+(* split_on_char exists since OCaml 4.04 *)
+(* but current requirements: >=4.01 *)
+let split_on_char c = Str.split (Str.regexp (String.make 1 c))
+
+let snake2caml name =
+ let l = split_on_char '_' name in
+ let l = List.map (fun x -> String.capitalize_ascii x) l in
+ String.concat ""...
2019 Jul 23
0
Re: [PATCH] Rust bindings: Add Rust bindings
...en Optgroups
+open Actions
+open Structs
+open C
+open Events
+
+(* Utilities for Rust *)
+(* Are there corresponding functions to them? *)
+(* Should they be placed in utils.ml? *)
+let rec indent n = match n with
+ | x when x > 0 -> pr " "; indent (x - 1)
+ | _ -> ()
+
+(* split_on_char exists since OCaml 4.04 *)
+(* but current requirements: >=4.01 *)
+let split_on_char c = Str.split (Str.regexp (String.make 1 c))
+
+let snake2caml name =
+ let l = split_on_char '_' name in
+ let l = List.map (fun x -> String.capitalize_ascii x) l in
+ String.concat ""...
2019 Jun 27
16
[PATCH 1/9] Rust bindings: Add Rust bindings
From: Hiroyuki_Katsura <hiroyuki.katsura.0513@gmail.com>
---
Makefile.am | 4 ++++
configure.ac | 3 +++
generator/Makefile.am | 3 +++
generator/bindtests.ml | 3 +++
generator/bindtests.mli | 1 +
generator/main.ml | 5 +++++
generator/rust.ml | 34 ++++++++++++++++++++++++++++++++++
generator/rust.mli | 19 +++++++++++++++++++
2019 Jul 08
2
Re: [PATCH] Add Rust bindings
On Mon, Jul 08, 2019 at 10:04:57AM +0100, Richard W.M. Jones wrote:
>On Mon, Jul 08, 2019 at 10:49:55AM +0200, Martin Kletzander wrote:
>> On Mon, Jul 08, 2019 at 10:10:10AM +0200, Pino Toscano wrote:
>> >On Saturday, 6 July 2019 13:03:24 CEST Martin Kletzander wrote:
>> >>Just one thing, the Cargo.toml includes a version under which the crate would be
>>
2019 Jul 02
16
[PATCH] Add Rust bindings
I fixed the patch I submitted before based on comments, and there are some
commits which are merged or divided. So, I will re-send all the patches.
Regards,
Hiroyuki Katsura