Commit Graph

6026 Commits

Author SHA1 Message Date
Andreas Rumpf
e00e7fec54 Merge pull request #7873 from ehmry/GenodeEnv
Native access to Genode environment
2018-06-09 09:38:53 +02:00
Andreas Rumpf
d323ee81e4 Merge pull request #8001 from kaushalmodi/fix-isupper-islower-try2
Make isUpper (and variants) work for strings with non-alpha chars
2018-06-09 08:58:08 +02:00
hlaaf
c2aec1b6c1 Change parseEnum to something faster for method parsing in asynchttpserver (#7682)
* Add faster method parsing to asynchttpserver

* Make it readable

* Align case statement
2018-06-08 21:34:19 +01:00
Kaushal Modi
24df909d8a Make isUpper (and variants) work for strings with non-alpha chars
The other variants are isLower, isUpperAscii and isLowerAscii

Fixes https://github.com/nim-lang/Nim/issues/7963.

This commit changes the behavior and signatures of:

- isUpper, isLower in the unicode module
- isUpperAscii, isLowerAscii in the strutils module

A second mandatory parameter skipNonAlpha is added to these 4 procs.

(This change affects only for the case where the input is a *string*.)

---

With skipNonAlpha set to true, the behavior mimics the Python isupper and
islower behavior i.e. non-alphabetic chars/runes are ignored when checking if
the string is upper-case or lower-case.

    Before this commit:

      doAssert(not isUpper("A B"))

    After this commit:

      doAssert(not isUpper("A B", false))    <-- old behavior
      doAssert isUpper("A B", true)

      Below two are equivalent:

                           isUpper("A B", true)

        isAlpha("A B") and isUpper("A B", false)

.. and the similar for other 3 procs.
2018-06-08 15:14:29 -04:00
data-man
3e799d7876 Removed redundant conditions in CritBitTree.inc, speedup it. 2018-06-08 19:29:19 +03:00
Dmitry Atamanov
fbd91a474a Add the val parameter for CritBitTree[T].incl (#7988)
* Add the val parameter for CritBitTree[T].incl

* Updated changelog
2018-06-08 12:01:40 -04:00
Andreas Rumpf
e273ef4f5e Merge pull request #7992 from yglukhov/fromSockAddr-compile-error
Fixed compilation error when Sockaddr_in4 or Sockaddr_in6 passed to fromSockAddr
2018-06-08 13:38:39 +02:00
Araq
3c7bbfebb1 fixes seq copying in channels for --gc:regions 2018-06-07 21:35:41 +02:00
Yuriy Glukhov
b2323de914 Fixed compilation error when Sockaddr_in4 or Sockaddr_in6 passed to fromSockAddr 2018-06-07 21:10:00 +03:00
data-man
12f929e582 Fixed bug in CritBitTree.inc. Fixes #7990. 2018-06-07 19:29:40 +03:00
data-man
aa7348b356 Quote a keys for CritBitTree $ impl. Fixes #7987 2018-06-07 18:39:46 +03:00
Andreas Rumpf
e06f5bc3d0 Merge pull request #7806 from survivorm/feature/times_mutators
Feature/times mutators
2018-06-07 17:17:30 +02:00
cheatfate
2902308a05 Fix one more place. 2018-06-07 13:06:06 +03:00
cheatfate
46a6fa53a9 Fix fromSockAddrAux() to handle IPv6 addresses properly. 2018-06-07 12:33:29 +03:00
Andreas Rumpf
e67eddc91b Merge pull request #7822 from data-man/fix_2753
Fixes #2753
2018-06-07 10:40:50 +02:00
Emery Hemingway
5e54cd9fc9 Set Genode Openssl shared-object strings 2018-06-07 07:21:31 +02:00
Emery Hemingway
22f714585b Native access to Genode environment
Add a 'GenodeEnv' type and a 'componentConstructHook' to the system
module. The 'componentConstructHook' allows for detection of POSIX style
programs that exit implicitly or native Genode components that
initialize to serve RPC requests and OS signals.

This hook takes a 'GenodeEnv' argument so that the environment interface
is passed cleanly to application code after globals are initialized.
This is an typed pointer to a C++ object, procedures for accessing the
environment will be available from a Nimble library and not included in
the standard library.

The standard library has an internal pointer to the environment object
but this is not for external use, the undocumented global environment
pointer has been removed.
2018-06-07 07:21:20 +02:00
Dominik Picheta
6ee6f252d4 Rip out the try transformation in the async macro. 2018-06-06 19:18:24 +03:00
Michael Voronin
b7a8eef87a [change] Replace mutators with their more generic versions 2018-06-06 13:10:56 +03:00
Andreas Rumpf
e957d369b1 Merge pull request #7907 from GULPF/lexer-unicode-fix
Lexer fix for multi byte characters
2018-06-06 11:42:59 +02:00
Andreas Rumpf
8804ecd175 Merge pull request #7966 from hlaaftana/patch-4
Fix GC_getStatistics calling itself GC_disableMarkAndSweep in JS (again)
2018-06-06 11:07:21 +02:00
hlaaf
7c71e1b058 Fix GC_getStatistics calling itself GC_disableMarkAndSweep in JS (again) 2018-06-06 00:39:07 +03:00
hlaaf
a0cb1a80dd Allow % overloading in %* macro in json (again) 2018-06-06 00:36:56 +03:00
Andreas Rumpf
3cbc07ac78 Merge pull request #7770 from yglukhov/yield-in-try
Yield in try
2018-06-05 19:58:00 +02:00
Kaushal Modi
0321ea36c9 Fix typo: PRCE -> PCRE 2018-06-05 12:58:23 -04:00
Koki Fushimi
959b6354c1 Rename tgamma to gamma (#7929)
* Rename tgamma to gamma

* set the deprecating version  0.19.0

* update changelog and use description in deprecated pragma
2018-06-05 11:15:04 -04:00
skilchen
230692a22f Fix strformat neg zero (#7954)
* fix strformat handling of neg zero with sign

* better tests for neg zero with sign

* use inplace insertion of the sign as suggested by Varriount
2018-06-05 00:09:07 -04:00
skilchen
fd102f39bb Fix strformat precision handling for strings (#7941)
* fix strformat precision handling for strings

* add some limited unicode awareness to the precision handling for strings

* improvement suggested by Varriount: use setLen and runeOffset instead of runeSubstr
2018-06-04 18:26:16 -04:00
Koki Fushimi
a3e5242d31 Add product proc (#7951)
* Add product proc

* Update changelog
2018-06-04 18:24:34 -04:00
Oscar Nihlgård
05b447374b Use higher time resolution when available in os.nim (#7709) 2018-06-04 14:56:56 +02:00
Andreas Rumpf
582786d068 db_mysql.nim: Work around string nil comparison logic 2018-06-04 12:20:56 +02:00
Yuriy Glukhov
395b7506cf Expose GC_setStackBottom (#7885) 2018-06-04 11:12:18 +02:00
Varriount
381acc09e9 Update sqlite example to use empty strings.
Update sqlite example to use empty strings to use empty strings instead of nil.
2018-06-03 14:37:41 -04:00
Oscar Nihlgård
fd28236368 Multi byte characters should not be treated as part of an operator 2018-06-03 09:05:50 +02:00
skilchen
91765e583d fix handling of default precision in formatBiggestFloat for the js backend (#7928) 2018-06-01 22:24:32 -04:00
skilchen
07ff9940f4 fix strformat zeropadding for floats (#7934) 2018-06-01 22:23:50 -04:00
data-man
b4626a220b Added $ for openarrays. Fixes #7940. 2018-06-01 21:28:23 +03:00
Federico Ceratto
cb87bba82f Update example (#7788) 2018-06-01 11:28:20 -04:00
Koki Fushimi
3acedd4cd9 Add imaginary unit. (#7922) 2018-06-01 11:20:28 -04:00
Koki Fushimi
3027ca292c Support div, mod, floorDiv and floorMod for Rationals (#7918)
* Support `div`, `mod`, floorDiv and floorMod for Ratinoals.

* Bug fix and add tests.

* Update changelog
2018-06-01 11:19:25 -04:00
Torro
637ee7a151 Add note to import "std/sha1" to sha1.nim (doc) 2018-06-01 16:20:30 +02:00
Dominik Picheta
16a42f4ffa Merge branch 'feature/times_fixup' of https://github.com/survivorm/Nim into survivorm-feature/times_fixup 2018-05-31 15:03:54 +01:00
Michael Voronin
5da74d5979 [add] Add fraction of seconds to parse/format utils 2018-05-31 16:09:48 +03:00
Michael Voronin
8aeb24b4fd [add] add between function to calculate TI between two datetimes 2018-05-31 16:02:40 +03:00
Michael Voronin
11fcc83f8a [add] Add procs for TimeInterval stringify 2018-05-31 16:02:37 +03:00
Michael Voronin
a573577cdc [add+change] Added toDurationParts proc to convert Duration to array[FixedTimeUnit, int64] of it's human-readable parts, use it in $Duration 2018-05-31 16:01:58 +03:00
data-man
664b949d54 Better error messages in scanf. 2018-05-30 23:49:56 +03:00
data-man
1bbd83de3f Removed spaces in math module 2018-05-30 20:55:53 +03:00
Oscar Nihlgård
65070a6936 Use truncation division in mod for floats (#7118)
* Use truncation division in mod for floats

* Add changelog entry

* Add floorDiv/floorMod to math.nim

* Update changelog
2018-05-30 19:14:21 +03:00
Koki Fushimi
2107c81d6d Add inverse hyperbolic, and cot, sec and csc; and their hyperbolic, inverse, inverse hyperbolic, and change to use defined functions in C or JS for logs and hyperbolics. (#7893)
* Add secant, cosecant and cotangent.

* Add hyperbolic functions of cotangent, secant and cosecant.

* Add inverse hyperbolic functions.

* Change to use defined function of C and JS.

* Bug fix and refactoring.

* Add change to changelog.md
2018-05-30 15:29:34 +01:00