From 6850396bf98a6ee22601272e5404b36a8a7c4e84 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Wed, 22 Jan 2025 16:51:00 -0500 Subject: [PATCH] Removed character range creation from the first part of shuntingYard() (the part that adds concatenation operators), because octal and hex values haven't yet been deciphered at this point in the code --- compile.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/compile.go b/compile.go index 1161a58..8f8eb8c 100644 --- a/compile.go +++ b/compile.go @@ -155,21 +155,6 @@ func shuntingYard(re string, flags ...ReFlag) ([]postfixNode, error) { i++ // Skip all characters inside _unescaped_ brackets (we are _not_ at a closing bracket, or if we are, the previous character is a backslash) // TODO: Check for escaped characters - // Check ahead for character range - if i < len(re_runes)-2 && re_runes[i+1] == '-' { - rangeStart := re_runes[i] - rangeEnd := re_runes[i+2] - if int(rangeEnd) < int(rangeStart) { - return nil, fmt.Errorf("Range is out of order.") - } - - for i := rangeStart; i <= rangeEnd; i++ { - toAppend = append(toAppend, i) - } - - i += 2 // Skip start and hyphen (end will automatically be skipped on next iteration of loop) - continue - } toAppend = append(toAppend, re_runes[i]) } // Replace the last character (which should have been ']', with RBRACKET