Commit 3b0c6f24 authored by Fabien Rozar's avatar Fabien Rozar

get_one_subroutine.sh: Deal if a '_' is used between the subroutine name and...

get_one_subroutine.sh: Deal if a '_' is used between the subroutine name and the module name. Improve the detection of the beginning of the subroutine.
parent 359490d2
......@@ -19,7 +19,7 @@ sub=$2
f_id=$(basename $f)
id=$(echo ${f_id:4:5})
beg=`grep -ni -e "^ *\(subroutine\|.*function\) *${sub}_${id}" -e "^ *end *\(subroutine\|function\)" $f | grep -i -e "^[0-9]*: *\(subroutine\|.*function\) *$sub" -A1 | head -n2 | head -n1 | cut -d":" -f1`
end=`grep -ni -e "^ *\(subroutine\|.*function\) *${sub}_${id}" -e "^ *end *\(subroutine\|function\)" $f | grep -i -e "^[0-9]*: *\(subroutine\|.*function\) *$sub" -A1 | head -n2 | tail -n1 | cut -d":" -f1`
beg=`grep -ni -e "^ *\(subroutine\|.*function\) *${sub}\(_\|\)${id}" -e "^ *end *\(subroutine\|function\)" $f | grep -i -e "^[0-9]*: *\(subroutine\|.*function\) *${sub}\(_\|\)${id} *(" -A1 | head -n2 | head -n1 | cut -d":" -f1`
end=`grep -ni -e "^ *\(subroutine\|.*function\) *${sub}\(_\|\)${id}" -e "^ *end *\(subroutine\|function\)" $f | grep -i -e "^[0-9]*: *\(subroutine\|.*function\) *${sub}\(_\|\)${id} *(" -A1 | head -n2 | tail -n1 | cut -d":" -f1`
head -n $end $f | tail -n $((${end}-${beg}+1))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment