concept/mproof: Fixed an old minor bug in the concept.
[neuro.git] / scripts / convDebug.sh
blob6c6a12d92a923b7dfa11caec15791e90ee26ca4d
1 #! /bin/bash
3 # NEURO_WARN
4 # NEURO_TRACE
5 # NEURO_ERROR
7 indent=' *\t* *\n*'
9 # first strip the NEURO_ part
10 # second, strip any ', NULL'
11 # third, any '"%s", Neuro_s(...)' to 'Neuro_s(...)'
12 # fourth, any '"%d", a' to 'Neuro_s("%d", a)'
13 work="s/NEURO_\(.*\)/\1/; \
14 s/(\(\".*\"\), *NULL/(\1/; \
15 s/(\"\(.*\)%s\(.*\)\",$indent$indent\(Neuro_s$indent($indent\)\"\(.*\)\"\(.*);\)/(\3\"\1\4\2\"\5/; \
16 /Neuro_s/! s/(\(\".*\",.*\));/(Neuro_s(\1));/"
18 # for multiline functions
19 Mwork=": gather; /;/! {N; b gather}; /;/ {$work}"
21 for i in $@; do
22 sed -e "/\/\*.*\*\// b" \
23 -e "/\/\*.*\*\//! {/\/\*/,/\*\// b}" \
24 -e "/NEURO_\(WARN\|TRACE\|ERROR\).*;/ $work" \
25 -e "/NEURO_\(WARN\|TRACE\|ERROR\).*;/! { \
26 /NEURO_\(WARN\|TRACE\|ERROR\)/,/;/ {$Mwork} \
27 }" -i $i
28 done