Can someone help me explain why I have a syntax error at this line: let wordMap = StringMap.empty
? This is contained in an .mll file. The module StringMap is defined above.
let lexbuf = Lexing.from_channel stdin in
let wordlist =
let rec next l = match token lexbuf with
EOF -> l
| Word(s) -> next (s :: l)
in next []
let wordMap = StringMap.empty in
let wcList = StringMap.fold (fun word count l -> (string_of_int count ^ " " ^ word) :: l) wordMap [] in
List.iter print_endline wcList;;
I know it prints nothing, this is just for testing.