Commit Graph

7127 Commits

Author SHA1 Message Date
hlaaftana
1ef945668d treat do with pragmas but no parens as proc (#19191)
fixes #19188
2021-12-05 06:44:22 +01:00
Andreas Rumpf
1cbdc1573a fixes #19159 [backport:1.6] (#19210) 2021-12-04 07:44:26 +01:00
Andreas Rumpf
f90620fb32 fixes #19198 [backport:1.6] (#19209)
* fixes #19198 [backport:1.6]

* added a test case
2021-12-04 07:43:20 +01:00
Andreas Rumpf
d584dd5b99 fixes #19015 [backport:1.6] (#19204) 2021-12-04 07:42:58 +01:00
Andreas Rumpf
23c117a950 misc bugfixes [backport:1.2] (#19203) 2021-12-04 07:42:34 +01:00
hlaaftana
f91867aa31 accept object type node from macros (#19179) 2021-11-24 16:34:42 +01:00
Andreas Rumpf
a0073d2d4c renamed 'gc' switch to 'mm'; [backport:1.6] (#19187)
* renamed 'gc' switch to 'mm'; [backport:1.6]
* better docs
2021-11-24 15:49:32 +01:00
hlaaftana
c7c6b13a32 parseExpr/parseStmt accept filename, fixes #13540 (#19182) 2021-11-24 12:22:40 +01:00
hlaaftana
2859069dbe fix #12274 (#19180) 2021-11-24 07:08:07 +01:00
hlaaftana
5933aece9b caseStmtMacros no longer experimental, experimental manual refactor (#19173)
* `caseStmtMacros` no longer experimental, experimental manual refactor

* Update doc/manual.rst

* apply review suggestions

* apply review

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-11-23 16:30:17 +01:00
hlaaftana
1b143f5e79 Accept nnkTypeSection from typedef macro pragmas (#19168) 2021-11-22 10:41:35 +01:00
flywind
fe46c8b5f1 fix marshal bugs in VM (#19161) [backport:1.6] 2021-11-17 10:15:54 +01:00
Andreas Rumpf
c6fc3b2eae fixes #19051 [backport:1.6] (#19133) 2021-11-12 11:19:24 +01:00
Andreas Rumpf
15157d06c3 fixes #14470 [backport:1.2] (#19115) 2021-11-09 22:48:04 +01:00
Andreas Rumpf
6ff61766da fixes #19011 [backport:1.6] (#19114) 2021-11-09 18:59:59 +01:00
Andreas Rumpf
b7c66ce860 fixes #19013 [backport:1.6] (#19111)
* fixes #19013 [backport:1.6]

* added test case
2021-11-09 12:43:16 +01:00
Andrey Makarov
b21eb1ed36 change os.nim doc links to new style (#19102) 2021-11-08 13:10:01 +01:00
Andreas Rumpf
fce89cb60a fixes another effect inference bug [backport:1.6] (#19100)
* fixes another effect inference bug [backport:1.6]
2021-11-07 16:38:02 +01:00
Andreas Rumpf
9d51197aa4 fixes #19078 [backport] (#19090) 2021-11-02 16:30:59 +01:00
Jason Beetham
cc984217a9 Fix VM's sametype impl to work for generics/typedescs (#19073)
* Fix vm's sametype implementation to properly handle generics and typedescs

* actually fixed sametype + have test

* added comments and removed unsafe code
2021-11-02 09:02:53 +01:00
haxscramper
4c510d5577 [FIX] Do not break formatted string line (#19085) [backport]
Otherwise, compiler produces broken error message - `$1` is not interpolated

`Error: The $1 type doesn't have a default value. The following fields must be initialized: importGraph.`
2021-11-02 08:54:04 +01:00
flywind
2f730afe9e fix #18410 (Errors initializing an object of RootObj with the C++ backend) [backport] (#18836)
* fix #18410

* one line comment

* typo

* typo

* cover cpp
2021-10-31 06:22:00 +01:00
Derek 呆
f755e452d2 fix #18971 (#19070) [backport:1.6]
since the example code return value from global variable, instead
of first argument, the `n.len` is 1 which causes compiler crashes.
2021-10-29 19:55:48 +02:00
Andrey Makarov
7ba2659f73 docgen: implement doc link resolution in current module (#18642) 2021-10-28 19:20:52 +02:00
Jason Beetham
8d5a275189 Fixed distinct composite type class proc borrowing (#18904)
* Fixed composite type class proc borrowing

* Moved borrow search into transf

* added borrow check to symbol flag
2021-10-26 11:29:07 +02:00
Jason Beetham
83a2515af7 Fixed generic distinct conversions for 'var' (#18837)
* SameTypeAux now properly traverses generic distincts

* Smarter traversal of distincts

* Removed redundant check

* Fixed nkConv for jsgen

* Added test for non distinct nkConv

* using skiptypes for distinct now

* Fixed genaddr for nkconv
2021-10-26 11:27:11 +02:00
Jaremy Creechley
141b76e365 Add Zephyr Support (#19003)
* Porting Nim to run on Zephyr.

Includes changes to `std/net`.

Squashed commit of the following:
    tweaking more memory / malloc things
    revert back bitmasks
    tweaking nim to use kernel heap as C malloc doesn't work
    fixing socket polling on zephyr
    cleanup getting maximum sockets for process or for rtos'es
    reorganizing and fixing net for async / system
    merge netlite changes back into nativesockets
    merge netlite changes back into nativesockets
    reverting native sockets back
    tweaking nim / zephyr network
    adding option to run 'net-lite' from linux
    bridging zephyr's max connections
    fixing net errors
    fixing compilation with getAddrString
    fixing compilation with getAddrString
    experimenting with a nativesockets_lite ... getAddrString
    experimenting with a nativesockets_lite ... getAddrString
    experimenting with a nativesockets_lite ... getLocalAddr
    experimenting with a nativesockets_lite ... getLocalAddr
    experimenting with a nativesockets_lite ...
    add note regarding incorrect FreeRTOS Sockadd_in fields
    changing to NIM_STATIC_ASSERT
    cleaning up the static_assert error messages
    cleaning up the static_assert error messages
    setting up static assert ftw!
    testing compile time asserts
    reworking Sockaddr objects to more closely match various platforms
    reworking Sockaddr objects to more closely match various platforms
    reworking Sockaddr objects to more closely match various platforms
    finding missing items (issue  #18684)
    fixup posix constants (issue  #18684)
    adding plumbing for zephyr os (issue  #18684)
    adding plumbing for zephyr os (issue  #18684)

* fixing constant capitalizations

* remove extra debug prints and fix TSa_Family/cint issue

* remove extra debug prints and fix TSa_Family/cint issue

* Porting Nim to run on Zephyr.

Includes changes to `std/net`.

Squashed commit of the following:
    tweaking more memory / malloc things
    revert back bitmasks
    tweaking nim to use kernel heap as C malloc doesn't work
    fixing socket polling on zephyr
    cleanup getting maximum sockets for process or for rtos'es
    reorganizing and fixing net for async / system
    merge netlite changes back into nativesockets
    merge netlite changes back into nativesockets
    reverting native sockets back
    tweaking nim / zephyr network
    adding option to run 'net-lite' from linux
    bridging zephyr's max connections
    fixing net errors
    fixing compilation with getAddrString
    fixing compilation with getAddrString
    experimenting with a nativesockets_lite ... getAddrString
    experimenting with a nativesockets_lite ... getAddrString
    experimenting with a nativesockets_lite ... getLocalAddr
    experimenting with a nativesockets_lite ... getLocalAddr
    experimenting with a nativesockets_lite ...
    add note regarding incorrect FreeRTOS Sockadd_in fields
    changing to NIM_STATIC_ASSERT
    cleaning up the static_assert error messages
    cleaning up the static_assert error messages
    setting up static assert ftw!
    testing compile time asserts
    reworking Sockaddr objects to more closely match various platforms
    reworking Sockaddr objects to more closely match various platforms
    reworking Sockaddr objects to more closely match various platforms
    finding missing items (issue  #18684)
    fixup posix constants (issue  #18684)
    adding plumbing for zephyr os (issue  #18684)
    adding plumbing for zephyr os (issue  #18684)

* fixing constant capitalizations

* remove extra debug prints and fix TSa_Family/cint issue

* remove extra debug prints and fix TSa_Family/cint issue

* fixing PR issues

* Porting Nim to run on Zephyr.

Includes changes to `std/net`.

Squashed commit of the following:
    tweaking more memory / malloc things
    revert back bitmasks
    tweaking nim to use kernel heap as C malloc doesn't work
    fixing socket polling on zephyr
    cleanup getting maximum sockets for process or for rtos'es
    reorganizing and fixing net for async / system
    merge netlite changes back into nativesockets
    merge netlite changes back into nativesockets
    reverting native sockets back
    tweaking nim / zephyr network
    adding option to run 'net-lite' from linux
    bridging zephyr's max connections
    fixing net errors
    fixing compilation with getAddrString
    fixing compilation with getAddrString
    experimenting with a nativesockets_lite ... getAddrString
    experimenting with a nativesockets_lite ... getAddrString
    experimenting with a nativesockets_lite ... getLocalAddr
    experimenting with a nativesockets_lite ... getLocalAddr
    experimenting with a nativesockets_lite ...
    add note regarding incorrect FreeRTOS Sockadd_in fields
    changing to NIM_STATIC_ASSERT
    cleaning up the static_assert error messages
    cleaning up the static_assert error messages
    setting up static assert ftw!
    testing compile time asserts
    reworking Sockaddr objects to more closely match various platforms
    reworking Sockaddr objects to more closely match various platforms
    reworking Sockaddr objects to more closely match various platforms
    finding missing items (issue  #18684)
    fixup posix constants (issue  #18684)
    adding plumbing for zephyr os (issue  #18684)
    adding plumbing for zephyr os (issue  #18684)

* fixing constant capitalizations

* remove extra debug prints and fix TSa_Family/cint issue

* remove extra debug prints and fix TSa_Family/cint issue

* Remerge

* fixing constant capitalizations

* remove extra debug prints and fix TSa_Family/cint issue

* remove extra debug prints and fix TSa_Family/cint issue

* fixing PR issues

* fix maxDescriptors on zephyr/freertos

* move maxDescriptors to selector.nim -- fixes compile issue

* change realloc impl on zephyr to match ansi c behavior

* change realloc impl on zephyr to match ansi c behavior

* force compileOnly mode for tlwip

Co-authored-by: Jaremy J. Creechley <jaremy.creechley@wavebaselabs.com>
Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
2021-10-24 11:51:57 +02:00
Etan Kissling
490c4226a5 allow converting static vars to openArray (#19035)
When assigning constant output to a seq, and then passing that static
seq to other functions that take `openArray`, the compiler may end up
producing errors, as it does not know how to convert `static[seq[T]]`
to `openArray[T]`. By ignoring the `static` wrapper on the type for
the purpose of determining data memory location and length, this gets
resolved cleanly. Unfortunately, it is relatively tricky to come up
with a minimal example, as there are followup problems from the failing
conversion, e.g., this may lead to `internal error: inconsistent
environment type`, instead of the relevant `openArrayLoc` error message.
2021-10-22 17:32:02 +02:00
flywind
4d8108046b remove exception (#18906) 2021-10-22 12:15:08 +02:00
Danil Yarantsev
5e2b9341f3 Add Elbrus 2000 architecture (#19024)
* Add Elbrus 2000 architecture

* Add e2k to niminst

* Update compiler/installer.ini

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-10-21 17:01:48 +02:00
Andreas Rumpf
1a45da9150 use two underscores for easy demangling [backport:1.6] (#19028) 2021-10-21 16:53:15 +02:00
Jason Beetham
f0af4a36b9 Added setGlobalValue to VM api (#19007) 2021-10-17 16:24:43 +02:00
Timothee Cour
f77dea01fd define nimVersion automatically and avoid needing -d:nimVersion140 (#18726)
* define `nimVersion` and avoid needing -d:nimVersion140

* fix changelog
2021-10-17 08:37:52 +02:00
flywind
73330711a3 make choosenim work on windows [backport] (#18993) 2021-10-14 23:55:05 +08:00
flywind
3493783d0f test whether it is unnecessary (#18893) 2021-10-14 09:23:36 +02:00
flywind
2ac3ba713b fix #18985 (#18988) 2021-10-13 14:57:25 +02:00
林亦恩
e645be4d0c add ghci like type annotation buildEchoStmt (1049) (#18875)
* add ghci like type annotation buildEchoStmt (1049)

* Update compiler/semexprs.nim

* Update compiler/semexprs.nim

Co-authored-by: flywind <xzsflywind@gmail.com>

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: flywind <xzsflywind@gmail.com>
2021-10-13 11:35:47 +02:00
Dominik Picheta
2aa97a228a Removes deprecated {.injectStmt.}. Fixes #18666 (#18984) 2021-10-13 11:09:45 +02:00
Juan Carlos
0ae2d1ea88 Improve error message when NodeJS is not installed and 'nim js -r' is run (#18978) 2021-10-12 15:41:30 +02:00
Andreas Rumpf
6f15af41a7 fixes a regression caused by overloadable enums even though they're opt-in (#18970) 2021-10-07 15:07:24 +02:00
Andreas Rumpf
8eef557157 fixes a 'mixin' statement handling regression [backport:1.2] (#18968) 2021-10-07 12:01:06 +02:00
flywind
677969f6ea alternative to #18918 (#18927)
* fix #16558

* add testcase
2021-09-30 16:57:06 +02:00
Jason Beetham
f915b3aa86 Alternative to #18928 (#18931)
* fixed #18841

* Added test
2021-09-30 16:55:43 +02:00
Andreas Rumpf
c38ab3e257 fixes #18921 [backport] (#18930) 2021-09-30 12:09:42 +02:00
Miran
b74b914e4f [backport] use old style hints in .cfg files (#18917)
refs #18085
2021-09-29 11:14:47 +02:00
Timothee Cour
f061971a9b envPairs works in vm, nims (#18615)
* envPairs works in vm, nims

* fixup
2021-09-29 09:32:39 +02:00
flywind
08cf4cb1e5 test ord (#18909) 2021-09-28 11:35:04 +02:00
flywind
56bd5cbb87 fix a typo (canonilization => canonicalization) (#18914) 2021-09-28 03:05:22 -04:00
Andreas Rumpf
576fece909 fixes 'lent T' inside object constructor [backport] (#18911)
* fixes 'lent T' inside object constructor [backport]

* progress
2021-09-27 22:23:31 +02:00
Andreas Rumpf
cdf9ac675b this ensures libp2p continues to compile [backport] (#18908) 2021-09-27 19:25:00 +02:00