Advertisement
Guest User

Untitled

a guest
Jun 17th, 2015
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.30 KB | None | 0 0
  1. (* Lexer function *)
  2. let rec token buf =
  3.   match%sedlex buf with
  4.   | number ->
  5.       let n = int_of_string (Sedlexing.Utf8.lexeme buf) in
  6.       Some (Number n, buf)
  7.   | op_plus ->
  8.       Some (Op_plus, buf)
  9.   | Plus xml_blank ->
  10.       token buf
  11.   | eof ->
  12.       None
  13.   | _ ->
  14.       assert false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement