about summary refs log tree commit diff
path: root/src/parser/Lexer.mll
diff options
context:
space:
mode:
authorMalte Voos <git@mal.tc>2024-07-08 22:01:42 +0200
committerMalte Voos <git@mal.tc>2024-07-08 22:01:42 +0200
commit97f84ccace4e634b4e02178a702818e69292dc9f (patch)
tree9cef95c62e3fa078db256c7fe657732fecef40a8 /src/parser/Lexer.mll
parent57de10d8728f51942f676b68f1f3ea29d9b78e6e (diff)
downloadtoytt-97f84ccace4e634b4e02178a702818e69292dc9f.tar.gz
toytt-97f84ccace4e634b4e02178a702818e69292dc9f.zip
implement top-level definitions
Diffstat (limited to 'src/parser/Lexer.mll')
-rw-r--r--src/parser/Lexer.mll11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/parser/Lexer.mll b/src/parser/Lexer.mll
index 708bb64..22ae387 100644
--- a/src/parser/Lexer.mll
+++ b/src/parser/Lexer.mll
@@ -11,11 +11,13 @@ let ident = letter+
 rule token =
   parse
   | whitespace { token lexbuf }
+
   | "(" { LPR }
   | ")" { RPR }
   | "[" { LBR }
   | "]" { RBR }
   | "->" { ARROW }
+  | ":=" { ASSIGN }
   | "*" { ASTERISK }
   | "\\" { BACKSLASH }
   | "::" { DOUBLE_COLON }
@@ -24,14 +26,21 @@ rule token =
   | "." { DOT }
   | "=>" { FATARROW }
   | "_" { UNDERSCORE }
-  | "at" { AT }
+
+  | "def" { DEF }
+
   | "fst" { FST }
   | "snd" { SND }
+
   | "type" { TYPE }
+
   | "bool" { BOOL }
   | "true" { TRUE }
   | "false" { FALSE }
   | "bool-elim" { BOOL_ELIM }
+  | "at" { AT }
+
   | ident { IDENT (Lexing.lexeme lexbuf) }
+
   | eof { EOF }
   | (_ as illegal_char) { raise (IllegalCharacter illegal_char) }