Skip to content

Commit

Permalink
Merge pull request chipsalliance#1088 from antmicro/mglb/WaitSpace
Browse files Browse the repository at this point in the history
Put space between `wait` and `(`
  • Loading branch information
hzeller authored Nov 4, 2021
2 parents 85fceb0 + e52f961 commit 951434f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
12 changes: 6 additions & 6 deletions verilog/formatting/formatter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5916,23 +5916,23 @@ static constexpr FormatterTestCase kFormatterTestCases[] = {
{// wait statements (null)
"task t; wait (a==b);wait(c<d); endtask",
"task t;\n"
" wait(a == b);\n"
" wait(c < d);\n"
" wait (a == b);\n"
" wait (c < d);\n"
"endtask\n"},
{// wait statements, single action statement
"task t; wait (a==b) p();wait(c<d) q(); endtask",
"task t;\n"
" wait(a == b) p();\n"
" wait(c < d) q();\n"
" wait (a == b) p();\n"
" wait (c < d) q();\n"
"endtask\n"},
{// wait statements, block action statement
"task t; wait (a==b) begin p(); end "
"wait(c<d) begin q(); end endtask",
"task t;\n"
" wait(a == b) begin\n"
" wait (a == b) begin\n"
" p();\n"
" end\n"
" wait(c < d) begin\n"
" wait (c < d) begin\n"
" q();\n"
" end\n"
"endtask\n"},
Expand Down
1 change: 0 additions & 1 deletion verilog/formatting/token_annotator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ static bool IsKeywordCallable(verilog_tokentype e) {
case TK_sort:
case TK_sum:
case TK_unique: // array method
case TK_wait: // wait statement
case TK_xor: // array method
// TODO(fangism): Verilog-AMS functions, like sin, cos, ...
return true;
Expand Down
10 changes: 6 additions & 4 deletions verilog/formatting/token_annotator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,12 @@ TEST(TokenAnnotatorTest, AnnotateFormattingInfoTest) {
{verilog_tokentype::TK_end, "end"},
}},

// wait ()
{DefaultStyle,
1,
{{0, SpacingOptions::Undecided}, {1, SpacingOptions::Undecided}},
{{verilog_tokentype::TK_wait, "wait"}, {'(', "("}}},

// various built-in function calls
{DefaultStyle,
1,
Expand Down Expand Up @@ -1491,10 +1497,6 @@ TEST(TokenAnnotatorTest, AnnotateFormattingInfoTest) {
1,
{{0, SpacingOptions::Undecided}, {0, SpacingOptions::Undecided}},
{{verilog_tokentype::TK_unique, "unique"}, {'(', "("}}},
{DefaultStyle,
1,
{{0, SpacingOptions::Undecided}, {0, SpacingOptions::Undecided}},
{{verilog_tokentype::TK_wait, "wait"}, {'(', "("}}},
{DefaultStyle,
1,
{{0, SpacingOptions::Undecided}, {0, SpacingOptions::Undecided}},
Expand Down

0 comments on commit 951434f

Please sign in to comment.