Commit Graph

4695 Commits

Author SHA1 Message Date
Andrey R (cooldome)
1663ad77e3 Revert "fix #15623 (#16009)"
This reverts commit 0f7f159a35.
2020-11-17 18:54:14 +00:00
flywind
0f7f159a35 fix #15623 (#16009)
* fix #15623

* add testcase for #15623

* fix

* add testcase
2020-11-17 17:05:20 +00:00
flywind
fec19c980e follow #16009 VM supports cast nil to ptr (#16012)
* follow #16009 VM supports cast nil to ptr

* more testcase
2020-11-17 10:47:01 +00:00
cooldome
a4d02f591c fix #15910 (#15984)
* fix #15910

* produce op of op is nil

* Trigger build
2020-11-16 11:39:28 +00:00
Andreas Rumpf
fc735e4b08 fix #15934 and #15620 (#15938) [backport:1.4]
* make workaround for #15934 and #15620
* add testcase for #9754
2020-11-15 18:12:53 +01:00
Andreas Rumpf
7eb34d170a fixes #15753 [backport:1.4] (#15971) 2020-11-15 15:47:42 +01:00
Andreas Rumpf
122f22d163 asynchttpserver cleanups [backport:1.0] (#15966)
* asynchttpserver cleanups [backport:1.0]
2020-11-15 07:27:13 +01:00
flywind
47ce24f680 fix #12303 (#15964) 2020-11-14 12:51:23 +01:00
Timothee Cour
96930b9cae targets: use cpp instead of c++ everywhere (was by far the most common) (#15961) 2020-11-14 10:08:15 +01:00
Timothee Cour
1a47fc2291 strengthen taddr.nim: add test case for #14578; reference other issues; test cpp (#15960) 2020-11-13 14:44:44 -08:00
Andreas Rumpf
562c6275b8 attempt to make asynchttpserver better; fixes #15925; [backport:1.0] (#15957)
* attempt to make asynchttpserver better; fixes #15925; [backport:1.0]
* better documentation
* fixes 'nim doc'
* makes test green again
* ported to FreeRTOS
* fixes the doc rendering
2020-11-13 20:57:43 +01:00
Araq
fa7b12bcf9 makes test green again 2020-11-13 14:18:01 +01:00
landerlo
c39fa0d495 Make IntSet a generic ordinal set OrdSet[A] (#15564)
* Make IntSet an ordinal set OrdSet[A: Ordinal]

Backward compatibility with IntSet is maintained.
IntSet is an alias for OrdSet[int]

* move ordsets to new file, intsets exports it
* ordset, move to lib/std folder

* Fix `$` for ordsets and test cleanup
* Fix ordsets compilation in doc example
* Rename ordsets to packedsets
2020-11-13 14:12:51 +01:00
Bung
797cb2e67b Fix #8404 JS backend doesn't handle float->int type conversion (#15950) [backport]
* Fix #8404 JS backend doesn't handle float->int type conversion
* handle conv to uint as cast, discard other cases
* limit to int32, times use int64
* toInt including tyInt64 break times timezones lib, ignore for now
* also affect to vm
* move to tests/misc/t8404.nim
2020-11-13 13:44:48 +01:00
flywind
d802a4a669 close #13062(add testcase for #13062) (#15956) 2020-11-13 12:49:30 +01:00
flywind
7d51ad96e9 close #2771(add testcase for #2771) (#15932) 2020-11-13 11:57:56 +01:00
flywind
a86aa31081 minor 2020-11-13 16:15:13 +08:00
flywind
a968e7dd9b add testcase for #9754 2020-11-13 15:42:59 +08:00
flywind
492e9afa4c fix #15941 (#15948)
* fix #15941

* add testcase

* update
2020-11-13 08:11:00 +01:00
flywind
8ec3c141ae add testcase 2020-11-12 23:58:42 +08:00
Timothee Cour
cc882917fe js -d:nodejs now supports osenv: getEnv, putEnv, envPairs, delEnv, existsEnv (v2) (#15826)
* js -d:nodejs now supports osenv: `getEnv`, `putEnv`, `envPairs`, `delEnv`, `existsEnv`

* refactor to osenv

* fix for js (without -d:nodejs) + VM

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-11-12 14:36:57 +01:00
hlaaftana
527e792827 make var string return var char w/ BackwardsIndex (#15461)
* make var string return var char w/ BackwardsIndex

fixes #14497

* work around VM bug
* properly workaround again
2020-11-12 11:44:21 +01:00
flywind
402df0b061 fix #15916 (#15917) [backport]
* fix #15916

* add testcase for #15916

* add comments
2020-11-12 09:31:35 +01:00
Fanael Linithien
7d4f70280e Fix #15909 (#15914) 2020-11-12 09:28:32 +01:00
Timothee Cour
e5db5316c2 doAssertRaises improvements; nimscript supports except Exception as e (#15765)
* doAssertRaises now correctly handles foreign exceptions; now shows which exception is raised on mismatch
* nimscript now handles `Exception as e`
* remove catch-all doAssertRaises overload from this PR

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-11-12 09:25:41 +01:00
flywind
1f9bf43100 fix #14157 (#15877)
* fix #14157

* Update compiler/jsgen.nim

* add changelog

* Update compiler/jsgen.nim

* Update tests/js/tmodify_cstring.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-11-12 09:20:10 +01:00
Bung
826e62953f fix #12726 Cannot take the compile-time sizeof Atomic types (#15928)
* fix #12726 Cannot take the compile-time sizeof Atomic types

* fix for arch 32
2020-11-12 09:16:40 +01:00
Bung
a81434a890 Fix 14127 js from int to int casting (#15918)
* fix #14127 from int to int casting

* add test for #14127

* use template for test, also test uint2int

* move to tests/types/t14127_cast_number.nim targets:c cpp js
2020-11-11 17:41:49 +00:00
flywind
35f8803250 close #4318(add testcase for #4318) (#15904)
* close #4318(add testcase for #4318)

* Update tests/objects/t4318.nim

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
2020-11-11 10:29:17 +08:00
Miran
bbe49a14ae Correct all eggs (#15906)
* "eg" is a misspelled "egg", "e.g." is "exempli gratia"
* Also, "ie" is "i.e.".
2020-11-10 21:53:25 +01:00
Miran
ee78d76108 rst: add support for markdown tables (#15854)
* rst: add support for markdown tables

* change template into proc

* don't create unnecessary `seq[string]`
2020-11-10 09:41:26 +01:00
flywind
d8e7caf5dd follow #15874(add testcase for #15874) (#15893) 2020-11-10 09:23:58 +08:00
cooldome
338602a402 fix #15825 (#15894)
* fix #15825

* better fix
2020-11-09 19:24:32 +01:00
cooldome
69fe707025 Fix 15629 (#15888)
* fix #15858

* fix space

* fix #15629

* Revert "fix space"

* Revert "fix #15858"
2020-11-09 12:26:12 +01:00
cooldome
d5a0a5dfff Fix #15858 (#15887)
* fix #15858
* fix space
* fix #15629
* Revert "fix #15629"
2020-11-09 12:21:56 +01:00
cooldome
7b19217798 fix #15707 (#15870) 2020-11-09 11:47:29 +01:00
flywind
673c5990c6 fix #12558 (#15864)
* fix #12558
* Update compiler/pragmas.nim
2020-11-09 11:46:25 +01:00
Ivan Bobev
d03f24147a Add a macro returning enum items count (#15824)
Add a macro `enumLen` which is used to determine the number of items in
an enumeration type to the `typetraits.nim` module. Also, add unit tests
for it in the `ttypetraits.nim` module.

Related to nimlang/Nim#15824
2020-11-09 10:02:01 +01:00
flywind
203bddf307 close #11637(add testcase for #11637) (#15879)
* close #11637(add testcase for #11637)

* Update tests/vm/t11637.nim
2020-11-08 11:02:12 +08:00
Bung
c07807bedf Fix #15706 (#15846)
* fix #15706 Underflow not detected when using dec on distinct ranges

* fix #15846 first, jsgen even doesn't care of range in this op
2020-11-07 08:00:41 +00:00
flywind
8f7a013cc7 close #8558(add testcase for #8558) (#15872) 2020-11-07 07:59:47 +00:00
Ivan Bobev
3c85aa9e53 Make {.requiresInit.} to work for distinct types (#15869)
Make `requiresInit` pragma to work for distinct types in addition to
objects. Tagging of distinct types with `requiresInit` pragma was
already supported, but its impact wasn't applied. Now its behavior when
applied on distinct types is as follows.

Given the following distinct type definitions:

  ```nim
  type
    DistinctObject {.requiresInit, borrow: `.`.} = distinct MyObject
    DistinctString {.requiresInit.} = distinct string
  ```

The following code blocks will fail to compile:

  ```nim
  var foo: DistinctFoo
  foo.x = "test"
  doAssert foo.x == "test"
  ```

  ```nim
  var s: DistinctString
  s = "test"
  doAssert s == "test"
  ```

But these ones will compile successfully:

  ```nim
  let foo = DistinctFoo(Foo(x: "test"))
  doAssert foo.x == "test"
  ```

  ```nim
  let s = "test"
  doAssert s == "test"
  ```
2020-11-06 18:56:09 +00:00
Clyybber
60c364fb22 Closes #12897 (#15867) 2020-11-06 23:49:51 +08:00
flywind
fb60e35a54 close #8829(add testcase for #8829) (#15866) 2020-11-06 23:39:20 +08:00
flywind
218ff27b70 fix #15851 (#15852)
* fix #15851

* {.cast(noSideEffect).}
2020-11-06 11:40:14 +01:00
cooldome
cdd459dd60 static[T] related fixes (#15853)
* close #9679

* close #7546

* close #9520

* close #6177
2020-11-06 10:25:43 +01:00
cooldome
fa5f225efc fix #15609 (#15856)
* fix #15609

* fix test
2020-11-05 23:29:05 +01:00
cooldome
3af7818af4 Fix #12636 (#15850)
* close #11142

* fix #12636

* undo unwanted changes

* fix illegal recursion case
2020-11-05 18:55:52 +01:00
cooldome
9455a0c3e3 close #11142 (#15847) 2020-11-05 14:51:45 +01:00
flywind
c4cc907433 fix adding empty sequence to HTTP headers (#15783)
* fix adding empty sequence to HTTP headers

* add tests
2020-11-05 14:01:28 +01:00