Find looks for given rule and scope on the stack
(pr *Rule, scope lexer.Reg)
| 318 | |
| 319 | // Find looks for given rule and scope on the stack |
| 320 | func (rs *MatchStack) Find(pr *Rule, scope lexer.Reg) (*MatchState, bool) { |
| 321 | for i := range *rs { |
| 322 | r := &(*rs)[i] |
| 323 | if r.Rule == pr && r.Scope == scope { |
| 324 | return r, true |
| 325 | } |
| 326 | } |
| 327 | return nil, false |
| 328 | } |
| 329 | |
| 330 | // AddMatch adds given rule to rule stack at given scope |
| 331 | func (ps *State) AddMatch(pr *Rule, scope lexer.Reg, regs Matches) { |