spooky/lib/lexer.mli

52 lines
583 B
OCaml
Raw Normal View History

2026-04-29 15:50:03 +00:00
type token =
| TIntKw
| TBoolKw
| TVoidKw
| TStructKw
| TIf
| TElse
| TFor
| TEach
| TForEach
| TIn
| TReturn
| TTrue
| TFalse
2026-04-29 18:56:41 +00:00
| TFn
| TLet
| TMut
2026-04-29 15:50:03 +00:00
| TIdent of string
| TIntLit of int
| TLParen
| TRParen
| TLBrace
| TRBrace
| TLBracket
| TRBracket
| TSemicolon
| TComma
| TDot
| TAssign
| TPlus
| TMinus
| TStar
| TSlash
| TPercent
| TAndAnd
| TOrOr
| TBang
| TEqEq
| TNe
| TLt
| TLe
| TGt
| TGe
| TEOF
2026-04-29 18:56:41 +00:00
| TArrow
| TColon
| THash
2026-04-29 15:50:03 +00:00
exception Lex_error of string
val lex : string -> token list