aboutsummaryrefslogtreecommitdiff
path: root/lib/lexer.mll
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2023-12-26 09:34:58 -0600
committerMarc Coquand <marc@mccd.space>2023-12-26 09:57:20 -0600
commit742c23d7c5d90b681dcbce92846d57042d2ea467 (patch)
treeb6cf10333e15bc7b748744f7c7af805ca77f222c /lib/lexer.mll
parent8ac0e27adc8d14a77427351dede1757999c8c709 (diff)
downloadfixgen-742c23d7c5d90b681dcbce92846d57042d2ea467.tar.gz
fixgen-742c23d7c5d90b681dcbce92846d57042d2ea467.tar.bz2
fixgen-742c23d7c5d90b681dcbce92846d57042d2ea467.zip
Add support for ints
Diffstat (limited to '')
-rw-r--r--lib/lexer.mll5
1 files changed, 5 insertions, 0 deletions
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 }