On Saturday 09 January 2010 17:26:37 Michael Stefaniuc wrote:
> Hello,
> 
> coccinelle 0.1.11 introduced regexp support for meta-identifier/function 
> and constant. The release notes says it's an OCaml regexp and points to 
> "man Str" for details but I don
> 
> I tried to make use of grouping and alternatives but I get errors like:
> identifier SPAM ~= "\(WINE_\)?\(ERR\|FIXME\|WARN\)";
>    Fatal error: exception Lexer_cocci.Lexical("unrecognised symbol:\(")
> identifier SPAM ~= "ERR\|FIXME\|WARN";
>    Fatal error: exception Lexer_cocci.Lexical("unrecognised symbol:\|")
> 
> Is this a known limitation or just a bug?

The following patch will fix this bug.

===================================================================
RCS file: /var/cvs/cocci/coccinelle/parsing_cocci/lexer_cocci.mll,v
retrieving revision 1.101
diff -u -r1.101 lexer_cocci.mll
--- parsing_cocci/lexer_cocci.mll       6 Nov 2009 10:47:11 -0000       1.101
+++ parsing_cocci/lexer_cocci.mll       9 Jan 2010 23:56:58 -0000
@@ -718,6 +718,7 @@
         | '\\' -> () | '?'  -> () | '\'' -> ()  | '"' -> ()
          | 'e' -> ()
          | '\n' -> ()
+        | '(' -> () | '|' -> () | ')' -> ()
          | _ -> lexerr "unrecognised symbol:" (tok lexbuf)
         );
           x ^ string lexbuf

> 
> thanks
> bye
>       michael
> 
> _______________________________________________
> Cocci mailing list
> [email protected]
> http://lists.diku.dk/mailman/listinfo/cocci
> (Web access from inside DIKUs LAN only)
> 

-- 
Nicolas Palix
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to