]> xenbits.xensource.com Git - xenclient/toolstack.git/commitdiff
comment parsing needs to be ocaml-style, not C style
authorPrashanth Mundkur <prashanth.mundkur@citrix.com>
Mon, 13 Apr 2009 18:20:43 +0000 (11:20 -0700)
committerPrashanth Mundkur <prashanth.mundkur@citrix.com>
Mon, 13 Apr 2009 18:20:43 +0000 (11:20 -0700)
libs/json/gen_json_conv/lexer.mll

index 0407684101b1bdb39cd414fc8af57af900fc1ded..5952c4be0c50b6157a78fa2658ce8baa94ad55b2 100644 (file)
@@ -48,9 +48,9 @@ rule main = parse
 
 | ['\n']       { new_line lexbuf; main lexbuf}
 
-| "*/"         { raise_syntax_error Unmatched_comment (lexeme_start_p lexbuf) }
+| "*)"         { raise_syntax_error Unmatched_comment (lexeme_start_p lexbuf) }
 
-| "/*"         { comment_depth := 1; comment_start := lexeme_start_p lexbuf;
+| "(*"         { comment_depth := 1; comment_start := lexeme_start_p lexbuf;
                  comment lexbuf; main lexbuf }
 
 | eof          { EOF }
@@ -85,8 +85,8 @@ rule main = parse
 
 
 and comment = parse
-| "/*"         { incr comment_depth; comment lexbuf }
-| "*/"         { decr comment_depth; if !comment_depth > 0 then comment lexbuf }
+| "(*"         { incr comment_depth; comment lexbuf }
+| "*)"         { decr comment_depth; if !comment_depth > 0 then comment lexbuf }
 | ['\n']       { new_line lexbuf; comment lexbuf }
 | eof          { raise_syntax_error Unterminated_comment !comment_start }
 | _            { comment lexbuf }