Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error of SystemVerilog set membership operator 'inside' #61

Open
KatCe opened this issue May 2, 2023 · 0 comments
Open

Parse error of SystemVerilog set membership operator 'inside' #61

KatCe opened this issue May 2, 2023 · 0 comments

Comments

@KatCe
Copy link

KatCe commented May 2, 2023

Hello,

morty version 0.9.0 fails with a parse error in the following code example:

// filename: inside_test.sv
module test (bit clk);
  int a,b,c;
  bit d;

    if (a inside {b, c}) begin : gen_1
      assign d = 1'b1;
    end else begin : gen_0
      assign d = 1'b0;
    end
endmodule

Tool was called with morty inside_test.sv.
Error message:

Error: parse error
   --> inside_test.sv:21:11
   |
21 |     if (a inside {b, c}) begin : gen_1
   |           ^
Error: Parse error: Some(("inside_test.sv", 403))

Another test case where we expect no parse error on the 'inside' expression is:

//   typedef enum logic [2:0] {
//     testval1  = 3'd0, 
//     testval2  = 3'd1, 
//     testval3  = 3'd2
//   } test_e;
module test#(parameter test_e a) (bit clk);
  bit d;

    if (a inside {testval1, testval2}) begin : gen_1
      assign d = 1'b1;
    end else begin : gen_0
      assign d = 1'b0;
    end

endmodule

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant