Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Jan 8, 2025
1 parent 1341735 commit 9e50472
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/tools/vvet/analyze.v
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ mut:
cur_fn ast.FnDecl // current fn declaration
}

// stmt checks for repeated code in statements
fn (mut vt VetAnalyze) stmt(vet &Vet, stmt ast.Stmt) {
match stmt {
ast.AssignStmt {
Expand All @@ -53,6 +54,7 @@ fn (mut vt VetAnalyze) save_expr(cutoff int, expr string, file string, pos token
}
}

// exprs checks for repeated code in expressions
fn (mut vt VetAnalyze) exprs(vet &Vet, exprs []ast.Expr) {
for expr in exprs {
vt.expr(vet, expr)
Expand Down Expand Up @@ -135,6 +137,7 @@ fn (mut vt VetAnalyze) vet_repeated_code(mut vet Vet) {
}
}

// vet_code_analyze performs code analysis
fn (mut vt Vet) vet_code_analyze() {
if vt.opt.repeated_code {
vt.analyze.vet_repeated_code(mut vt)
Expand Down

0 comments on commit 9e50472

Please sign in to comment.