mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
30 lines
569 B
Bash
30 lines
569 B
Bash
|
#!/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
|
||
|
|