Skip to content

Commit

Permalink
Address review comments.
Browse files Browse the repository at this point in the history
Signed-off-by: Henner Zeller <[email protected]>
  • Loading branch information
hzeller committed Dec 21, 2021
1 parent 4ff62ad commit e84b636
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common/text/tree_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ TEST(GetSubtreeAsNodeTest, ValidatedFoundNodeEnumChildMismatches) {

TEST(GetSubtreeAsLeafTest, ValidatedFoundLeaf) {
auto root = TNode(FakeEnum::kZero, Leaf(7, "foo"));
const auto& leaf = GetSubtreeAsLeaf(*root, FakeEnum::kZero, 0);
const SyntaxTreeLeaf* leaf = GetSubtreeAsLeaf(*root, FakeEnum::kZero, 0);
EXPECT_EQ(leaf->get().token_enum(), 7);
}

Expand Down
2 changes: 1 addition & 1 deletion verilog/analysis/checkers/always_comb_blocking_rule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void AlwaysCombBlockingRule::HandleSymbol(const verible::Symbol& symbol,

if (node == nullptr) continue;

const auto& leaf = verible::GetSubtreeAsLeaf(
const verible::SyntaxTreeLeaf* leaf = verible::GetSubtreeAsLeaf(
*node, NodeEnum::kNonblockingAssignmentStatement, 1);

if (leaf && leaf->get().token_enum() == TK_LE)
Expand Down
1 change: 1 addition & 0 deletions verilog/analysis/checkers/module_filename_rule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ void ModuleFilenameRule::Lint(const TextStructureView& text_structure,

// Only report a violation on the last module declaration.
const auto* last_module_id = GetModuleName(*module_cleaned.back().match);
if (!last_module_id) LOG(ERROR) << "Couldn't extract module name";
if (last_module_id) {
violations_.insert(verible::LintViolation(
last_module_id->get(), absl::StrCat(kMessage, "\"", unitname, "\"")));
Expand Down
1 change: 1 addition & 0 deletions verilog/analysis/checkers/one_module_per_file_rule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ void OneModulePerFileRule::Lint(const TextStructureView& text_structure,
if (module_cleaned.size() > 1) {
// Report second module declaration
const auto* second_module_id = GetModuleName(*module_cleaned[1].match);
if (!second_module_id) LOG(ERROR) << "Couldn't extract module name";
if (second_module_id) {
violations_.insert(verible::LintViolation(
second_module_id->get(),
Expand Down

0 comments on commit e84b636

Please sign in to comment.