Merge branch 'devel' of github.com:nim-lang/Nim into devel

This commit is contained in:
Andreas Rumpf 2018-01-25 16:02:22 +01:00
commit 394757dbf5
6 changed files with 60 additions and 57 deletions

View file

@ -35,7 +35,7 @@ proc isUndefined[T](x: T): bool {.inline.} = {.emit: "`result` = `x` === undefin
proc reprEnum(e: int, typ: PNimType): string {.compilerRtl.} = proc reprEnum(e: int, typ: PNimType): string {.compilerRtl.} =
if not typ.node.sons[e].isUndefined: if not typ.node.sons[e].isUndefined:
result = $typ.node.sons[e].name result = makeNimstrLit(typ.node.sons[e].name)
else: else:
result = $e & " (invalid data!)" result = $e & " (invalid data!)"

View file

@ -92,7 +92,7 @@ This project exists thanks to all the people who contribute. [Read on to find ou
<a href="https://github.com/nim-lang/Nim/graphs/contributors"><img src="https://opencollective.com/Nim/contributors.svg?width=890" /></a> <a href="https://github.com/nim-lang/Nim/graphs/contributors"><img src="https://opencollective.com/Nim/contributors.svg?width=890" /></a>
## Contributing ## Contributing
[![Backers on Open Collective](https://opencollective.com/nim/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/nim/sponsors/badge.svg)](#sponsors) [![Contribute to Nim via Gratipay][badge-nim-gratipay]][nim-gratipay] [![Backers on Open Collective](https://opencollective.com/nim/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/nim/sponsors/badge.svg)](#sponsors)
[![Setup a bounty via Bountysource][badge-nim-bountysource]][nim-bountysource] [![Setup a bounty via Bountysource][badge-nim-bountysource]][nim-bountysource]
[![Donate Bitcoins][badge-nim-bitcoin]][nim-bitcoin] [![Donate Bitcoins][badge-nim-bitcoin]][nim-bitcoin]
@ -137,7 +137,6 @@ You can also help with the development of Nim by making donations. Donations can
made using: made using:
* [Open Collective](https://opencollective.com/nim) * [Open Collective](https://opencollective.com/nim)
* [Gratipay][nim-gratipay]
* [Bountysource][nim-bountysource] * [Bountysource][nim-bountysource]
* [Bitcoin][nim-bitcoin] * [Bitcoin][nim-bitcoin]
@ -189,7 +188,6 @@ Copyright © 2006-2017 Andreas Rumpf, all rights reserved.
[nim-stackoverflow]: https://stackoverflow.com/questions/tagged/nim [nim-stackoverflow]: https://stackoverflow.com/questions/tagged/nim
[nim-stackoverflow-newest]: https://stackoverflow.com/questions/tagged/nim?sort=newest&pageSize=15 [nim-stackoverflow-newest]: https://stackoverflow.com/questions/tagged/nim?sort=newest&pageSize=15
[nim-gitter]: https://gitter.im/nim-lang/Nim [nim-gitter]: https://gitter.im/nim-lang/Nim
[nim-gratipay]: https://gratipay.com/nim/
[nim-bountysource]: https://www.bountysource.com/teams/nim [nim-bountysource]: https://www.bountysource.com/teams/nim
[nim-bitcoin]: https://blockchain.info/address/1BXfuKM2uvoD6mbx4g5xM3eQhLzkCK77tJ [nim-bitcoin]: https://blockchain.info/address/1BXfuKM2uvoD6mbx4g5xM3eQhLzkCK77tJ
[nimble-repo]: https://github.com/nim-lang/nimble [nimble-repo]: https://github.com/nim-lang/nimble
@ -201,7 +199,6 @@ Copyright © 2006-2017 Andreas Rumpf, all rights reserved.
[badge-nim-forum-gethelp]: https://img.shields.io/badge/Forum-get%20help-4eb899.svg?style=flat-square [badge-nim-forum-gethelp]: https://img.shields.io/badge/Forum-get%20help-4eb899.svg?style=flat-square
[badge-nim-twitter]: https://img.shields.io/twitter/follow/nim_lang.svg?style=social [badge-nim-twitter]: https://img.shields.io/twitter/follow/nim_lang.svg?style=social
[badge-nim-stackoverflow]: https://img.shields.io/badge/stackoverflow-nim_tag-yellow.svg?style=flat-square [badge-nim-stackoverflow]: https://img.shields.io/badge/stackoverflow-nim_tag-yellow.svg?style=flat-square
[badge-nim-gratipay]: https://img.shields.io/gratipay/team/nim.svg?style=flat-square
[badge-nim-bountysource]: https://img.shields.io/bountysource/team/nim/activity.svg?style=flat-square [badge-nim-bountysource]: https://img.shields.io/bountysource/team/nim/activity.svg?style=flat-square
[badge-nim-bitcoin]: https://img.shields.io/badge/bitcoin-1BXfuKM2uvoD6mbx4g5xM3eQhLzkCK77tJ-D69134.svg?style=flat-square [badge-nim-bitcoin]: https://img.shields.io/badge/bitcoin-1BXfuKM2uvoD6mbx4g5xM3eQhLzkCK77tJ-D69134.svg?style=flat-square
[pull-request-instructions]: https://help.github.com/articles/using-pull-requests/ [pull-request-instructions]: https://help.github.com/articles/using-pull-requests/

View file

@ -77,6 +77,12 @@ block enums:
doAssert(repr(heB) == "heB") doAssert(repr(heB) == "heB")
doAssert(repr(heC) == "heC") doAssert(repr(heC) == "heC")
block emums_and_unicode: #6741
type K = enum Kanji = "漢字"
let kanji = Kanji
doAssert(kanji == Kanji, "Enum values are not equal")
doAssert($kanji == $Kanji, "Enum string values are not equal")
block chars: block chars:
let let
a = 'a' a = 'a'

View file

@ -1,8 +1,8 @@
#ifdef WIN #ifdef WIN
#include <windows.h> #include <windows.h>
#else #else
#include <dlfcn.h> #include <dlfcn.h>
#include <unistd.h> /* for sleep(3) */
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View file

@ -1,21 +1,21 @@
Test the realtime GC without linking nimrtl.dll/so. Test the realtime GC without linking nimrtl.dll/so.
Note, this is a long running test, default is 35 minutes. To change the Note, this is a long running test, default is 35 minutes. To change the
the run time see RUNTIME in main.nim and main.c. the run time see RUNTIME in nmain.nim and cmain.c.
You can build shared.nim, main.nim, and main.c by running make (nix systems) You can build shared.nim, nmain.nim, and cmain.c by running make (nix systems)
or maike.bat (Windows systems). They both assume GCC and that it's in your or make.bat (Windows systems). They both assume GCC and that it's in your
path. Output: shared.(dll/so), camin(.exe), nmain(.exe). path. Output: shared.(dll/so), cmain(.exe), nmain(.exe).
To run the test: execute either nmain or cmain in a shell window. To run the test: execute either nmain or cmain in a shell window.
To build buy hand: To build by hand:
- build the shared object (shared.nim): - build the shared object (shared.nim):
$ nim c shared.nim $ nim c tests/realtimeGC/shared.nim
- build the client executables: - build the client executables:
$ nim c -o:nmain main.nim $ nim c --threads:on tests/realtimeGC/nmain.nim
$ gcc -o cmain main.c -ldl $ gcc -o tests/realtimeGC/cmain tests/realtimeGC/cmain.c -ldl

View file

@ -167,9 +167,9 @@ proc gcTests(r: var TResults, cat: Category, options: string) =
proc longGCTests(r: var TResults, cat: Category, options: string) = proc longGCTests(r: var TResults, cat: Category, options: string) =
when defined(windows): when defined(windows):
let cOptions = "gcc -ldl -DWIN" let cOptions = "-ldl -DWIN"
else: else:
let cOptions = "gcc -ldl" let cOptions = "-ldl"
var c = initResults() var c = initResults()
# According to ioTests, this should compile the file # According to ioTests, this should compile the file