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

Method CheckRule

parse/parser/trace.go:88–105  ·  view source on GitHub ↗

CheckRule checks if given rule should be traced

(rule string)

Source from the content-addressed store, hash-verified

86
87// CheckRule checks if given rule should be traced
88func (pt *TraceOptions) CheckRule(rule string) bool {
89 if len(pt.RulesList) == 0 {
90 if pt.Rules != "" {
91 pt.Init()
92 if len(pt.RulesList) == 0 {
93 return true
94 }
95 } else {
96 return true
97 }
98 }
99 for _, rn := range pt.RulesList {
100 if rn == rule {
101 return true
102 }
103 }
104 return false
105}
106
107// Out outputs a trace message -- returns true if actually output
108func (pt *TraceOptions) Out(ps *State, pr *Rule, step Steps, pos lexer.Pos, scope lexer.Reg, ast *AST, msg string) bool {

Callers 1

OutMethod · 0.95

Calls 1

InitMethod · 0.95

Tested by

no test coverage detected