*** camlp4/lib/plexer.ml Fri Jul 19 16:53:48 2002 --- camlp4/lib/patched/plexer.ml Wed Apr 9 17:10:26 2003 *************** *** 127,133 **** [ [: `' ' | '\010' | '\013' | '\t' | '\026' | '\012'; s :] -> next_token s | [: `'('; s :] -> left_paren bp s ! | [: `'#'; s :] -> do { spaces_tabs s; linenum bp s } | [: `('A'..'Z' | '\192'..'\214' | '\216'..'\222' as c); s :] -> let id = get_buff (ident (store 0 c) s) in let loc = (bp, Stream.count s) in --- 127,133 ---- [ [: `' ' | '\010' | '\013' | '\t' | '\026' | '\012'; s :] -> next_token s | [: `'('; s :] -> left_paren bp s ! | [: `'#'; s :] -> sharp bp s | [: `('A'..'Z' | '\192'..'\214' | '\216'..'\222' as c); s :] -> let id = get_buff (ident (store 0 c) s) in let loc = (bp, Stream.count s) in *************** *** 327,332 **** --- 327,340 ---- parser [ [: `'>' :] -> len | [: a = quotation bp (store len '>') :] -> a ] + and sharp bp = + parser + [ [: `'#'; _ = one_line_comment bp ; a = next_token :] -> a + | [: s :] -> do { spaces_tabs s; linenum bp s } ] + and one_line_comment bp = + parser + [ [: `'\n' :] -> () + | [: `_; s :] -> one_line_comment bp s ] and left_paren bp = parser [ [: `'*'; _ = comment bp; a = next_token :] -> a