-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Make parseopt correct (and based on seq[string] as parameters, not string) #730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I can't edit it - trick with asking git to ignore whitespace doesn't work if I need to change indention level.
commandLineParams returns seq of arguments given to program on command line.
…rings, not single string.
|
Maybe it's getting there, but there still are problems running It seems that the |
|
It doesn't. Option is split on = before :. I guess I need to change priority. |
|
It should work now. Btw |
Make parseopt correct (and based on seq[string] as parameters, not string)
This reverts commit a54ba4c to avoid tool breakage. A different approach is being worked on nim-lang#730.
Make parseopt correct (and based on seq[string] as parameters, not string)
## Summary Create a copy of the token before calling `parsePragma` in `identWithPragma`, which fixes a subtle issue where the `Token.literal` string pointed to already-freed heap memory. ## Details For a call such as `p(a, p2(a))` where `proc p(x: ObjType)` and `proc p2(x: var ObjType)`, the *C code-generator* introduces a shallow temporary that captures the state of `a` prior to the evaluating `p2(a)`, with the temporary then being passed to `p` in the place of `a`. This is done in order to uphold the left-to-right evaluation guarantees. However, if the `ObjType` stores indirections such as `seq` or `string`, updates of their contents are still observable through the shallow temporary, and should `p2` resize the `seq` or `string`, the pointer in the shallow temporary becomes dangling.
Fixes #726, possibly #274, and fixes regression introduced by #702. And I hope it doesn't break new things.
Sorry for "Normalize whitespace in os.nim", but I'd rather spend time fixing Nimrod, than doing nasty tricks in bash or reconfiguring my editor. (and we all don't like trailing whitespace?)
New code in
parseopt.nimadheres to the following "specification":There is also a new test -
tests/system/params.nim. I'm not sure if it works on Windows.