Skip to content

Commit

Permalink
[asl0] Allow equality with bitmasks
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienRenaud committed Oct 24, 2024
1 parent 2d1f5f4 commit 8702d6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions asllib/Parser0.mly
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ let binop_expr(e, b) ==
| ~=e; ~=bracketed(clist(slice)); < AST.E_Slice >
| ~=bracketed(clist(expr)); < AST.E_Concat >
| ~=e; IN; ~=bpattern; < AST.E_Pattern >
| e=e; EQ_EQ; m=MASK_LIT; { AST.(E_Pattern (e, Pattern_Mask (m))) }
| ~=annotated(ty_non_tuple); UNKNOWN; < AST.E_Unknown >
(*
| ~=e; LT; ~=clist(slice); GT; < AST.E_Slice >
Expand Down
2 changes: 2 additions & 0 deletions asllib/tests/regressions.t/asl0-patterns.asl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
integer main()
bits(64) x = Zeros(64);
y = x[1+:10]; // this would be invalid ASL0, but we use it in the XML
if x IN {'10x1101010'} then z = 1; // valid
if x == '10x1101010' then z = 1; // valid
if x[0+:4] IN '10x1' then
z = 1;
return 1;

0 comments on commit 8702d6d

Please sign in to comment.