lambda/lexer.mll

17 lines
306 B
OCaml
Raw Permalink Normal View History

2018-02-13 23:43:40 +00:00
{
open Parser
exception Eof
}
rule token = parse
| ' ' | '\t' { token lexbuf }
| '\n' { EOL }
2018-02-16 11:22:07 +00:00
| '=' { Equal }
2018-02-13 23:43:40 +00:00
| '\\' { Lambda }
2018-02-16 11:22:07 +00:00
| '(' { LParen }
| ')' { RParen }
2018-02-13 23:43:40 +00:00
| '.' { Dot }
2018-02-20 11:19:49 +00:00
| "let" { Let }
2018-02-16 11:22:07 +00:00
| ['a'-'z' 'A'-'Z'] ['a'-'z' 'A'-'Z' '0'-'9' '_']* as s { Ident(s) }
2018-02-13 23:43:40 +00:00
| eof { raise Eof }