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

[lexcer/parser] Empty content in SV if {} constraint block not supported #2320

Open
kaiyushen opened this issue Jan 5, 2025 · 0 comments
Open
Labels
rejects-valid syntax If the parser wrongly rejects syntactically valid code (according to SV-2017).

Comments

@kaiyushen
Copy link

Describe the bug

It looks like currently inside system verilog constraint, we don't support empty content inside if {} block

To Reproduce

class my_try_class extends uvm_object;

  rand bit some_bit;
  rand bit some_bit_2;

  `uvm_object_utils(my_try_class)

  constraint my_con_c {
    if (some_bit) {
      // after commenting out below line will trigger error
      // some_bit_2 == 1;
    }   
  }

endclass : my_try_class```

Include any options used.

**Actual behavior:**

lexer/parse error at line of "if (some_bit) {"

**Expected behavior**

Code should complain about lexer/parser error
@kaiyushen kaiyushen added the rejects-valid syntax If the parser wrongly rejects syntactically valid code (according to SV-2017). label Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rejects-valid syntax If the parser wrongly rejects syntactically valid code (according to SV-2017).
Projects
None yet
Development

No branches or pull requests

1 participant