From 1ba871d6186bdca11d3082958f61a4da801dafea Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Wed, 20 Nov 2024 10:38:22 -0500 Subject: [PATCH] Removed dotChars() function, moved notDotChars() setting to main() --- misc.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/misc.go b/misc.go index 5028a80..7bbb8eb 100644 --- a/misc.go +++ b/misc.go @@ -7,20 +7,9 @@ import ( var whitespaceChars = []rune{' ', '\t', '\n'} var digitChars = []rune{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} var wordChars = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_") -var notDotChars = []rune{'\n'} var LBRACKET rune = 0xF0000 var RBRACKET rune = 0xF0001 -var ANY_CHAR rune = 0xF0002 // Represents any character - used for 'dot' metacharacter - -func dotChars() []rune { // Returns all possible characters represented by the dot metacharacter - this is too tedious to define as a variable, which is why it is a function - start := 0x0020 - end := 0x007E - to_return := make([]rune, (end-start)+1) - for i := start; i <= end; i++ { - to_return[i-start] = rune(i) - } - return to_return -} +var ANY_CHAR rune = 0xF0002 // Represents any character - used for states where the allChars flag is on. // Returns true if str[idx] and str[idx-1] are separated by a word boundary. func isWordBoundary(str []rune, idx int) bool {