Commits

kathyg committed 6ead4a3

Fix to issue #35, and addition of corresponding test case

  • Participants
  • Parent commits 85de86b

Comments (0)

Files changed (3)

File src/lexer.mll

   | ['/''%'] oper_char* as i         { (StarX(Some(skips), Ulib.Text.of_latin1 i)) }
   | "*" oper_char+ as i         { (StarX(Some(skips), Ulib.Text.of_latin1 i)) }
   | ['+''-'] oper_char* as i            { (PlusX(Some(skips), Ulib.Text.of_latin1 i)) }
+  | ">=" oper_char+ as i   		{ (GtEqX(Some(skips), Ulib.Text.of_latin1 i)) }
   | ['@''^'] oper_char* as i            { (AtX(Some(skips), Ulib.Text.of_latin1 i)) }
   | ['=''<''>''|''&''$'] oper_char* as i { (EqualX(Some(skips), Ulib.Text.of_latin1 i)) }
   | digit+ as i                         { (Num(Some(skips),int_of_string i)) }

File src/parser.mly

 %token <Ast.terminal> Semi Lsquare Rsquare Fun_ Function_ Bar With Match Let_ And HashZero HashOne
 %token <Ast.terminal> In Of Rec Type Rename Module_ Struct End Open_ SemiSemi Eof
 %token <Ast.terminal> True False Begin_ If_ Then Else Val
-%token <Ast.terminal * Ulib.Text.t> AmpAmp BarBar ColonColon Star Plus Eq At GtEq
+%token <Ast.terminal * Ulib.Text.t> AmpAmp BarBar ColonColon Star Plus Eq At GtEq 
 %token <Ast.terminal * Ulib.Text.t> X Tyvar Nvar BquoteX
-%token <Ast.terminal * Ulib.Text.t> StarstarX StarX PlusX AtX EqualX 
+%token <Ast.terminal * Ulib.Text.t> StarstarX StarX PlusX AtX EqualX GtEqX
 %token <Ast.terminal * int> Num
 %token <Ast.terminal * string> String Bin Hex
 
     { mk_pre_x_l $1 $2 $3 (loc ()) }
   | Lparen StarX Rparen
     { mk_pre_x_l $1 $2 $3 (loc ()) }
+  | Lparen GtEqX Rparen
+    { mk_pre_x_l $1 $2 $3 (loc ()) }
   | Lparen EqualX Rparen
     { mk_pre_x_l $1 $2 $3 (loc ()) }
   | Lparen StarstarX Rparen
     { eloc (Infix($1,SymX_l($2, locn 2 2), $3)) }
   | eq_exp EqualX at_exp
     { eloc (Infix($1,SymX_l($2, locn 2 2), $3)) }
+  | eq_exp GtEq at_exp
+    { eloc (Infix ($1,SymX_l($2, locn 2 2), $3)) }
+  | eq_exp GtEqX at_exp
+    { eloc (Infix ($1,SymX_l($2, locn 2 2), $3)) }
   | eq_exp IN at_exp
     { eloc (Infix($1,SymX_l($2, locn 2 2), $3)) }
   | eq_exp MEM at_exp

File tests/ident_backend/basic_exprs.lem

 val test81 : forall ''x ''y . ''x >= ''y => vector bit ''x -> vector bit ''y -> bit
 let test81 v _ = v.[''y]
 
-let test82 = test81 0b01010101 0b00
+let test82 = test81 0b01010101 0b00
+
+let test83 = 3 >= 2