0069仕様書無しさん
2017/02/05(日) 10:13:14.79#linesOfCode のソースはこんな感じ。コメントは含むが空行は除く。
CompiledMethod >> linesOfCode
"An approximate measure of lines of code.
Includes comments, but excludes empty lines."
| lines |
lines := 0.
self getSource asString lineIndicesDo: [:start :endWithoutDelimiters :end |
endWithoutDelimiters > start ifTrue: [lines := lines+1]].
^lines