Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tree-sitter/tree-sitter-verilog
Browse files Browse the repository at this point in the history
  • Loading branch information
drom committed Oct 4, 2021
2 parents 443538d + 02a1247 commit 6fae741
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions corpus/assign.txt
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,77 @@ endmodule
))
))


============================================
assign - constant_range expression (parameter first)
============================================

module mod ();
assign a = b[Param+1:0];
endmodule

----

(source_file (module_declaration
(module_header (module_keyword) (simple_identifier))
(module_nonansi_header (list_of_ports))
(module_or_generate_item (continuous_assign
(list_of_net_assignments (net_assignment
(net_lvalue (simple_identifier))
(expression (primary
(simple_identifier)
(select1
(constant_range
(constant_expression
(constant_expression (constant_primary (parameter_identifier (simple_identifier))))
(constant_expression
(constant_primary (primary_literal (integral_number (decimal_number (unsigned_number)))))
)
)
(constant_expression (constant_primary (primary_literal (integral_number (decimal_number (unsigned_number))))))
)
)
))
))
))
))


============================================
assign - constant_range expression (parameter first, LSB)
============================================

module mod ();
assign a = b[0:Param+1];
endmodule

----

(source_file (module_declaration
(module_header (module_keyword) (simple_identifier))
(module_nonansi_header (list_of_ports))
(module_or_generate_item (continuous_assign
(list_of_net_assignments (net_assignment
(net_lvalue (simple_identifier))
(expression (primary
(simple_identifier)
(select1
(constant_range
(constant_expression (constant_primary (primary_literal (integral_number (decimal_number (unsigned_number))))))
(constant_expression
(constant_expression (constant_primary (parameter_identifier (simple_identifier))))
(constant_expression
(constant_primary (primary_literal (integral_number (decimal_number (unsigned_number)))))
)
)
)
)
))
))
))
))


============================================
assign - precedence or, xor, and, eq
============================================
Expand Down

0 comments on commit 6fae741

Please sign in to comment.