diff options
author | Paweł Dybiec <pdybiec@stud.cs.uni.wroc.pl> | 2018-11-10 01:14:39 +0100 |
---|---|---|
committer | Paweł Dybiec <pdybiec@stud.cs.uni.wroc.pl> | 2018-11-10 01:14:39 +0100 |
commit | 580dc4f693bad1ae0caa8809673f955f13aad4c2 (patch) | |
tree | d1aa880ff0a02b4ec5107c616033ab178f29023c /source/mod_student/lexer.mll | |
parent | Support multiple indexing (diff) |
Add boolean literals
Diffstat (limited to 'source/mod_student/lexer.mll')
-rw-r--r-- | source/mod_student/lexer.mll | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/mod_student/lexer.mll b/source/mod_student/lexer.mll index 1d5f9f2..1803de5 100644 --- a/source/mod_student/lexer.mll +++ b/source/mod_student/lexer.mll @@ -119,13 +119,15 @@ let implode l = | "length" { LENGTH } | "int" { T_INT } | "bool" { T_BOOL } + | "true" { BOOL true } + | "false" { BOOL false } | "_" { UNDERSCORE } | identifier as id { IDENTIFIER id } | integer as i { INT (int_of_string i) } (* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ----------------------------------------------------------------------------- *) - | " " {token lexbuf} + | " "|"\t" {token lexbuf} | _ { handleError (Lexing.lexeme_start_p lexbuf) (Lexing.lexeme lexbuf) } |