From 7aee4280cceac2a9d7cdba14227c98d153b4c22f Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Thu, 30 Jan 2025 10:36:10 -0500 Subject: [PATCH] Renamed 'EPSILON' to 'epsilon' to avoid exporting --- regex/nfa.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/regex/nfa.go b/regex/nfa.go index cf68341..42c0eff 100644 --- a/regex/nfa.go +++ b/regex/nfa.go @@ -5,7 +5,7 @@ import ( "slices" ) -const EPSILON int = 0xF0000 +const epsilon int = 0xF0000 type assertType int @@ -276,7 +276,7 @@ func kleene(s1 nfaState) (*nfaState, error) { toReturn := &nfaState{} toReturn.transitions = make(map[int][]*nfaState) - toReturn.content = newContents(EPSILON) + toReturn.content = newContents(epsilon) toReturn.isEmpty = true toReturn.isKleene = true toReturn.output = append(toReturn.output, toReturn) @@ -307,7 +307,7 @@ func alternate(s1 *nfaState, s2 *nfaState) *nfaState { for _, c := range s2.content { toReturn.transitions[c], _ = unique_append(toReturn.transitions[c], s2) } - toReturn.content = newContents(EPSILON) + toReturn.content = newContents(epsilon) toReturn.isEmpty = true return toReturn @@ -316,7 +316,7 @@ func alternate(s1 *nfaState, s2 *nfaState) *nfaState { func question(s1 *nfaState) *nfaState { // Use the fact that ab? == a(b|) s2 := &nfaState{} s2.transitions = make(map[int][]*nfaState) - s2.content = newContents(EPSILON) + s2.content = newContents(epsilon) s2.output = append(s2.output, s2) s2.isEmpty = true s3 := alternate(s1, s2) @@ -341,7 +341,7 @@ func newState() nfaState { // Creates and returns a state that _always_ has a zero-length match. func zeroLengthMatchState() nfaState { start := newState() - start.content = newContents(EPSILON) + start.content = newContents(epsilon) start.isEmpty = true start.assert = alwaysTrueAssert return start