[Cocci] OSX?
Cyril Roelandt
tipecaml at gmail.com
Mon Feb 27 22:38:51 CET 2012
On 02/27/2012 07:06 PM, ron minnich wrote:
> I've not had much luck building on osx. The latest problem is this:
>
> ocamlc -I ../commons -I ../commons/ocamlextra -I ../globals -I
> ../menhirlib -c lexer_cocci.ml
> File "lexer_cocci.mll", line 534, characters 3-40:
> Error: The constructor TPArob expects 0 argument(s),
> but is applied here to 1 argument(s)
>
I don't think this error is linked to OSX. I have the exact same error
on Debian testing.
Patching coccinelle like this :
diff --git a/parsing_cocci/lexer_cocci.mll b/parsing_cocci/lexer_cocci.mll
index df59d87..f555c4f 100644
--- a/parsing_cocci/lexer_cocci.mll
+++ b/parsing_cocci/lexer_cocci.mll
@@ -531,7 +531,7 @@ rule token = parse
if !Data.in_rule_name or not !current_line_started
then (start_line true; TArob)
else (check_minus_context_linetype "@";
- TPArob (get_current_line_type lexbuf)) }
+ TPArob ) }
| "=~" { start_line true; TTildeEq (get_current_line_type lexbuf) }
| "!~" { start_line true; TTildeExclEq (get_current_line_type lexbuf) }
leads to this error :
File "lexer_cocci.mll", line 534, characters 3-9:
Error: The constructor TPArob expects 1 argument(s),
but is applied here to 0 argument(s)
which is quite funny.
A colleague who knows OCaml tried to fix this, and finally got it
working, without really knowing how. Running "git diff" shows a 30927
line patch : parsing_cocci/parser_cocci_menhir.ml and
parsing_cocci/parser_cocci_menhir.mli were modified. I believe they are
generated files.
I hope this helps.
Cyril Roelandt.
More information about the Cocci
mailing list