From 742c23d7c5d90b681dcbce92846d57042d2ea467 Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Tue, 26 Dec 2023 09:34:58 -0600 Subject: Add support for ints --- lib/lexer.mll | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/lexer.mll') diff --git a/lib/lexer.mll b/lib/lexer.mll index 769192b..fed77ab 100644 --- a/lib/lexer.mll +++ b/lib/lexer.mll @@ -8,6 +8,7 @@ let digit = ['0'-'9'] let frac = '.' digit* let exp = ['e' 'E'] ['-' '+']? digit+ let float = digit* frac? exp? +let int = digit+ let white = [' ' '\t']+ let newline = '\r' | '\n' | "\r\n" let id = ['a'-'z' 'A'-'Z' '-']* @@ -19,6 +20,10 @@ rule read = | id { IDENTIFIER (Lexing.lexeme lexbuf) } | "_uuidv4" { UUIDV4 } | "_name" { NAME } + | "_int" { INTSYMBOL } + | "<" { LBRACE } + | ">" { RBRACE } + | int { INT (Lexing.lexeme lexbuf |> int_of_string) } | white { read lexbuf } | ":" { COLON } | ";" { SEMICOLON } -- cgit v1.2.3