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

Method IsMatch

parse/parser/state.go:338–345  ·  view source on GitHub ↗

IsMatch looks for rule at given scope in list of matches, if found returns match state info

(pr *Rule, scope lexer.Reg)

Source from the content-addressed store, hash-verified

336// IsMatch looks for rule at given scope in list of matches, if found
337// returns match state info
338func (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

Callers 2

MatchMethod · 0.45
MatchGroupMethod · 0.45

Calls 1

FindMethod · 0.45

Tested by

no test coverage detected