Commit Graph

20297 Commits

Author SHA1 Message Date
metagn
86f7f4ffa5 remove deprecated type pragma syntax, fix bugs that required it (#20199)
* remove deprecated pragma syntax from 0.20.0

closes #4651, closes #16653 with a cheap fix for now due to
how early `tfFinal` is set

* remove type pragma between name and generics

* undo removal, try removing bind expression (0.8.14)

* fix test, unremove bind expr

* remove again

* Update changelog.md

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

* dependencies @ HEAD & weave test dependencies

* try fix package ci

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-09-03 09:52:13 +02:00
ringabout
f540fd5cde Partially Revert "Change nim's nimble files to make it installable" (#20296)
add nimsuggest.nimble back
2022-09-02 19:05:23 +02:00
ringabout
5ff06fd3c2 Revert "fix #19600 No error checking on fclose (#19836)" (#20297)
This reverts commit 04e4a5ec0e.
2022-09-02 19:04:58 +02:00
Tomohiro
2a34d143ac Fix #16937; --clib option pass library name to backend C compiler correctly (#19754)
* Fix 16937: Make --clib option works

* Make tests/compiler/tcmdlineclib.nim works from any current dir

* Try to fix link error on macosx

* Add a comment to tests/compiler/tcmdlineclib.nims

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
2022-09-01 13:57:17 -04:00
metagn
a95b6391fd support cstring in case (#20130)
* implement case for cstring

for now just converts to string on C backend

* custom implementation for cstring

* remove leftover

* revert even more

* add nil + fix packages weird variant literal bug

* update docs
2022-09-01 18:10:00 +02:00
ringabout
1f838d9af1 remove the old nimv019 define in the config (#20133)
remove the olf nimv019 define in the config
2022-09-01 18:07:49 +02:00
quantimnot
6289b002b6 [Testament] Extend and document message testing aids (#19996)
* [Testament] Extend and document message testing aids

* Enable inline msgs when not reject action.
Eliminates the pain of changing the line and column numbers in `nimout`
or `output` while making changes to the test.
* Enable using inline msgs and nimout together.
Allows ease of inline msgs for the test as well as testing msgs from
other modules.
* Add path separator and test filename variable interpolation in
msgs.
Eases handling path separators in the msgs.
* Add some documentation.

* Fixed lots of broken tests

* Fixed more broken tests

* Support multiple inline messages per a line

* Fix a broken test

* Revert variable substitution in `output`

* Remove uneeded params

* Update doc/testament.md

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>

* Update testament/specs.nim

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>

* Update testament/specs.nim

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>

* Fix indentation

Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
2022-09-01 17:52:13 +02:00
Dan Rose
c2cdc752c8 Simpler complex division implementation (#20088) 2022-09-01 17:44:07 +02:00
Andrey Makarov
0f555110e6 Markdown code blocks part 6 (#20292) 2022-08-31 19:39:02 -04:00
Ivan Yonchovski
fb2773411e Change nim's nimble files to make it installable (#20179)
- needs #20168 to make the stuff working

I went for this minimal solution because it seems like `compiler.nimble` and
`nimsuggest.nimble` are not in use

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
2022-08-31 15:06:27 -04:00
metagn
538b8d4032 update changelog for #20242, #20091, #20087 (#20288) 2022-08-31 14:46:17 -04:00
Andreas Rumpf
5211a471c8 fixes the regressions caused by the fix for #20107 [backport] (#20287)
* fixes the regressions caused by the fix for #20107 [backport]
2022-08-31 13:19:26 +02:00
Ivan Yonchovski
d4c0d35b32 [nimsuggest] fix def call on identifier 2 times on the line (#20228)
- apparently TLineInfo's implementation of `==` ignores the column. After I fixed
the code to use exact TLineInfo comparison I fixed several other issues hidden
by that issue.

- Replaced `tuple[sym, info]` with `SymInfoPair`
2022-08-30 21:02:15 +02:00
Bung
04e4a5ec0e fix #19600 No error checking on fclose (#19836)
* fix #19600 No error checking on fclose

* add IOError to open
2022-08-29 18:09:14 +02:00
Dan Rose
cc81866da1 Implement complex sgn (#20087)
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
2022-08-28 22:17:18 -04:00
ringabout
04642335c1 fixes #17658; add cert dir for ssl ctx (#19920)
add cert dir for ssl ctx

Co-authored-by: Paul Roberts <pmr@stelo.org.uk>
Co-authored-by: sandytypical <43030857+xflywind@users.noreply.github.com>
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
2022-08-28 22:16:19 -04:00
Andrey Makarov
ee11302c24 fix nim md2tex and koch pdf commands (#20280)
* fix `nim md2tex` and `koch pdf` commands

* change rst2tex -> md2tex also
2022-08-28 18:04:13 -04:00
Judd
2b56b38235 minor updates on manual (#20258)
* minor updates on manual

1. statement -> keyword:

1. re-phase on the explanation of `import except`: maybe the newer version does not export some of the identifiers;

1. "The original module name is then not accessible" is moved up to the previous paragraph, since it is coupled with 
   the previous paragraph, but not the current one.

1. re-phase on the explanation of _Disabling certain messages_.

* Apply suggestions from code review

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>

* Update manual.md

do not use "()".

* Update doc/manual.md

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
2022-08-27 17:29:41 -04:00
Andrey Makarov
de9cbf6af1 Fix auto links to subheader when TOC is present (#20279)
Fix links to subheader when TOC is present

It was observed (in https://github.com/nim-lang/Nim/pull/20112)
that links to 2nd- (and subsequent) -level headings
fail if TOC is present, e.g.:
```nim
.. contents::

Type relations
==============

Convertible relation
--------------------

Ref. `Convertible relation`_
```

The problem here is that links are resolved in `rst.nim` but later
`rstgen.nim` fixes ("fixes") anchors to make them unique so that
TOC always works (if e.g. there was another sub-section like
"Convertible relation").
The solution implemented in this PR is to move that fix-up of anchors
into `rst.nim`, so that link resolution could know final anchors.

The bug seems to be added in https://github.com/nim-lang/Nim/pull/2332
in 2015, that is it is present in Nim 1.0.
2022-08-27 17:28:26 -04:00
Clay Sweetser
9ca6345122 Update manual.md (#20277) 2022-08-26 16:30:14 -04:00
Antonis Geralis
a52918a994 Add missing rand(var Rand, Ordinal) overload (#20124)
* Add missing rand(var Rand, Ordinal) overload

* Corrected mistake, thanks @metagn

Co-authored-by: metagn <metagngn@gmail.com>

* Update random.nim

Co-authored-by: metagn <metagngn@gmail.com>
2022-08-26 15:39:12 -04:00
ringabout
ea44c5cfed remove var for ref parameters in std/tables (#20175)
remove `var` from ref parameters; make it consistent
2022-08-25 23:48:43 +02:00
ringabout
16f6dc05fd std/options enables stricteffects (#19441) 2022-08-25 03:21:46 -04:00
ringabout
404e91ce48 provide better error messages for large set (#20207)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-08-25 00:49:52 +02:00
metagn
d143924ab2 remove unused sfProcvar, "procvar" mentions (#20204)
refs #12975. doesn't close it because wProcvar isn't removed
2022-08-24 21:38:37 +02:00
ringabout
b6bfe38ff5 move formatfloat out of system (#20195)
* move formatfloat out of system

* fixes doc

* Update changelog.md

* careless

* fixes

* deprecate system/formatfloat

* better handling
2022-08-24 13:38:30 +02:00
ringabout
12f23d5ae8 fixes nimPreviewSlimSystem; register echoBinSafe for nimPreviewSlimSystem (#20194)
* register echoBinSafe

* add output
2022-08-24 13:32:11 +02:00
ringabout
e832fea160 fixes #20227; skip distinct types for genObjConstr [JS backend] (#20229)
fixes #20227; skip distinct types for genObjConstr
2022-08-24 13:31:44 +02:00
metagn
b8dc58d884 test removing dollar for objects out of system (#20242)
* test removing dollar for objects out of system

* test & fixes

* fix bootstrap

* use nimPreviewSlimSystem, test stdlib category

* fix test
2022-08-24 09:44:16 +02:00
ringabout
9d9ecc3c1d fixes #20219; ignore comment/empty node in stmtListExpr (#20249) 2022-08-24 09:28:46 +02:00
metagn
0014b9c48e top-down type inference, implements rfc 149 (#20091)
* micro implementation of rfc 149

refs https://github.com/nim-lang/RFCs/issues/149

* number/array/seq literals, more statements

* try fix number literal alias issue

* renew expectedType with if/case/try branch types

* fix (nerf) index type handling and float typed int

* use typeAllowed

* tweaks + const test (tested locally) [skip ci]

* fill out more of the checklist

* more literals, change @ order, type conversions

Not copying the full call tree before the typedesc call check
in `semIndirectOp` is also a small performance improvement.

* disable self-conversion warning

* revert type conversions (maybe separate op later)

* deal with CI for now (seems unrelated), try enums

* workaround CI different way

* proper fix

* again

* see sizes

* lol

* overload selection, simplify int literal -> float

* range, new @ solution, try use fitNode for nil

* use new magic

* try fix ranges, new magic, deal with #20193

* add documentation, support templates

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-08-24 07:11:41 +02:00
Federico Ceratto
2dcfd73260 Add OpenSSL 3 support (#19814)
* Minor refactor

* Add OpenSSL 3 support

Remove symbols noOpenSSLHacksq and openssl10

* Drop loading of older openssl versions

* Add library path

* Use only versioned libssl soname os OSX

* Update .github/workflows/ci_packages.yml

Co-authored-by: Hein Thant <official.heinthanth@gmail.com>

* On Mac OS X CI, link OpenSSL in /usr/local/lib/

* Install OpenSSL on Mac OS X on azure pipeline

* Remove DYLD_LIBRARY_PATH

Co-authored-by: Hein Thant <official.heinthanth@gmail.com>

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Hein Thant <official.heinthanth@gmail.com>
2022-08-23 21:44:50 +02:00
metagn
d1d141b135 new .redefine pragma for templates, warn on redefinition without it (#20211)
* test CI for template redefinitions

* adapt asyncmacro

* fix quote

* fix again

* try something else

* revert

* fix ioselectors_select, disable packages CI

* adapt more tests & simplify

* more

* more

* more

* rename to redefine, warn on implicit redefinition

* basic documentation [skip ci]

* Update compiler/lineinfos.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-08-23 21:41:30 +02:00
Andrey Makarov
14656154ef Add doctype: RST|Markdown|RstMarkdown pragma (#20252)
* Add `doctype: RST|Markdown|RstMarkdown` pragma

Implements https://github.com/nim-lang/RFCs/issues/68 ,
see also discussion in https://github.com/nim-lang/Nim/issues/17987

The permitted values:
* `markdown`, which is default. It still contains nearly all of
  the RST supported but it is assumed that in time we will give up
  most or all RST features in this mode
* `rst`, without any extensions
* `RstMarkdown` — compatibility with Nim 1.x. It's basically RST
  with those Markdown features enabled that don't conflict with RST.

* Apply suggestions from code review

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>

* Additional fix in spirit of review

* Fix test after #20188

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
2022-08-23 14:49:53 -04:00
metagn
f4af9e955b remove some deprecated pre-1.0 stdlib modules (#20202)
* remove pre-1.0 stdlib deprecations

notable exceptions:
* ze, toU8 etc in system/arithmetics
* potentially callsite

* undo macros, ospaths, securehash, oswalkdir

* add sets back

* add back future, document deprecated versions

* add to changelog [skip ci]
2022-08-23 20:18:40 +02:00
ringabout
a895bbf714 fixes #18983 #5282 #13008; recursive types casue infinite type (#20172)
* fixes #18983 #5282 #13008; recursive types casue infinite type

* re

* add testcases
2022-08-23 19:58:50 +02:00
metagn
f6eb1d4d7d remove {.this.} pragma, deprecated since 0.19 (#20201)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-08-23 19:44:37 +02:00
ringabout
3dbf2ac946 remove echo statements in tests (part 1) (#20178)
* remove echo statements

* Update tests/vm/triangle_array.nim

* Update tests/vm/tyaytypedesc.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-08-23 19:28:51 +02:00
ringabout
1182216381 remove a special case in sigmatch; distinct pointer types no longer match nil type (#20251)
* remove a special case in sigmatch; distinct pointer types no longer match `nil` type

* add tests

* fixes tests

* Update changelog.md

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-08-23 19:27:20 +02:00
ringabout
7d7886b729 remove unused nimfind defines (#20250)
remove unused nimfind
2022-08-23 19:08:56 +02:00
ringabout
2b8f0a7971 fixes #19973; switch to poll on posix (#20212)
* fixes #19973; switch to poll on posix

* it is fd

* exclude lwip

* fixes lwip

* rename select to timeoutRead

* refactor into timeoutRead/timeoutWrite

* refactor common parts

Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
2022-08-23 18:58:08 +02:00
ringabout
9753dd0a1b remove shallow usages for ORC (#20109) 2022-08-23 18:50:59 +02:00
ringabout
e8556b45f5 fixes #19967; reset does not work on set [backport: 1.2] (#19968)
* fixes #19967

* use case

* add testcase

* fix typos

* explictly specify other branches

Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
2022-08-23 18:38:12 +02:00
ringabout
32e4b33632 fixes doc building regression; trigger builds on markdown files (#20260)
fix doc building regression; trigger builds on markdown files
2022-08-23 22:14:37 +08:00
ringabout
d8e5c5c5a6 fixes manual regression (#20259)
ref https://github.com/nim-lang/Nim/pull/20080
2022-08-23 19:17:00 +08:00
ringabout
25c6491b65 fixes #20162; locals doesn't work with ORC [backport] (#20163)
fixes #20162; locals doesn't work with ORC
2022-08-23 09:00:23 +02:00
ringabout
8fc19b9e12 document compiler procs regarding & (#20257) 2022-08-22 04:11:43 -04:00
ringabout
fdb781c713 add comments back (#20256)
My bad, I shouldn't have removed it in the precedent PR.
2022-08-21 22:45:30 -04:00
ringabout
2494470459 remove the merge pragma and obsolete comments (#20254)
remove the merge pragma which has been deprecated for seven years
2022-08-21 16:56:35 -04:00
Amjad Ben Hedhili
70a8e0d65c Docs auto dark mode (#20188)
* Implement auto dark mode

* Rename class

* Fix borders cutout

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
2022-08-21 16:56:12 -04:00