Commit Graph

6612 Commits

Author SHA1 Message Date
flywind
6a37c0682a ast minor (#16079) 2020-11-22 20:01:17 +00:00
Andreas Rumpf
d9038ed792 fixes #15671 [backport:1.4] (#15690)
* fixes #15671 [backport:1.4]

* progress
2020-11-20 18:14:15 +01:00
cooldome
fcb2ec4ed6 fix #15958 (#15970) [backport:1.4]
* fix #15958

* also cover openArray and VarArgs

* more tests

* cover even more types

* cover even more types

* Trigger build

* Trigger build

* cover sets passed as arrays
2020-11-20 14:58:16 +01:00
Clyybber
07ad608fb2 Retain backwards compatibility after #16057 (#16068)
* Retain backwards compatibility

* Fix typo
2020-11-20 14:11:41 +01:00
Timothee Cour
7815ed69d4 rename loadConfigsAndRunMainCommand => loadConfigsAndProcessCmdLine, reflect reality (#16057) 2020-11-20 10:51:14 +01:00
Andreas Rumpf
1efd11e266 fixes #15942 [backport:1.2] [backport:1.4] (#16051) 2020-11-19 13:42:16 +01:00
cooldome
acf8316e50 Disallow nil dereference at compile time (#16032)
* bring back the semfold of nil

* remove space

* fix test

* proc type can't be dereferenced

* disallow nil dereference at compile time

* changelog
2020-11-18 23:30:28 +01:00
Timothee Cour
557dcfd87d fix #16033 nim js --gc:arc works and ignores --gc:arc (#16036) 2020-11-18 23:28:52 +01:00
Andreas Rumpf
b9eb91cbb5 ORC: prepare for another patent-pending optimization (#15996)
* ORC: prepare for another patent-pending optimization

* bugfix

* '=copy' for refs can take a cyclic parameter for more ORC optimizations

* ORC: exploit the common 'it = it.next' pattern

* can't hurt to check for nil

* use an algorithm that is not obviously broken

* restore the test case

* final cleanups for --gc:orc
2020-11-18 22:31:06 +01:00
cooldome
87d3e5331a Semfold for nil cast (#16030)
* bring back the semfold of nil

* remove space

* fix test

* proc type can't be dereferenced
2020-11-18 17:19:57 +00:00
flywind
581bcfe290 fix #6497 (#16027)
* fix #6497

* add testcase for #16027
2020-11-18 07:56:31 +00:00
flywind
e6e1e9574d combine PR#16009 and PR#16012 (#16024)
* fix #15623
* add testcase for #15623
* add testcase
* combine #16009
* support casting nil to NilableTypes in VM
2020-11-18 08:28:05 +01:00
flywind
0869d2a477 fix #15972 (#15994)
* fix #15972

* add testcase

* more
2020-11-18 00:14:14 +00:00
Andrey R (cooldome)
632af8afad Revert "follow #16009 VM supports cast nil to ptr (#16012)"
This reverts commit fec19c980e.
2020-11-17 18:54:33 +00:00
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