mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 17:59:41 +00:00
Merge pull request #938 from revarbat/revarbat_dev
Added find_modular_asserts.sh
This commit is contained in:
commit
8d0b806687
1 changed files with 29 additions and 0 deletions
29
scripts/find_modular_asserts.sh
Executable file
29
scripts/find_modular_asserts.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
|
||||
awk '
|
||||
/^module/{
|
||||
m=1
|
||||
split($2,narr,"(")
|
||||
module=narr[1]"()"
|
||||
}
|
||||
/^function/{
|
||||
m=0
|
||||
module=""
|
||||
}
|
||||
/[^=] *assert\(/{
|
||||
if(m) {
|
||||
if(fname!=FILENAME) {
|
||||
fname=FILENAME
|
||||
print "File",fname
|
||||
}
|
||||
if(prevmodule!=module) {
|
||||
prevmodule=module
|
||||
print " Module",module
|
||||
}
|
||||
assertline=$0
|
||||
sub(/^ */, "", assertline)
|
||||
print " ",FNR,":",assertline
|
||||
}
|
||||
}
|
||||
' *.scad
|
||||
|
Loading…
Reference in a new issue