MCPcopy Create free account
hub / github.com/cogentcore/core / Find

Method Find

parse/parser/state.go:320–328  ·  view source on GitHub ↗

Find looks for given rule and scope on the stack

(pr *Rule, scope lexer.Reg)

Source from the content-addressed store, hash-verified

318
319// Find looks for given rule and scope on the stack
320func (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
331func (ps *State) AddMatch(pr *Rule, scope lexer.Reg, regs Matches) {

Callers 1

IsMatchMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected