1 2 3 4 5 6 7 8 9 10 11
let rec token buf = let open Token in match%sedlex buf with | "@@" -> Escaped_at::token buf | "@" -> At::token buf | Star (Sub (any, "@")) -> Printf.printf "length = %d\n" (Sedlexing.lexeme_length buf); Printf.printf "array length = %d\n" (Array.length (Sedlexing.lexeme buf)); String (Sedlexing.Utf8.lexeme buf)::token buf | eof -> [] | _ -> failwith "nyi"
You can clone a snippet to your computer for local editing. Learn more.