parse alternate spacings of sense star

This commit is contained in:
Zachary Snow 2021-08-16 22:39:33 -06:00
parent c17d859988
commit cd45696ace
2 changed files with 19 additions and 0 deletions

View File

@ -1173,6 +1173,9 @@ CycleDelay :: { Expr }
EventControl :: { Sense }
: "@" "(" Senses ")" { $3 }
| "@" "(*)" { SenseStar }
| "@" "(" "*" ")" { SenseStar }
| "@" "(*" ")" { SenseStar }
| "@" "(" "*)" { SenseStar }
| "@*" { SenseStar }
| "@" Identifier { Sense $ LHSIdent $2 }
Senses :: { Sense }

16
test/basic/sense_star.sv Normal file
View File

@ -0,0 +1,16 @@
module top;
`define TEST(sense) always sense $display(`"sense %b`", x);
reg x, y;
`TEST(@*)
`TEST(@x)
`TEST(@y)
`TEST(@ ( * ))
`TEST(@ ( *))
`TEST(@ (* ))
`TEST(@ (*))
`TEST(@( * ))
`TEST(@( *))
`TEST(@(* ))
`TEST(@(*))
initial x = 1;
endmodule