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

Method AddMatch

parse/parser/state.go:331–334  ·  view source on GitHub ↗

AddMatch adds given rule to rule stack at given scope

(pr *Rule, scope lexer.Reg, regs Matches)

Source from the content-addressed store, hash-verified

329
330// AddMatch adds given rule to rule stack at given scope
331func (ps *State) AddMatch(pr *Rule, scope lexer.Reg, regs Matches) {
332 rs := &ps.Matches[scope.St.Ln][scope.St.Ch]
333 rs.Add(pr, scope, regs)
334}
335
336// IsMatch looks for rule at given scope in list of matches, if found
337// returns match state info

Callers 2

MatchMethod · 0.80
MatchGroupMethod · 0.80

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected