@@ -85,20 +85,23 @@ def select_lines(code)
85
85
. select { |l , i | l . include? "$example off#{ @snippet_label } $" }
86
86
. map { |l , i | i }
87
87
88
- raise "Start indices amount is not equal to end indices amount, see #{ @file } , #{ @snippet_label } ." \
88
+ raise "Start indices amount is not equal to end indices amount, " \
89
+ "see #{ @file } , [labeled=#{ @snippet_label } ]." \
89
90
unless startIndices . size == endIndices . size
90
91
91
- raise "No code is selected by include_example, see #{ @file } , #{ @snippet_label } ." \
92
+ raise "No code is selected by include_example, see #{ @file } , [labeled= #{ @snippet_label } ] ." \
92
93
if startIndices . size == 0
93
94
94
95
# Select and join code blocks together, with a space line between each of two continuous
95
96
# blocks.
96
97
lastIndex = -1
97
98
result = ""
98
99
startIndices . zip ( endIndices ) . each do |start , endline |
99
- raise "Overlapping between two example code blocks are not allowed, see #{ @file } , #{ @snippet_label } ." \
100
+ raise "Overlapping between two example code blocks are not allowed, " \
101
+ "see #{ @file } , [labeled=#{ @snippet_label } ]." \
100
102
if start <= lastIndex
101
- raise "$example on$ should not be in the same line with $example off$, see #{ @file } , #{ @snippet_label } ." \
103
+ raise "$example on$ should not be in the same line with $example off$, " \
104
+ "see #{ @file } , [labeled=#{ @snippet_label } ]." \
102
105
if start == endline
103
106
lastIndex = endline
104
107
range = Range . new ( start + 1 , endline - 1 )
0 commit comments