fix: smoke test treats function definitions as calls in BusyBox awk (#773)
Add "(" to the get_candidates skip list so that function definition
lines (e.g. memory_guard() {) are not extracted as call candidates.
Previously this was masked by get_fns also being broken on BusyBox
awk, but fixing get_fns exposed the get_candidates gap.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c3719618a4
commit
f830f3672a
1 changed files with 4 additions and 3 deletions
|
|
@ -67,9 +67,10 @@ get_candidates() {
|
||||||
if (match(p, /^[a-z][a-zA-Z0-9_]*_[a-zA-Z0-9_]+/)) {
|
if (match(p, /^[a-z][a-zA-Z0-9_]*_[a-zA-Z0-9_]+/)) {
|
||||||
word = substr(p, RSTART, RLENGTH)
|
word = substr(p, RSTART, RLENGTH)
|
||||||
rest = substr(p, RSTART + RLENGTH, 1)
|
rest = substr(p, RSTART + RLENGTH, 1)
|
||||||
# Skip: case labels (word) or word|), Python/jq patterns (word:),
|
# Skip: function definitions (word(), case labels (word) or word|),
|
||||||
# object method calls (word.method), assignments (word=)
|
# Python/jq patterns (word:), object method calls (word.method),
|
||||||
if (rest == ")" || rest == "|" || rest == ":" || rest == "." || rest == "=") continue
|
# assignments (word=)
|
||||||
|
if (rest == "(" || rest == ")" || rest == "|" || rest == ":" || rest == "." || rest == "=") continue
|
||||||
print word
|
print word
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue