MCPcopy Create free account
hub / github.com/AdRoll/baker / parseClause

Method parseClause

filter/clausefilter.go:236–249  ·  view source on GitHub ↗
(ClauseRaw string)

Source from the content-addressed store, hash-verified

234}
235
236func (f *ClauseFilter) parseClause(ClauseRaw string) Clause {
237 ClauseString := strings.TrimLeft(strings.TrimRight(ClauseRaw, " \r\n\t"), " \r\n\t")
238 if len(ClauseString) == 0 {
239 return Clause{clauseType: true_clause}
240 }
241
242 buf := bytes.NewBufferString(ClauseString)
243 var ctx sexp.SourceContext
244 file := ctx.AddFile("clause", 1)
245 top, _ := sexp.Parse(buf, file)
246 clause := top.Children
247
248 return f.parseClauseSexp(clause)
249}
250
251func (f *ClauseFilter) matchClause(l baker.Record, clause *Clause) bool {
252 switch clause.clauseType {

Callers 2

TestClauseParserFunction · 0.95
NewClauseFilterFunction · 0.95

Calls 2

parseClauseSexpMethod · 0.95
ParseMethod · 0.65

Tested by 1

TestClauseParserFunction · 0.76