diff --git a/bfcodegen/enum-generate.go b/bfcodegen/enum-generate.go index ef51c4d..4d781f8 100644 --- a/bfcodegen/enum-generate.go +++ b/bfcodegen/enum-generate.go @@ -31,13 +31,13 @@ type EnumDef struct { Values []EnumDefVal } -var rexPackage = rext.W(regexp.MustCompile("^package\\s+(?P[A-Za-z0-9_]+)\\s*$")) +var rexPackage = rext.W(regexp.MustCompile(`^package\s+(?P[A-Za-z0-9_]+)\s*$`)) -var rexEnumDef = rext.W(regexp.MustCompile("^\\s*type\\s+(?P[A-Za-z0-9_]+)\\s+(?P[A-Za-z0-9_]+)\\s*//\\s*(@enum:type).*$")) +var rexEnumDef = rext.W(regexp.MustCompile(`^\s*type\s+(?P[A-Za-z0-9_]+)\s+(?P[A-Za-z0-9_]+)\s*//\s*(@enum:type).*$`)) -var rexValueDef = rext.W(regexp.MustCompile("^\\s*(?P[A-Za-z0-9_]+)\\s+(?P[A-Za-z0-9_]+)\\s*=\\s*(?P(\"[A-Za-z0-9_:]+\"|[0-9]+))\\s*(//(?P.*))?.*$")) +var rexValueDef = rext.W(regexp.MustCompile(`^\s*(?P[A-Za-z0-9_]+)\s+(?P[A-Za-z0-9_]+)\s*=\s*(?P("[A-Za-z0-9_:]+"|[0-9]+))\s*(//(?P.*))?.*$`)) -var rexChecksumConst = rext.W(regexp.MustCompile("const ChecksumGenerator = \"(?P[A-Za-z0-9_]*)\"")) +var rexChecksumConst = rext.W(regexp.MustCompile(`const ChecksumGenerator = "(?P[A-Za-z0-9_]*)"`)) func GenerateEnumSpecs(sourceDir string, destFile string) error { diff --git a/ginext/routes.go b/ginext/routes.go index 9d9f196..3b396a0 100644 --- a/ginext/routes.go +++ b/ginext/routes.go @@ -162,7 +162,7 @@ func nameOfFunction(f any) string { fname = fname[:len(fname)-len("-fm")] } - suffix := rext.W(regexp.MustCompile("\\.func[0-9]+$")) + suffix := rext.W(regexp.MustCompile(`\.func[0-9]+(?:\.[0-9]+)*$`)) if match, ok := suffix.MatchFirst(fname); ok { fname = fname[:len(fname)-match.FullMatch().Length()] diff --git a/goextVersion.go b/goextVersion.go index acd4d02..5793344 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.211" +const GoextVersion = "0.0.212" -const GoextVersionTimestamp = "2023-07-26T10:40:42+0200" +const GoextVersionTimestamp = "2023-07-26T10:44:26+0200" diff --git a/rext/wrapper_test.go b/rext/wrapper_test.go index 71bbc75..6fed447 100644 --- a/rext/wrapper_test.go +++ b/rext/wrapper_test.go @@ -8,7 +8,7 @@ import ( func TestGroupByNameOrEmpty1(t *testing.T) { - regex1 := W(regexp.MustCompile("0(?PA+)B(?PC+)0")) + regex1 := W(regexp.MustCompile(`0(?PA+)B(?PC+)0`)) match1, ok1 := regex1.MatchFirst("Hello 0AAAABCCC0 Bye.") @@ -26,7 +26,7 @@ func TestGroupByNameOrEmpty1(t *testing.T) { func TestGroupByNameOrEmpty2(t *testing.T) { - regex1 := W(regexp.MustCompile("0(?PA+)B(?PC+)(?PC+)?0")) + regex1 := W(regexp.MustCompile(`0(?PA+)B(?PC+)(?PC+)?0`)) match1, ok1 := regex1.MatchFirst("Hello 0AAAABCCC0 Bye.") diff --git a/termext/termcolor.go b/termext/termcolor.go index 24a7ba3..8b5b76d 100644 --- a/termext/termcolor.go +++ b/termext/termcolor.go @@ -71,12 +71,12 @@ func SupportsColors() bool { } } - var term256Regex = regexp.MustCompile("(?i)-256(color)?$") + var term256Regex = regexp.MustCompile(`(?i)-256(color)?$`) if term256Regex.MatchString(termenv) { return true } - var termBasicRegex = regexp.MustCompile("(?i)^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux") + var termBasicRegex = regexp.MustCompile(`(?i)^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux`) if termBasicRegex.MatchString(termenv) { return true