Skip to content

Commit b8a3299

Browse files
committed
couple comments
1 parent 3a72720 commit b8a3299

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/value_matcher.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,20 @@ type valueMatcher struct {
1919
existsTransitions []*fieldMatcher
2020
}
2121

22+
// smallStep is used by the valueMatcher automaton - every step through the automaton requires a smallTable and for
23+
// some of them, taking the step means you've matched a value and can transition to a new fieldMatcher. Since there
24+
// are lots of steps, we don't want to carry the []*fieldMatcher information around on the vast majority of
25+
// of steps that don't have any such transitions. So a smallStep can be either just a smallTable or ar a smallTable
26+
// with an attached *fieldMatcher slice
2227
type smallStep interface {
2328
SmallTable() *smallTable
2429
SmallTransition() *smallTransition
2530
HasTransition() bool
2631
}
2732

2833
// ValueTerminator - whenever we're trying to match a value, we virtually add one of these as the last character, both
29-
// when building the automaton and matching a value. This simplifies things because you can write a pattern to
30-
// match for example "foo" by writing it as
34+
// when building the automaton and matching a value. This simplifies things because you don't have to treat
35+
// absolute-string-match (only works at last char in value) and prefix match differently.
3136
const ValueTerminator byte = 0xf5
3237

3338
type smallTransition struct {

0 commit comments

Comments
 (0)