matchedLines returns the lines in the location that match the regular expression.
(re *regexp.Regexp)
| 211 | // matchedLines returns the lines in the location that match |
| 212 | // the regular expression. |
| 213 | func (loc *Location) matchedLines(re *regexp.Regexp) []Line { |
| 214 | if m := loc.Mapping; m != nil && re.MatchString(m.File) { |
| 215 | return loc.Line |
| 216 | } |
| 217 | var lines []Line |
| 218 | for _, ln := range loc.Line { |
| 219 | if fn := ln.Function; fn != nil { |
| 220 | if !re.MatchString(fn.Name) && !re.MatchString(fn.Filename) { |
| 221 | continue |
| 222 | } |
| 223 | } |
| 224 | lines = append(lines, ln) |
| 225 | } |
| 226 | return lines |
| 227 | } |
| 228 | |
| 229 | // focusedAndNotIgnored looks up a slice of ids against a map of |
| 230 | // focused/ignored locations. The map only contains locations that are |