|
Changed commit message containing the fixed sed script:
Issue 4377: Run a script for using derived_unsmob where obvious
Script is:
matched="[^()]*"
for i in 1 2 3 4 5
do
matched="\\(($matched)\\|[^()]\\)*"
done
filelist="$(git grep -l '\<dynamic_cast[^>]*> ([_a-zA-Z]*::unsmob\>')"
typelist="$(sed -n 's/^.*\<dynamic_cast\s*<\([_a-zA-Z]\+\)\s*\*> (\([_a-zA-Z]*\)::unsmob\>.*$/\1/p' $filelist | sort -u )"
for typ in $typelist
do
# crazy: we have unsmob definitions that are not even used
if git grep -q "$typ::unsmob" || git grep -q "\\<$typ"'\s*\*\s*unsmob\s*(SCM'
then
echo "There already is $typ::unsmob"
sed -i '/unsmob (SCM/,/;/!s/\<dynamic_cast\s*<\('"$typ"'\)\s*\*> (\([_a-zA-Z]*\)::unsmob\s*(\('"$matched"'\))\s*)/\1::unsmob (\3)/g' $filelist
else
sed -i 's/\<dynamic_cast\s*<\('"$typ"'\)\s*\*> (\([_a-zA-Z]*\)::unsmob\s*(\('"$matched"'\))\s*)/derived_unsmob<\1> (\3)/g' $filelist
fi
done
The awkward bit at the start of the script is for matching matched
parentheses. This replaces the construct
dynamic_cast<T *>(xxx::unsmob (yyy))
with
derived_unsmob<T> (yyy)
where appropriate. If T::unsmob already exists, it is used
instead (apart from inside of its own definition, of course).
Total comments: 2
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+57 lines, -49 lines) |
Patch |
|
M |
lily/all-font-metrics.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
lily/break-align-engraver.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/break-substitution.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/figured-bass-continuation.cc
|
View
|
1
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
lily/figured-bass-engraver.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/global-context-scheme.cc
|
View
|
1
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
lily/include/smobs.hh
|
View
|
|
1 chunk |
+8 lines, -0 lines |
2 comments
|
Download
|
|
M |
lily/key-signature-interface.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/ledger-line-spanner.cc
|
View
|
1
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
lily/line-spanner.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/measure-grouping-spanner.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/open-type-font-scheme.cc
|
View
|
|
5 chunks |
+10 lines, -10 lines |
0 comments
|
Download
|
|
M |
lily/ottava-bracket.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/page-breaking.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/pango-font-scheme.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
lily/paper-book.cc
|
View
|
1
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
lily/paper-column.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/paper-column-engraver.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/paper-score-scheme.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/performer-group.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/piano-pedal-bracket.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/score.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/spacing-engraver.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/spacing-loose-columns.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
lily/spanner-scheme.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/stem.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/system.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
lily/tie-column.cc
|
View
|
1
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
lily/translator-dispatch-list.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
lily/translator-group.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
Total messages: 7
|