IsMatch looks for rule at given scope in list of matches, if found returns match state info
(pr *Rule, scope lexer.Reg)
| 336 | // IsMatch looks for rule at given scope in list of matches, if found |
| 337 | // returns match state info |
| 338 | func (ps *State) IsMatch(pr *Rule, scope lexer.Reg) (*MatchState, bool) { |
| 339 | rs := &ps.Matches[scope.St.Ln][scope.St.Ch] |
| 340 | sz := len(*rs) |
| 341 | if sz == 0 { |
| 342 | return nil, false |
| 343 | } |
| 344 | return rs.Find(pr, scope) |
| 345 | } |
| 346 | |
| 347 | // RuleString returns the rule info for entire source -- if full |
| 348 | // then it includes the full stack at each point -- otherwise just the top |
no test coverage detected