(* This simple function counts the number of newline characters in a string. *)letnewline=('\010'|'\013'|"\013\010")letordinary=[^'\010''\013']+rulecountn=parse|eof{n}|newline{count(n+1)lexbuf}|ordinary{countnlexbuf}