From 97f84ccace4e634b4e02178a702818e69292dc9f Mon Sep 17 00:00:00 2001 From: Malte Voos Date: Mon, 8 Jul 2024 22:01:42 +0200 Subject: implement top-level definitions --- src/parser/Lexer.mll | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/parser/Lexer.mll') 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) } -- cgit 1.4.1