Commit Graph

6072 Commits

Author SHA1 Message Date
Joey
559a7615ad Nintendo switch support (#8069)
* Add config section for Nintendo Switch
* Add compiler configuration for Nintendo Switch and it's CPU
* Add specific lib code for Nintendo Switch
* Add GC support for Nintendo Switch
* Update changelog for Nintendo Switch
* Update changelog with more info about fixed paths
* Cleaned up GC memory management a bit
* Relocate docs for Switch
* Rename aarch64NoneElfGcc to nintendoSwitchGCC
* Remove armv8a57
* Fix installer.ini
* Reuse code in linux and amd64
* Add posix defs for nintendo switch
* Add more defined sections for nintendo switch
* Remove old comment
* Add what's not supported for Nintendo Switch docs
* Make nintendoswitch == posix
* Remove DEVKITPRO references from nim.cfg
* Make PR extccomp changes
* Remove Result type alias
* Add separate switch consts file
* Update docs for nintendo switch
* Fix travis errors with undefined consts and add correct wait.h procs
2018-06-27 12:35:09 +02:00
Andreas Rumpf
2a3a128e36 Merge branch 'devel' into typedesc-reforms 2018-06-26 18:33:51 +02:00
Kaushal Modi
4c2e712056 Support setting foreground/background colors to terminal defaults (#8073)
* Support setting foreground/background colors to terminal defaults

Adds fgDefault to ForegroundColor and bgDefault to BackgroundColor
enums.

For Windows console, the default foreground color is assumed to be
white, and the default background color black.

* Add default fg/bg color caching for Windows Console
2018-06-24 03:53:20 -04:00
Federico Ceratto
059ddeee10 Minor doc fix 2018-06-23 14:32:24 +01:00
Oscar Nihlgård
371f87e962 Change inconsistent paramaters in times.nim (#8091) 2018-06-23 09:01:55 -04:00
Andreas Rumpf
cc11aa9698 varints module: critical bugfix 2018-06-22 03:19:30 +02:00
gemath
db68bbe4f7 Pegs AST read access (#8050)
* Make PEG AST nodes readable from outside the module.

* Added a test module for the pegs stdlib module.

* Edited changelog.

* Renamed ``sons`` iterator to ``items``, added ``pairs``, inlined both.

* Updated entry and moved it to the right category.
2018-06-19 18:13:33 +01:00
Andreas Rumpf
3ca11def6d Merge pull request #7771 from nim-lang/nim-in-action-fixes
Higher Nim in Action coverage plus regression fix.
2018-06-19 17:52:05 +02:00
Kaushal Modi
abbf9ba9f7 Convert styledWriteLine and styledEcho to templates
This also fixes a bug in the styledWriteLine behavior where the background color
leaked onto the next newline if that command did not end with resetStyle.

Now it is not necessary to end styledWriteLine calls that set BackgroundColor to
end in resetStyle.
2018-06-18 09:09:23 -04:00
Kaushal Modi
3b5b3deecd Add styledWrite macro
Also:

- Move the tests block to the end of the file
- Fix the older tests
- Add tests for existing styledEcho
- Add new tests for styledWrite

Fixes https://github.com/nim-lang/Nim/issues/8046.
2018-06-18 09:09:23 -04:00
Dominik Picheta
03b073d541 Workaround VM bug in strutils 2018-06-17 23:26:18 +01:00
Kaushal Modi
4616b28c7b Add support for italic and strikethrough ANSI escape codes (#8048)
\e[3m -> italic
    \e[9m -> strikethrough

On terminals not supporting italic text, the text is shown in reverse instead,
and on terminals not supporting strikethrough text, the text is shown as is.
2018-06-17 12:37:41 -04:00
Dominik Picheta
8081a9b3d0 Exports unicode.toUpper/toLower in strutils module. 2018-06-17 00:12:51 +01:00
Zahary Karadjov
fb27357b62 A minimal patch enabling the new typedesc and static types syntax 2018-06-16 16:46:32 +03:00
Zahary Karadjov
7ab1aafc6b stdlib work 2018-06-16 16:46:32 +03:00
Dmitry Atamanov
bf5d619a52 Add MemMapFileStream. Fixes in memFiles. (#7944)
* Add MemMapFileStream

* Added tests

* Fixed bug in memfiles (zero index for string)

* Added flush to changelog

* Attempt to fix Win's nuances

* Fix attempt to fix

* Continue...

* And again...

* Reworked tests (all for win on Win)

* Fixes in flush (Win)

* Replace fn vars to consts

* Added the attempts parameter to the flush

* Replace while to for

* Move to memfiles

* Use Natural instead of uint

* Better error messages for append mode. Handle specific cases.
2018-06-14 17:34:26 +01:00
Araq
894f21eb73 RST hotfix: don't crash in rstnodeToRefname 2018-06-14 15:01:30 +02:00
Andreas Rumpf
2d186f18ec Merge pull request #7950 from Paalon/math-log
Add log for base b of x
2018-06-14 14:02:57 +02:00
Koki Fushimi
5332da2e7c Fix a test 2018-06-14 13:37:37 +09:00
Koki Fushimi
5fc5e37194 Use one same type for two parameters 2018-06-14 13:17:17 +09:00
Federico Ceratto
127556ad63 Update marshal.nim 2018-06-13 23:22:07 +01:00
Federico Ceratto
d1e03c20d2 Add hint on JSON serialization 2018-06-13 23:11:29 +01:00
Andreas Rumpf
89dd1e3592 Merge pull request #8030 from c-blake/devel
hotfix 3221ac0943 broke gc:regions/aka …
2018-06-13 20:01:47 +02:00
Vindaar
e80be6173d Add parse bin int, fixes #8018 (#8020)
* clarify `parseHexInt`, `parseOctInt` docstring and exception msgs

* add `parseBinInt` based on `parseutil.parseBin` implementation

Adds a `parseBinInt`, which parses a binary integer string and returns
it as an integer. This is based on the implementation of
`parseutil.parseBin`, removing the unnecessary parts.

* add tests for all `parse(Hex|Oct|Bin)Int` procs

* replace `parse*Int` proc impls by call to parseutil procs

Replaces the `parse(Hex|Oct|Bin)Int` procedure implementation by calls
to the `parseutil` procs, which receive a mutable argument.

Has the main advantage that the empty string as well as a "prefix
only" string, e.g. "0x" counts as an invalid integer.

Also moves the `parseOctInt` proc further up in the file so that all
`parse` procs are below one another.

* replace `var L` by `let L` in `parse` procs

There's no reason for the usage of `var` here.

* add `maxLen` optional arg for `parseutil.parse(Oct|Bin)`

Plus small change to test cases.

* update changelog about `parse*Int` procs

* fix `rejectParse` template in `tstrutils`

* make sure only `s.len` chars are parsed, if `maxLen+start` > s.len

Fixes a previous bug in `parseHex` (and now affected `parseOct` and
`parseBin`), which allowed to set `start + maxLen` to be larger than
the strings length. This resulted in an out of bounds access.

* move `parse*Int` proc change to breaking changes, add double `
2018-06-13 13:32:12 -04:00
Charles Blake
ed4f1f4c43 hotfix 3221ac0943 broke gc:regions/aka gc:stack by
underallocating for sequences of any type larger than 1 byte.  This does the
necessary multiply to restore basic functionality.
2018-06-13 10:36:47 -04:00
Araq
68ba13c759 fixes merge conflict 2018-06-11 17:05:23 +02:00
Jimmie Houchin
657062145b Added FileMode to comment on asyncfile openAsync (#8008) 2018-06-11 00:53:42 -04:00
Andreas Rumpf
61d9292095 fixes merge conflict 2018-06-11 01:25:48 +02:00
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
Araq
8e9551b1c7 fixex merge conflicts 2018-06-08 19:50:36 +02: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