Commit Graph

5744 Commits

Author SHA1 Message Date
Yuriy Glukhov
1bd0efb067 Fixed crash/interface. Added tests. 2018-03-15 15:49:41 +02:00
Yuriy Glukhov
29bb10b185 Convertion procs for (IpAddress, Port) <-> (SockAddr, Socklen) 2018-03-14 23:14:31 +02:00
Araq
8683c8a389 Merge branch 'devel' of github.com:nim-lang/Nim into devel 2018-03-12 09:02:21 +01:00
Araq
710c1184a3 fixes httpclient documentation comment 2018-03-12 08:59:04 +01:00
ryanc-signiq
67fd7a7f86 FIXUP: Removed +1 causing substr slicing to skip chars on first iteration of while loop (#7312) 2018-03-08 08:33:41 +01:00
c-blake
551d7b7dc1 Add ability for users to elide ':' or '=' when CLI authors pass a (#7297)
* Add ability for users to elide ':' or '=' when CLI authors pass a
non-empty partial symbol table.  Behavior should be identical to the
old behavior if empty partial symbol tables are passed.  "Partialness"
of the symbol table refers to the fact that one need only specify
option keys that are toggles/booleans/do not take arguments, hence
the "NoArg" suffixes in shortNoArg and longNoArg.

commandLineParams() returns seq[TaintedString], so use that consistently
in getopt() and initOptParser(seq[TaintedString]) dropping the taint at
the quoting stage just as with the paramStr() logic.

Fix capitalization inconsistency of cmdLongOption.

Export OptParser.cmd and OptParser.pos so that, at least *in principle*,
users of this API can handle "--" option processing termination or some
"git-like" sub-command stop word with a separate option sub-syntax.
{ Eg., ``case p.key of "": echo "trailing non-option args: ", p.cmd[p.pos..^1]``
or ``case p.kind of cmdArgument: if p.key == "mysubcmd": ...``. }  Really,
searching for the last delimiter before p.pos is probably needed to frame
the trailing text..Not the nicest API, but still possible with effort.

* Make requested changes from string to seq[char]
(see https://github.com/nim-lang/Nim/pull/7297)

* Document new behavior and elaborate on some special cases.

* NoArg => NoVal to be less ambiguous/more clear.

* Add more documentation and an example snippet.

* Tweak language. Clarify still using ':'/'=' is ok.

* Add a test case for new NoVal behavior.
2018-03-08 08:12:34 +01:00
alaviss
566cec74b6 lib/system: Fix programResult documentation (#7307) 2018-03-07 14:46:02 +01:00
Simon Krauter
077ff83b6e Fixes #7212, now with better code (#7302)
When platform is Windows and app type is GUI, an error about missing DLL file is displayed as message box in addition to the console output, which is usually not visible.
2018-03-06 11:58:43 +01:00
Araq
a9974a33f1 more documentation fixes 2018-03-05 23:25:50 +01:00
Andreas Rumpf
0132442c1d strutils.strip: improve the documentation; fixes #7159 2018-03-05 21:45:13 +01:00
Andreas Rumpf
e2094bc6f4 make re.split consistent with strutils.split and other programming languages; refs #7278 2018-03-05 21:39:13 +01:00
Andreas Rumpf
5c8332d871 fixes #7293 2018-03-05 19:46:13 +01:00
cooldome
4790b6d63f Fixes 7283 (#7284) 2018-03-05 19:06:47 +01:00
Araq
86c3832201 development version is 0.18.1 2018-03-05 17:02:19 +01:00
Araq
15e044416f fixes #7291 2018-03-05 13:38:32 +01:00
Araq
e3b6ee85b3 algorithm.nim: change formatting to Nim's defaults 2018-03-05 13:20:50 +01:00
Araq
0c28dcd9e2 Cleanup docs about re.nim 2018-03-05 13:20:49 +01:00
Dominik Picheta
363c703e72 Merge pull request #7289 from alehander42/fix-asyncjs-pragma
Stop replacing all pragmas of a function with asyncjs
2018-03-05 11:12:01 +00:00
Alexander Ivanov
b6c69dd45e Use addPragma 2018-03-05 10:28:17 +02:00
Tim
a568e4dac6 Changes entityToUtf8 implementation from htmlparser and add two procs (#7288)
`entityToUtf8` now supports every entity name and decimal and hexadecimal values from https://dev.w3.org/html5/html-author/charref.

As it finally turned out, the `case` implementation generates even a smaller binary size compared to a `[(name, val)]` implementation.

Additionally the procs `entityToRune` and `runeToEntity` are now available. The last one only generates numeric html entities, so it doesn't need a lookup table.
2018-03-04 21:18:03 +01:00
twetzel59
9079517d71 Resolves #5588: adds openFileStream proc that throws on failure (#7282) 2018-03-04 17:30:28 +01:00
Alexander Ivanov
3bffbf5a4d Stop replacing all pragmas of a function with asyncjs 2018-03-03 16:53:28 +02:00
Araq
855956bf61 bump version to 0.18.0 2018-03-01 21:39:00 +01:00
Dominik Picheta
fa07bb1356 Improves documentation for strformat module.
* Adds description of the difference between ``fmt`` and ``&``.
* Moves runnable examples to bottom of file.
* Separates examples at the top of module better.
2018-03-01 19:07:58 +00:00
Andreas Rumpf
a6c7972086 make travis green again 2018-03-01 16:23:25 +01:00
Araq
ce1047f2ae added -d:nimNoArrayToString define to allow easier porting to 0.18 2018-03-01 09:42:25 +01:00
Andreas Rumpf
51935c47b0 deprecate parseopt2 stdlib module 2018-02-28 23:00:52 +01:00
Dominik Picheta
99ae9269f0 Merge pull request #7251 from zevv/issue-6270-sleepAsync-timer-resolution
Allow float argument to sleepAsync() to allow sub-millisecond resolution
2018-02-28 20:02:17 +00:00
Vindaar
a897371797 move readPasswordFromStdin from rdstdin to terminal (#7266) 2018-02-27 17:49:35 +01:00
Araq
7740b12f21 revert commit 6cf8a72d498f5cb8a532c2ff3259bc7aecf474ef; Windows fixes getch bug 2018-02-27 17:47:19 +01:00
Araq
c9f184401c merged #6512 manually; fixes #6431 2018-02-27 17:43:02 +01:00
Alexander Ivanov
9c7374abcd Fix return (#7225) 2018-02-27 15:23:19 +01:00
Araq
6d4107b783 make the allocator take a special path for allocations bigger than 2GB; fixes #7120 2018-02-27 01:46:52 +01:00
Andreas Rumpf
8a7e9960a4 system.nim: fix harmless typo 2018-02-26 09:08:57 +01:00
Andreas Rumpf
f9b742c72a make osproc.execProcesses more robust 2018-02-25 16:02:52 +01:00
Dominik Picheta
1975998c56 Detect openssl related to outdated openssl and help user solve issue. 2018-02-25 13:34:32 +00:00
Misha Kotwica
ba6e11fc88 Parsecsv mutability (#7253)
* parsecsv: immutable vars into lets

improving readability

* parsecsv.rowEntry: add mutable access
2018-02-24 14:55:38 +01:00
Ico Doornekamp
d6229f20ff Allow float argument to sleepAsync() to allow sub-millisecond resolution 2018-02-23 19:16:11 +01:00
Dominik Picheta
fb3e460f6d Improve SSL error message in httpclient. 2018-02-22 10:49:27 +00:00
antizealot1337
6f0bb6e1f5 Fix style string formatting for cursorBackward and cursorForward (#7243) 2018-02-22 10:01:26 +01:00
konqoro
b0637bc373 Fix toCountTable and newCountTable 2018-02-21 13:22:41 +02:00
Dominik Picheta
ceebfb3e89 Remove repetitive index checks in b30b920751. 2018-02-19 20:00:14 +00:00
data-man
b30b920751 Fix date parsing for a bad inputs 2018-02-19 16:57:17 +03:00
Dominik Picheta
864467ade3 Merges #7226 manually. 2018-02-19 12:14:45 +00:00
Dominik Picheta
c74a65662a Revert "Fixes #4265."
This reverts commit fe6fddb9d8.
2018-02-17 22:24:43 +00:00
Dominik Picheta
fe6fddb9d8 Fixes #4265. 2018-02-17 22:15:28 +00:00
Dominik Picheta
63bc046ddf Fixes #7227. 2018-02-17 19:36:06 +00:00
Dominik Picheta
5476a82c47 Move joyent_http_parser out of stdlib. 2018-02-17 17:53:32 +00:00
Dominik Picheta
fe204a5e73 Fixes #5786. 2018-02-17 17:46:22 +00:00
Dominik Picheta
411b9aeac7 Merge pull request #7228 from endragor/fix-asyncfile-open
Fix AsyncFile open flags. Fixes #5531
2018-02-17 12:08:09 +00:00