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

blocking assigment with member_identifier miss parse to clockvar_expression #73

Open
zoomer-k opened this issue May 8, 2024 · 0 comments

Comments

@zoomer-k
Copy link

zoomer-k commented May 8, 2024

simple example

============================================
always -- case member
============================================

module abc ();

always_comb
case ( foo )
  8'h00, 8'h05: bar.baz = 1'b0;
  default       bar = 1;
endcase

endmodule

----

parse to

    (source_file
      (module_declaration
        (module_header
          (module_keyword)
          (simple_identifier))
        (module_nonansi_header
          (list_of_ports))
        (module_or_generate_item
          (always_construct
            (always_keyword)
            (statement
              (statement_item
                (case_statement
                  (case_keyword)
                  (case_expression
                    (expression
                      (primary
                        (simple_identifier))))
                  (ERROR
                    (case_item_expression
                      (expression
                        (primary
                          (primary_literal
                            (integral_number
                              (hex_number))))))
                    (case_item_expression
                      (expression
                        (primary
                          (primary_literal
                            (integral_number
                              (hex_number))))))
                    (clockvar_expression
                      (clockvar
                        (simple_identifier))
                      (select1
                        (member_identifier
                          (simple_identifier)))))
                  (case_item
                    (statement_or_null
                      (statement
                        (statement_item
                          (blocking_assignment
                            (operator_assignment
                              (variable_lvalue
                                (simple_identifier))
                              (assignment_operator)
                              (expression
                                (primary
                                  (primary_literal
                                    (integral_number
                                      (decimal_number
                                        (unsigned_number)))))))))))))))))))

maybe correct parse is

    (source_file
      (module_declaration
        (module_header
          (module_keyword)
          (simple_identifier))
        (module_nonansi_header
          (list_of_ports))
        (module_or_generate_item
          (always_construct
            (always_keyword)
            (statement
              (statement_item
                (case_statement
                  (case_keyword)
                  (case_expression
                    (expression
                      (primary
                        (simple_identifier))))
                  (case_item
                    (case_item_expression
                      (expression
                        (primary
                          (primary_literal
                            (integral_number
                              (hex_number))))))
                    (case_item_expression
                      (expression
                        (primary
                          (primary_literal
                            (integral_number
                              (hex_number))))))
                    (statement_or_null
                      (statement
                        (statement_item
                          (blocking_assignment
                            (operator_assignment
                              (variable_lvalue
                                (simple_identifier)
                                (select1
                                  (member_identifier
                                    (simple_identifier))))
                              (assignment_operator)
                              (expression
                                (primary
                                  (primary_literal
                                    (integral_number
                                      (binary_number)))))))))))
                  (case_item
                    (statement_or_null
                      (statement
                        (statement_item
                          (blocking_assignment
                            (operator_assignment
                              (variable_lvalue
                                (simple_identifier))
                              (assignment_operator)
                              (expression
                                (primary
                                  (primary_literal
                                    (integral_number
                                      (decimal_number
                                        (unsigned_number)))))))))))))))))))

#58
when change grammar.js follow this PR

but corpus folder dont have clocking block test pattern.
so cant check side effect

@drom
could you add test pattern for this commit? if you could
fd07bc8

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