(parent *chain, submatchValues []string, submatchNames []string)
| 50 | } |
| 51 | |
| 52 | func newMatch(parent *chain, submatchValues []string, submatchNames []string) *Match { |
| 53 | m := &Match{parent.clone(), nil, nil} |
| 54 | |
| 55 | if submatchValues != nil { |
| 56 | m.submatchValues = make([]string, len(submatchValues)) |
| 57 | copy(m.submatchValues, submatchValues) |
| 58 | } else { |
| 59 | m.submatchValues = []string{} |
| 60 | } |
| 61 | |
| 62 | m.submatchNames = map[string]int{} |
| 63 | for n, name := range submatchNames { |
| 64 | if name != "" { |
| 65 | m.submatchNames[name] = n |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | return m |
| 70 | } |
| 71 | |
| 72 | // Raw returns underlying submatches attached to Match. |
| 73 | // This is the value originally passed to NewMatch. |
searching dependent graphs…