Last active
August 29, 2015 14:04
-
-
Save bogen/bab5f91dfeaf24cf68d6 to your computer and use it in GitHub Desktop.
os::parseCmdLine fails on multiline strings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, macros | |
macro huh (cmd1, cmd2: expr) : stmt = | |
let cs = toStrLit(callsite ()) | |
echo "entering ", cs | |
echo parseCmdLine ($cmd1) | |
var a = $cmd2 | |
echo a | |
echo "leaving ", cs, "\n" | |
discard | |
macro huh2 () : stmt = | |
let cs = toStrLit(callsite ()) | |
echo "entering ", cs | |
echo parseCmdLine ("""1 2 3""") | |
echo "leaving ", cs, "\n" | |
discard | |
macro huh3 () : stmt = | |
let cs = toStrLit(callsite ()) | |
echo "entering ", cs | |
echo parseCmdLine (""" | |
one | |
two | |
three | |
""") | |
echo "leaving ", cs, "\n" | |
discard | |
huh "4 5", dog | |
huh2 | |
huh3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entering huh "4 5", dog | |
@[4, 5] | |
dog | |
leaving huh "4 5", dog | |
entering huh2 | |
@[1, 2, 3] | |
leaving huh2 | |
entering huh3 | |
stack trace: (most recent call last) | |
cmd.nim(22) huh3 | |
lib/nimrod/pure/os.nim(1450) parseCmdLine | |
lib/nimrod/pure/os.nim(1450, 10) Error: interpretation requires too many iterations |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment