From: "Christoph Bauer" <Christoph.Bauer@lmsintl.com>
To: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
Cc: "caml-list" <caml-list@inria.fr>
Subject: RE: [Caml-list] ocamlbuild and menhir on MinGW
Date: Wed, 23 May 2007 11:21:06 +0200 [thread overview]
Message-ID: <BB046CA812535C45BD0029AA9D04BA79DC37BE@KL-SRV57.lmsintl.com> (raw)
In-Reply-To: <cd67f63a0705230040s5cb3676fpc4ad3db65a42c237@mail.gmail.com>
> Are you in cygwin or the windows "shell"?
cygwin shell. With windows "shell" Cmd.exe the output differs but it fails
as well:
[KC:\ocamlmgw\bin\menhir: unknown option `-modules mlutils/globParser.mly'.
Usage: C:\ocamlmgw\bin\menhir <options> <filenames>
...[CUT]...
←[KExit code 2 while executing this command:
C:/ocamlmgw/bin/menhir --raw-depend --ocamldep "ocamldep -modules" mlutils/glo
bParser.mly > mlutils/globParser.mly.depends
In ocamlbuild/my_std.ml there is a comment about the problem:
let sys_command =
match Sys.os_type with
| "Win32" -> fun cmd ->
let cmd = "bash -c "^Filename.quote cmd in
(* FIXME fix Filename.quote for windows *)
let cmd = String.subst "\"&\"\"&\"" "&&" cmd in
Sys.command cmd
| _ -> Sys.command
We could use Unix.create_process. I attached a function
to split cmd in a list.
Regards,
Christoph Bauer
let split_quoted_string_list ?(quote = '"') s =
let len = String.length s in
let word_buffer = Buffer.create 128 in
let rec outer i acc =
if i >= len then List.rev acc
else
let c = String.unsafe_get s i in
match c with
' ' | '\t' | '\r' | '\n' -> outer (i+1) acc
| c when c = quote -> inner (i+1) acc
| _ -> plain i acc
and end_of_word i acc =
let word = Buffer.contents word_buffer in
Buffer.clear word_buffer;
outer i (word::acc)
and inner i acc =
if i >= len then failwith ("parser error (split_quoted_string_list): " ^ s);
let c = String.unsafe_get s i in
if c = quote then end_of_word (i+1) acc
else
(Buffer.add_char word_buffer c;
inner (i+1) acc);
and plain i acc =
if i >= len then end_of_word i acc
else
match String.unsafe_get s i with
' ' | '\t' | '\r' | '\n' -> end_of_word (i+1) acc
| c when c = quote -> end_of_word i acc
| c -> Buffer.add_char word_buffer c;
plain (i+1) acc
in outer 0 []
next prev parent reply other threads:[~2007-05-23 9:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-22 16:14 Christoph Bauer
2007-05-23 7:40 ` [Caml-list] " Nicolas Pouillard
2007-05-23 9:21 ` Christoph Bauer [this message]
2007-05-23 14:46 ` Nicolas Pouillard
2007-05-24 7:17 ` Christoph Bauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BB046CA812535C45BD0029AA9D04BA79DC37BE@KL-SRV57.lmsintl.com \
--to=christoph.bauer@lmsintl.com \
--cc=caml-list@inria.fr \
--cc=nicolas.pouillard@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox