|
|
@ -48,12 +48,6 @@ func isNormalChar(c rune) bool {
|
|
|
|
return !slices.Contains(specialChars, c)
|
|
|
|
return !slices.Contains(specialChars, c)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func assert(cond bool) {
|
|
|
|
|
|
|
|
if cond != true {
|
|
|
|
|
|
|
|
panic("Assertion Failed")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Ensure that the given elements are only appended to the given slice if they
|
|
|
|
// Ensure that the given elements are only appended to the given slice if they
|
|
|
|
// don't already exist. Returns the new slice, and the number of unique items appended.
|
|
|
|
// don't already exist. Returns the new slice, and the number of unique items appended.
|
|
|
|
func unique_append[T comparable](slc []T, items ...T) ([]T, int) {
|
|
|
|
func unique_append[T comparable](slc []T, items ...T) ([]T, int) {
|
|
|
|