summary refs log tree commit diff stats
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* continue booting the compiler with refc (#20421)ringabout2022-09-241-0/+1
| | | | | | | * continue boot the compiler with refc * koch * use `gc:refc`
* defaults to ORC (#19972)ringabout2022-09-233-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * defaults to Orc * bootstrap using refc * use gc * init orc defines * unregister orc * fix gc * fix commands * add prepareMutation for orc * enable deepcopy for orc * prepareMutation * more fixes * some cases * bug #20081 * partial fixes * partial fixes * fixes command line * more fixes * build Nim with refc * use gc * more fixes * rstore * orc doesn't support threadpool * more shallowCopy * more fixes * fixes unsafeNew * workarounds * small * more fixes * fixes some megatest * tcodegenbugs1 refc * fxies megatest * build nimble with refc * workaround tensordsl tests * replace shallowCopy with move * fixes action * workaround * add todo * fixes important packages * unpublic unregisterArcOrc * fixes cpp * enable windows Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
* fix #17351; switch to c++17 and remove hacks (#20407)ringabout2022-09-232-4/+3
| | | | | * fix #17351; switch to c++17 * remove workaround
* Fixes #20348; only respect the recursion limit if the symbol's generic type ↵Aditya Siram2022-09-223-12/+22
| | | | | has been generated by the compiler (#20377) Fixes #20348
* Improve error message when instantiating generics with object constructor ↵Bung2022-09-211-2/+6
| | | | | | | | | | | | | | | (#20358) * Improve error message when instantiating generics with object constructor * follow suggestion * Update compiler/semobjconstr.nim Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> * Update tests/errmsgs/t19882_2.nim Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* fixes #20397; fixes stylecheck regression (#20398)ringabout2022-09-211-0/+1
| | | | | * fixes #20397; fixes stylecheck * add testcase
* fixes #20391; make of operator work with generics for ORC (#20395)ringabout2022-09-211-1/+1
|
* turn nimIncrSeqV3 into deadcode (#20388)ringabout2022-09-201-1/+1
|
* report expression has no type other than has to be used (or discarded… ↵Bung2022-09-201-0/+3
| | | | | (#20392) report expression has no type other than has to be used (or discarded) when typ is tyNone in discardCheck
* fix #19882 Improve error message when instantiating generics that lac… ↵Bung2022-09-191-1/+2
| | | | | | | | | (#20356) * fix #19882 Improve error message when instantiating generics that lack a type * Update tests/errmsgs/t19882.nim Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* Shorten JS block code (#20370)Amjad Ben Hedhili2022-09-191-4/+4
|
* fixes #19713; Revert "Remove tlsEmulation enabled from Windows + GCC config" ↵ringabout2022-09-192-2/+7
| | | | | | | | | | | | | | | (#19119) (#20327) * Revert "Remove tlsEmulation enabled from Windows + GCC config (#19119) [backport:1.6]" This reverts commit 77b696c2c92b5f478526290c5e184a4c41060f7b. * increase nimTlsSize to 48000 * enable for windows * fixes tests * fixes tlsEmulation:on
* Allow custom pragma on iterators [backport] (#20344)Tanguy2022-09-171-1/+1
| | | Allow custom pragma on iterators
* minor improvements to follow up recent PRs (#20342)metagn2022-09-144-11/+11
| | | | | | put mOpenArrayToSeq in compile-time evaluation whitelist (it was mNone before which was whitelisted), homogenize "ordinal type expected" errors, put overloadable enums in non-experimental manual
* fix #20233 Float ranges in case statement in JS crash compiler (#20349)Bung2022-09-141-18/+55
|
* fixes #19724; don't be aggressive when you infer sink parameters (#20314)Andreas Rumpf2022-09-121-7/+15
| | | | | | | | | | | | | | | | | | | | | | * fixes #19724; don't be aggressive when you infer sink parameters * better logic and updated tests * wip * fixes tests (#20330) * restore tests * try splitPath Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com> * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
* Revert "fixes #20155; repr range with distinct types is broken with ORC" ↵Clay Sweetser2022-09-111-3/+0
| | | | | | | (#20334) Revert "fixes #20155; repr range with distinct types is broken with ORC (#20158)" This reverts commit 37b3f62eef16b0e7cb89e18f9ddc1fb96e17fb1b.
* fixes #20155; repr range with distinct types is broken with ORC (#20158)ringabout2022-09-111-0/+3
| | | | | * fixes #20155; repr range with distinct types is broken with ORC * skipRanges
* Implement Markdown definition lists (+ migration) (#20333)Andrey Makarov2022-09-112-2/+7
| | | | | | | | | | | | | | | Implements definition lists Markdown extension adopted in a few implementations including: * [Pandoc]( https://pandoc.org/MANUAL.html#definition-lists) * [kramdown]( https://kramdown.gettalong.org/quickref.html#definition-lists) * [PHP extra Markdown]( https://michelf.ca/projects/php-markdown/extra/#def-list) Also affected files have been migrated. RST definition lists are turned off for Markdown: this solves the problem of broken formatting mentioned in https://github.com/nim-lang/Nim/pull/20292.
* fix #13515 [backport] (#20315)metagn2022-09-111-1/+7
| | | | | | | | | | | * fix #13515 * only compile test * no idea why this PR is unlocking this * don't rope in symchoices * even more restrictive
* fixes nightlies build regression (#20322)ringabout2022-09-081-1/+1
| | | fixes nightlies build
* fixes #20303; wasMoved expressions with side effects for ORC (#20307) [backport]ringabout2022-09-081-2/+25
| | | fixes #20303; wasMoved expressions with side effects
* Replace `if` by `case` in JS `isSimpleExpr` (#20267)Amjad Ben Hedhili2022-09-061-5/+7
| | | use case stmt
* use arrow precedence in spec (#20166)metagn2022-09-061-1/+1
| | | | | | | * test using arrow precedence in spec refs #8759 * add test for #8759
* fixes #9462; jsondoc --index can generate a theindex.json (#20205)ringabout2022-09-062-1/+21
|
* overloadable enums no longer experimental (#20298)metagn2022-09-056-23/+7
| | | depends on #20126
* Prevent use-after-free bugs in object variants. Fixes bug #20305 (#20300) ↵Antonis Geralis2022-09-051-0/+3
| | | | | | | | | | | [backport] prevent use-after-free bugs in cased objects the bug happens specifically when deleting an item in a seq. The item taking it's place might not have the same case fields. Then =sink(x[i], move x[xl]) might leave the deleted fields still in memory! If the new item switches branches again, you get a use-after-free bug.
* only allow enums to overload enums + extra test (#20126)metagn2022-09-031-2/+2
| | | mirror behavior without overloadableEnums
* remove deprecated type pragma syntax, fix bugs that required it (#20199)metagn2022-09-032-30/+27
| | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix #16937; --clib option pass library name to backend C compiler correctly ↵Tomohiro2022-09-011-1/+1
| | | | | | | | | | | | | (#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>
* support cstring in `case` (#20130)metagn2022-09-019-18/+42
| | | | | | | | | | | | | | | * 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
* Markdown code blocks part 6 (#20292)Andrey Makarov2022-08-313-11/+8
|
* fixes the regressions caused by the fix for #20107 [backport] (#20287)Andreas Rumpf2022-08-312-1/+2
| | | | * fixes the regressions caused by the fix for #20107 [backport]
* [nimsuggest] fix def call on identifier 2 times on the line (#20228)Ivan Yonchovski2022-08-302-10/+27
| | | | | | | - 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`
* fix `nim md2tex` and `koch pdf` commands (#20280)Andrey Makarov2022-08-281-1/+2
| | | | | * fix `nim md2tex` and `koch pdf` commands * change rst2tex -> md2tex also
* Fix auto links to subheader when TOC is present (#20279)Andrey Makarov2022-08-272-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* provide better error messages for large set (#20207)ringabout2022-08-251-1/+1
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* remove unused sfProcvar, "procvar" mentions (#20204)metagn2022-08-243-5/+6
| | | refs #12975. doesn't close it because wProcvar isn't removed
* move formatfloat out of system (#20195)ringabout2022-08-2411-10/+16
| | | | | | | | | | | | | | | * move formatfloat out of system * fixes doc * Update changelog.md * careless * fixes * deprecate system/formatfloat * better handling
* fixes #20227; skip distinct types for genObjConstr [JS backend] (#20229)ringabout2022-08-241-1/+2
| | | fixes #20227; skip distinct types for genObjConstr
* test removing dollar for objects out of system (#20242)metagn2022-08-242-0/+5
| | | | | | | | | | | * test removing dollar for objects out of system * test & fixes * fix bootstrap * use nimPreviewSlimSystem, test stdlib category * fix test
* fixes #20219; ignore comment/empty node in stmtListExpr (#20249)ringabout2022-08-241-0/+4
|
* top-down type inference, implements rfc 149 (#20091)metagn2022-08-2412-187/+324
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* new .redefine pragma for templates, warn on redefinition without it (#20211)metagn2022-08-237-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Add `doctype: RST|Markdown|RstMarkdown` pragma (#20252)Andrey Makarov2022-08-233-2/+49
| | | | | | | | | | | | | | | | | | | | | | | | * 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>
* fixes #18983 #5282 #13008; recursive types casue infinite type (#20172)ringabout2022-08-231-2/+27
| | | | | | | * fixes #18983 #5282 #13008; recursive types casue infinite type * re * add testcases
* remove {.this.} pragma, deprecated since 0.19 (#20201)metagn2022-08-236-77/+2
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* remove a special case in sigmatch; distinct pointer types no longer match ↵ringabout2022-08-231-2/+0
| | | | | | | | | | | | | | | | `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>
* remove unused nimfind defines (#20250)ringabout2022-08-231-23/+8
| | | remove unused nimfind
* remove `shallow` usages for ORC (#20109)ringabout2022-08-232-3/+6
|