Compare commits

..

2 Commits

Author SHA1 Message Date
b1ek ecff1d33bb
simplify rdc.sh start comment 2024-06-07 22:25:57 +10:00
b1ek dba8899100
ignore function names 2024-06-07 22:25:37 +10:00
2 changed files with 13 additions and 2 deletions

View File

@ -34,6 +34,18 @@ func find(code string) ([]string, error) {
} }
ignored, deps := get_ignored_and_deps(code) ignored, deps := get_ignored_and_deps(code)
// 1. find function declarations
syntax.Walk(f, func(node syntax.Node) bool {
switch x := node.(type) {
case *syntax.FuncDecl:
ignored = append(ignored, x.Name.Value)
}
return true
})
// 2. collect all commands
syntax.Walk(f, func(node syntax.Node) bool { syntax.Walk(f, func(node syntax.Node) bool {
switch x := node.(type) { switch x := node.(type) {
case *syntax.CallExpr: case *syntax.CallExpr:

3
rdc.sh
View File

@ -1,5 +1,4 @@
# This is the runtime dependency checker # bshchk (https://git.blek.codes/blek/bshchk)
# Please do not remove the following lines.
{{.DepsVar}}=({{.Deps}}) {{.DepsVar}}=({{.Deps}})
non_ok=() non_ok=()