<TextBlock Height="14"
x:Name="TextBlock1"
Text="Vertical Bottom to Up" Margin="73,0,115,0" RenderTransformOrigin="0.5,0.5" >
<TextBlock.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-90"/>
<TranslateTransform/>
</TransformGroup>
</TextBlock.RenderTransform>
</TextBlock>
Чтобы отобразить номер строки в определении функции, вам нужно будет перебрать исходный файл в поисках определений функций, а затем распечатать текущий, когда вы встретите целевой номер строки. Например, что-то вроде этого:
# look for function definitions and record the function name
# in the func_name variable. This looks for lines matching the pattern
# function <space> <identifier>(<anything>), and records the
# <identifier> part in func_name.
/function [[:alpha:]][[:alnum:]]* *([^)]*)/ {
func_name = [110]
func_name = gensub("function *", "", 1, func_name)
func_name = gensub(" *\\(.*", "", 1, func_name)
}
# when we reach the target line number, print out the current
# value of func_name. In awk, the variable NR represents the
# current line number, and target is a variable we expect to be
# passed in on the command line.
NR == target {
print func_name
}
Если вы поместите это в файл с именем findline.awk
и назовете его так:
awk -f findline.awk -vtarget=26 mysourcefile.src
Тогда он напечатает имя функция, которая содержит строку 26. Этот сценарий не очень устойчив, но, надеюсь, даст вам некоторые идеи о том, как действовать.
Подробнее о функции gensub
см. Документацию awk .
Вы можете попробовать решение Perl, как показано ниже
$ perl -0777 -ne ' while( /function\s+(\w+).+?endfunction/sg) { print "$1\n" } ' tulamba.log
abc_1234
def_442
ghi
$