Release coccinelle-0.2.2-rc2
[bpt/coccinelle.git] / parsing_cocci / lexer_script.mll
index 512f905..1cab41c 100644 (file)
@@ -26,16 +26,19 @@ module D = Data
 module Ast = Ast_cocci
 exception Lexical of string
 let tok = Lexing.lexeme
+let inc_line _ = Lexer_cocci.line := !Lexer_cocci.line + 1
 }
 (* ---------------------------------------------------------------------- *)
 (* tokens *)
 
-let myrule = [^'"''@']+
+let myrule = [^'"''@''/''\n''\r''\011''\012']+
 
 rule token = parse
-  | myrule             { TScriptData (tok lexbuf) }
+  | myrule { TScriptData (tok lexbuf) }
+  | ['\n' '\r' '\011' '\012'] { inc_line(); TScriptData (tok lexbuf) }
   | "@@" { TArobArob }
   | "@"  { TArob }
+  | "/"  { TScriptData (tok lexbuf) }
   | "//" [^ '\n']* { token lexbuf } (* skip SmPL comments *)
   | '"'  { TScriptData (Printf.sprintf "\"%s\"" (string lexbuf)) }
   | eof  { EOF }