summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-01-29 22:11:24 +0800
committerGitHub <noreply@github.com>2023-01-29 15:11:24 +0100
commit4459c272ecb8ddb964fa2d34a4dcef3368d807b5 (patch)
tree274a4856b5a4a871f253035434e04bc80f19f978
parent1431f90d8c3d3ed0afcaee62073d5808cea227ff (diff)
downloadNim-4459c272ecb8ddb964fa2d34a4dcef3368d807b5.tar.gz
remove `enumUtilsExist` defines (#21309)
-rw-r--r--compiler/wordrecg.nim21
1 files changed, 4 insertions, 17 deletions
diff --git a/compiler/wordrecg.nim b/compiler/wordrecg.nim
index a9ef31dc2..29a50ac52 100644
--- a/compiler/wordrecg.nim
+++ b/compiler/wordrecg.nim
@@ -130,20 +130,7 @@ const
     wFor, wIf, wReturn, wStatic, wTemplate, wTry, wWhile, wUsing}
 
 
-const enumUtilsExist = compiles:
-  import std/enumutils
-
-when enumUtilsExist:
-  from std/enumutils import genEnumCaseStmt
-  from strutils import normalize
-  proc findStr*[T: enum](a, b: static[T], s: string, default: T): T =
-    genEnumCaseStmt(T, s, default, ord(a), ord(b), normalize)
-
-else:
-  from strutils import cmpIgnoreStyle
-  proc findStr*[T: enum](a, b: static[T], s: string, default: T): T {.deprecated.} =
-    # used for compiler bootstrapping only
-    for i in a..b:
-      if cmpIgnoreStyle($i, s) == 0:
-        return i
-    result = default
+from std/enumutils import genEnumCaseStmt
+from strutils import normalize
+proc findStr*[T: enum](a, b: static[T], s: string, default: T): T =
+  genEnumCaseStmt(T, s, default, ord(a), ord(b), normalize)