@@ -14,10 +14,11 @@ type slotData struct {
1414var emptySlotData slotData
1515
1616type FastMatcher struct {
17- def MatchDef
18- slots []slotData
19- buckets * binTreeState
20- tokens jsonTokenizer
17+ def MatchDef
18+ slots []slotData
19+ buckets * binTreeState
20+ tokens jsonTokenizer
21+ collateUsed bool
2122}
2223
2324func NewFastMatcher (def * MatchDef ) * FastMatcher {
@@ -292,11 +293,10 @@ func (m *FastMatcher) matchOp(op *OpNode, litVal *FastVal) error {
292293 }
293294
294295 // Mark the result of this operation
296+ m .buckets .MarkNode (bucketIdx , opRes )
297+
295298 if ! validOp {
296- // TODO FIX
297- m .buckets .MarkNode (bucketIdx , false )
298- } else {
299- m .buckets .MarkNode (bucketIdx , opRes )
299+ m .collateUsed = true
300300 }
301301
302302 // Check if running this values ops has resolved the entirety
@@ -832,6 +832,15 @@ func (m *FastMatcher) Match(data []byte) (bool, error) {
832832 return m .buckets .IsTrue (0 ), nil
833833}
834834
835+ func (m * FastMatcher ) MatchWithStatus (data []byte ) (bool , int , error ) {
836+ var statusFlags int
837+ matched , err := m .Match (data )
838+ if m .collateUsed {
839+ statusFlags |= MatcherCollateUsed
840+ }
841+ return matched , statusFlags , err
842+ }
843+
835844func (m * FastMatcher ) ExpressionMatched (expressionIdx int ) bool {
836845 binTreeIdx := m .def .MatchBuckets [expressionIdx ]
837846 return m .buckets .IsResolved (binTreeIdx ) &&
0 commit comments