feat: Add boolean literal and comparable binary operators

This commit is contained in:
Lucàs
2024-07-09 17:13:51 +02:00
parent 332dd73f15
commit b493c77d70
5 changed files with 64 additions and 4 deletions
+11 -1
View File
@@ -34,9 +34,19 @@ rule token = parse
| '-' { MINUS }
| '*' { TIMES }
| '/' { DIV }
| "==" { EQUAL_EQUAL }
| "!=" { NOT_EQUAL }
| "<" { LESS_THAN }
| "<=" { LESS_THAN_EQUAL }
| ">" { GREATER_THAN }
| ">=" { GREATER_THAN_EQUAL }
| "&&" { AMPERSAND_AMPERSAND }
| "||" { BAR_BAR }
| "!" { EXCLAMATION }
(* Keywords *)
(* ... *)
| "vrai" { BOOLEAN(true) }
| "faux" { BOOLEAN(false) }
(* Literals *)
| interger as i { INT (int_of_string i) }