Use my regex engine instead of the stdlib one

This commit is contained in:
2025-04-21 23:02:20 -04:00
parent 23e9c5d58d
commit 40858a673a
6 changed files with 22 additions and 11 deletions

View File

@@ -6,11 +6,11 @@ import (
"io/fs"
"os"
"path/filepath"
"regexp"
"runtime"
"strings"
"gitea.twomorecents.org/Rockingcool/ccat/stack"
"gitea.twomorecents.org/Rockingcool/kleingrep/regex"
"gopkg.in/yaml.v2"
)
@@ -88,13 +88,13 @@ func loadConfig(configFilename string) (stack.Stack[regColor], error) {
// returned.
regColorStack := stack.NewStack[regColor](len(strings.Split(string(configFile), "\n"))) // The stack will have the same size as the number of lines in the file
for _, item := range tempMapSlice {
re := regexp.MustCompile(item.Key.(string))
re := regex.MustCompile(item.Key.(string))
clr, err := newColor(item.Value.(string))
if err != nil {
return *stack.NewStack[regColor](0), err
}
// If we got past the errors, then the color _must_ be valid.
regColorStack.Push(regColor{re, clr})
regColorStack.Push(regColor{&re, clr})
}
return *regColorStack, nil