typestateContents[]int// Represents the contents of the current state - character classes can have multiple contents, which is why it is represented as a slice
typestateContents[]int// Represents the contents of the current state - character classes can have multiple contents, which is why it is represented as a slice
funcnewContents()stateContents{
funcnewContents(data...int)stateContents{
toReturn:=stateContents{}
toReturn:=stateContents{}
for_,i:=rangedata{
toReturn=append(toReturn,i)
}
returntoReturn
}
funcrune2Contents(data[]rune)stateContents{// Convert a rune slice into a stateContents type, then return it. The runes are simply cast to ints.