summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/commands.nim9
-rw-r--r--compiler/pragmas.nim2
2 files changed, 2 insertions, 9 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index 640e07b1b..cf1e16b28 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -122,13 +122,6 @@ proc splitSwitch(switch: string, cmd, arg: var string, pass: TCmdLinePass,
   elif switch[i] in {':', '=', '['}: arg = substr(switch, i + 1)
   else: invalidCmdLineOption(pass, switch, info)
 
-proc hasKeyValuePair(arg: string): bool =
-  for i in 0..arg.high:
-    if arg[i] in {':', '='}:
-      return true
-
-  return false
-
 proc processOnOffSwitch(op: TOptions, arg: string, pass: TCmdLinePass,
                         info: TLineInfo) =
   case whichKeyword(arg)
@@ -349,7 +342,7 @@ proc processSwitch(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) =
     discard "allow for backwards compatibility, but don't do anything"
   of "define", "d":
     expectArg(switch, arg, pass, info)
-    if hasKeyValuePair(arg):
+    if {':', '='} in arg:
       splitSwitch(arg, key, val, pass, info)
       defineSymbol(key, val)
     else:
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim
index fffb69ca8..c15794b99 100644
--- a/compiler/pragmas.nim
+++ b/compiler/pragmas.nim
@@ -902,7 +902,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int,
       of wIntDefine:
         sym.magic = mIntDefine
       of wStrDefine:
-        sym.magic = mIntDefine
+        sym.magic = mStrDefine
       else: invalidPragma(it)
     else: invalidPragma(it)