Renamed package 'greg' to 'regex'

This commit is contained in:
2025-01-30 09:15:29 -05:00
parent ca8d32cd7f
commit aef8152fc1
13 changed files with 9 additions and 9 deletions

19
regex/stateContents.go Normal file
View File

@@ -0,0 +1,19 @@
package regex
type stateContents []int // Represents the contents of the current state - character classes can have multiple contents, which is why it is represented as a slice
func newContents(data ...int) stateContents {
toReturn := stateContents{}
for _, i := range data {
toReturn = append(toReturn, i)
}
return toReturn
}
func rune2Contents(data []rune) stateContents { // Convert a rune slice into a stateContents type, then return it. The runes are simply cast to ints.
toReturn := newContents()
for _, r := range data {
toReturn = append(toReturn, int(r))
}
return toReturn
}