Fix parsing of boolean constants

master
Rohan Jacob-Rao 9 years ago
parent a570bf5b85
commit ded6b1d654

@ -60,7 +60,6 @@ rule token = parse
(* TYPES *) (* TYPES *)
| "void" { VOID } | "void" { VOID }
| "i1" { BIT (* INT 1 *) }
| 'i' (pos_int as width) { INT (int_of_string width) } | 'i' (pos_int as width) { INT (int_of_string width) }
| "half" { HALF } | "half" { HALF }
| "float" { FLOAT } | "float" { FLOAT }

@ -33,7 +33,6 @@
(* TYPES *) (* TYPES *)
%token VOID %token VOID
%token BIT (* i1 *)
%token <int> INT %token <int> INT
%token HALF %token HALF
%token FLOAT %token FLOAT
@ -241,7 +240,7 @@ instr:
| RET tp = typ op = operand { Ret (Some (tp, op)) } | RET tp = typ op = operand { Ret (Some (tp, op)) }
| RET VOID { Ret None } | RET VOID { Ret None }
| BR LABEL lbl = variable { UncondBranch lbl } | BR LABEL lbl = variable { UncondBranch lbl }
| BR BIT op = operand COMMA LABEL lbl1 = variable COMMA LABEL lbl2 = variable { CondBranch (op, lbl1, lbl2) } | BR i=INT op = operand COMMA LABEL lbl1 = variable COMMA LABEL lbl2 = variable { CondBranch (op, lbl1, lbl2) }
(* Memory access operations *) (* Memory access operations *)
| var = variable EQUALS ALLOCA tp = typ align? { Alloc (var, tp, 1) } | var = variable EQUALS ALLOCA tp = typ align? { Alloc (var, tp, 1) }
| var = variable EQUALS LOAD tp = ptr_typ ptr = variable align? { Load (var, tp, ptr) } | var = variable EQUALS LOAD tp = ptr_typ ptr = variable align? { Load (var, tp, ptr) }

Loading…
Cancel
Save