Commit Graph

6598 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
Timothee Cour
61352d5a20 remove unused and misleading FilenameOption.foShort (#15982) 2020-11-16 22:52:02 +01:00
flywind
4213f7a6c9 rename: stmt -> typed and expr -> untyped (#15989)
* stmt -> typed

* expr -> untyped

* minor
2020-11-16 14:19:26 +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
7eb34d170a fixes #15753 [backport:1.4] (#15971) 2020-11-15 15:47:42 +01:00
Clyybber
92da06e64e Fix nimsuggest/#117 (#15602) 2020-11-15 15:08:27 +01:00
flywind
47ce24f680 fix #12303 (#15964) 2020-11-14 12:51:23 +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
lenoil98
63c559e781 Add support for FreeBSD/PowerPC64 Little Endian (#15927)
* Update installer.ini

Add support for powerpc64 little endian

* Update buildsh.nimf

Add support for powerpc64 little endian

* Update makefile.nimf

Add support for freebsd/powerpc64 little endian
2020-11-12 10:43:13 +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
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
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
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
cooldome
338602a402 fix #15825 (#15894)
* fix #15825

* better fix
2020-11-09 19:24:32 +01:00
Timothee Cour
c1664f93b0 new: nim -e:cmd to run a command directly; also fixes #15731 (#15687)
* new: `nim -i cmd`
* rename -i to -e (for eval); consistent with majority of other programing languages
* `nim e -e:cmd` now works; bugfix: `echo cmd | nim e -` now works
* honor --betterRun
* address comments
* --eval alias for -e (replaces undocumented --eval which was a noop)
* --eval now defaults to e (nimscript) instead of r
* address comment: remove -e, only keep --eval
* address comment
* fixup
* Update compiler/nimconf.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-11-09 16:07:22 +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
sherbst
552075d10e Fix typo in lexer.nim (#15876) 2020-11-07 15:58:49 +01: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
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
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
flywind
a8af664e8b fix #15463 (#15831) 2020-11-05 14:00:08 +01:00
cooldome
4c19c5dfae fix static[Slice[T]] as argument issue (#15842) 2020-11-04 19:52:53 +01:00
cooldome
d62f3627aa EnumUtils, speed up findStr in compiler (#15777)
* add parseEnumRange
* fix runnable example
* update changelog
* use parseEnumRange in compiler
* reorganise code
* add changelog, make single normalizer argument
2020-11-03 16:26:16 +01:00
flywind
b8bcf236dd fix #12640 (#15829) 2020-11-03 11:41:41 +01:00
flywind
fde17b159f follow #15818 and close #7109 (#15823)
* follow #15818 and close #7109

* Update compiler/jsgen.nim

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

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
2020-11-02 18:27:39 +01:00
flywind
5b4c17b5e7 Closure iterators are not supported by VM (#15818) 2020-11-02 10:58:14 +01:00
flywind
544cb107c7 fix #8821 (#15809) 2020-11-02 10:41:44 +01:00
cooldome
00b495de95 Use modern enums in compiler (#15775) 2020-11-02 10:35:24 +01:00
flywind
558115fa29 fixes #15717 2020-11-02 10:27:48 +01:00
flywind
27eb19cc48 fix #15145 (#15816) 2020-11-02 08:56:51 +01:00
flywind
80b0748d75 fix #15651 (#15800)
* fix

* minor
2020-10-31 12:06:13 +01:00
Miran
28bbcd9d45 fix #15702, show enum fields documentation (#15792) 2020-10-30 16:30:00 +01:00
flywind
2cfe5e0745 [closes #11625 and closes #2488]add global and threadvar(with --threads:off mode ) pragmas supports for JS backend (#15772)
* add global pragma support for js backend

* globalThis

* add support for threadvar

* more tests

* Update compiler/jsgen.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-10-30 15:34:07 +01:00
cooldome
6fe2e8977d canAlias improvement (#15773)
* canAlias improvement

* fix comment
2020-10-30 11:42:06 +00:00
flywind
17f08b2939 closes #7658 (#15784)
* fix #7658

* more
2020-10-30 09:58:55 +01:00
flywind
f79ded3cb6 fix #15638 (#15789) 2020-10-30 09:16:47 +01:00
cooldome
610e9b2fe9 fix #15756 (#15761)
* fix #15756

* simplify test
2020-10-28 13:24:38 +00:00
cooldome
0956a99537 ARC now capable of custom extra alignment. Ref, closure and seq support. (#15697) 2020-10-28 14:00:49 +01:00
cooldome
f8cac6bbbc fix #15752 (#15754) 2020-10-28 00:09:26 +01:00
Timothee Cour
0fb878324e honor --declaredLocs in more places, including type mismatch errors; also show kind with --declaredLocs (#15673)
* honor --declaredLocs in more places, including type mismatch errors
* fix tests
* show declaration location also when type mismatch names clash
2020-10-27 14:19:28 +01:00
Timothee Cour
58a1eec96a condsyms: add nimHasDeclaredLocs (#15735) 2020-10-27 07:53:45 +01:00