summary refs log tree commit diff stats
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* [ARC] fixes #18645; C Compiler error when initializing {.global.} with a ↵ringabout2022-10-031-12/+17
| | | | | | | | | | block (#19953) * fixes #18645; C Compiler error when initializing {.global.} with a block: * arguably cleaner solution Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com> Co-authored-by: Araq <rumpf_a@web.de>
* pragma for sfCallsite instead of name check + better semantics, test (#20464)metagn2022-10-038-17/+19
| | | | | | | | | | | * pragma for sfCallsite instead of name check at every template definition Not documented because it seems to be for internal use? Should also make it possible to make comparisons and setops imports, but this doesn't have to be done. I can reuse a name like `cursor` for the pragma as well, added a new name just to be safe. * make sfCallsite recursive, add tests
* fixes nim check with orc (#20456)ringabout2022-10-021-0/+4
| | | | | | | | | | | * fixes nim check with orc * fixes tests * add tests * fixes tests * Update tests/arc/t20456.nim
* disable threads when booting the compiler (#20478)ringabout2022-10-021-0/+1
|
* Fix #19224 For loops over a hardcoded empty array crash the compiler (#20476)Bung2022-10-011-0/+3
| | | | | * Fix #11684 For loops over a hardcoded empty array crash the compiler * Update t19224.nim
* fix #19678 Broken behavior with string ranges in case labels (#20475)Bung2022-10-011-0/+2
| | | | | | | | | * fix #19678 Broken behavior with string ranges in case labels * Update compiler/semtypes.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* new move analyser2 (#20471)Andreas Rumpf2022-10-0110-670/+439
| | | | | | | | * produce better code for closure environment creation * new 'first write' analysis; * scope based move analyser * code cleanup Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* closed ambiguous enum defaults to first overload (#20457)metagn2022-10-015-6/+23
| | | | | | | | | * closed ambiguous enum defaults to first overload * add warning * turn to hint * work around config
* remove hack for deprecated csize in compiler (#20463)metagn2022-10-011-2/+1
| | | | | * remove hack for deprecated csize in compiler * remove test
* add plausibleAnalytics support for koch docs[backport:1.6] (#20454)ringabout2022-09-301-0/+8
| | | add plausibleAnalytics to koch docs[backport:1.6]
* koch boot compiler with orc (#20467)ringabout2022-09-302-2/+1
| | | | | | | | | | | * koch boot compiler with orc * use orc * workaround bugs * move it * move the data
* Unicode Operators are no longer experimental (#20444)ringabout2022-09-282-7/+7
| | | | | | | | | * Unicode Operators are no longer experimental * fixes tests * Update doc/manual.md Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* moderate system cleanup & refactor (#20355)metagn2022-09-282-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * system refactor, move out 600 lines * compilation, slice, backwardsindex, misc_num moved out of system * some procs/types moved into arithmetics, basic_types * system no longer depends on syncio * some procs moved around to fit with their surroundings * make exceptions an import, old ops to misc_num * move instantiationInfo back * move back nim version, fix windows echo * include compilation * better docs for imported modules, fix unsigned ops also remove ze, ze64, toU8, toU16, toU32 with nimPreviewSlimSystem * fix terminal * workaround IC test & weird csize bug, changelog * move NimMajor etc back to compilation, rebase for CI * try ic fix * form single `indices`, slim out TaintedString, try fix IC * fix CI, update changelog, addQuitProc * fix CI * try fix CI * actually fix CI finally hopefully * Update lib/system/compilation.nim Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> * update kochdocs * hopefully fix csize uses for slimsystem * fix tquit Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* Use vccexe when generating static lib with vcc (#19843)Tomohiro2022-09-281-2/+3
|
* store full definition AST for consts, fix noRewrite (#20115)metagn2022-09-2818-62/+85
| | | | | | | | | | | | | | | | | | | | | | | * continue #9582 for consts, close #9331, fix #20114 also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc * changelog correctly * fix jsgen * update tgetimpl * fix sighashes * fix #19766, add comment about postfix * fix noRewrite LOL refs #16620 * fix changelog * fix destructors
* fixes #19986; mutable view from immutable location (#20134)ringabout2022-09-281-15/+24
| | | | | * fixes #19986; mutable view from immutable location * fixes the tests
* Update message for checking `cast` (#20145)konsumlamm2022-09-281-5/+5
| | | | | * Update message for checking `cast` * Update error messages in tests
* fixes #20141; dereferencing pointer to incomplete type error with cast (#20147)ringabout2022-09-281-0/+5
| | | Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
* fixes #19457 seqs are not properly updated in loop with ARC/ORC (#19922)ringabout2022-09-281-0/+10
| | | | | | | | | * test CI * fixes #19457 * add comments Co-authored-by: sandytypical <43030857+xflywind@users.noreply.github.com>
* fixes #19401; fixes #19402; rework Forward declaration and finalizer for ORC ↵ringabout2022-09-271-24/+48
| | | | | | | | | | | | | | | | | (#20295) * fixes #19401; fixes #19402; rework Forward declaration and finalizer for ORC * add more tests * give it a name * make more tests * fixes tests * hidden addr for cpp * move code to a function
* allow more simple expressions in js (#20270)Amjad Ben Hedhili2022-09-271-1/+3
| | | | | | | | * make it match ccgexprs.nim `isSimpleExpr` * x in {1, 2} * r[].x and r.x when r is ref type * float(x) Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* Compute small nim string lit at CT (#20439)Amjad Ben Hedhili2022-09-271-3/+18
| | | | | * Reduces runtime overhead for small strings. * Avoids including `makeNimstrLit` in the output when all strings are small enough.
* no ropes WIP (#20433)Andreas Rumpf2022-09-2724-1003/+1059
| | | | | | | | | | | | | * refactorings in preparation for ropes elimination of the C code generator; mostly the usual ': Rope' -> 'result: var Rope' rewrite * rewrote ccgcalls.nim * refactored ccgexprs.nim * ccgliterals: refactoring * refactoring: code dealing with name mangling * refactoring: getRecordFieldsAux * ropes are strings (insert obscene joke here) * optimize JS code gen * optimizations and code improvements * more optimizations * final cleanups
* fixes #20426; remove `maincommand` and `m` options since they are a no op ↵ringabout2022-09-261-1/+1
| | | | | | | | | | | | | | | | | since 2014 (#20429) * bump macOS image on Azure CI to macos-11 ##[warning]The macOS-10.15 environment is deprecated, consider switching to macos-11(macos-latest), macos-12 instead. For more details see https://github.com/actions/virtual-environments/issues/5583 * fix CI error * fixes #20426; remove `maincommand` and `m` options since they are a noop since 2014 and causes confusion fixes #20426 https://github.com/nim-lang/Nim/commit/7f7b13a45f73c6d9dcca3ce8388833189d77426c#diff-d949f8c356fd2dc9ceedc6f3dbbd01e2c806269dd0a8ad6516facf589fa2c99a makes it a no op, but it causes a regression because it should add `expectArg(switch, arg, pass, info)` before the discard statement. It causes https://github.com/nim-lang/Nim/issues/20426 to happen. Without `expectArg(switch, arg, pass, info)`, `-mm:orc` is wrongly interpreted as `-m` and compiler, which doesn't make sense. It should either abort compilation or prints `argument for command line option expected: '-m'` message. Since they are a no op since 2014, let's remove it to clear the confusion. Let's wait and see whether it breaks something. * add a changelog
* Represent more types as JS `TypedArray`s (#20411)Amjad Ben Hedhili2022-09-261-2/+8
| | | | | | | * Represent `array[N, char]` as JS `UInt8Array(N)` * Add support distinct and range types * Add support for bools and enums
* fix #2614 improve error message when array of proc calling convention… ↵Bung2022-09-261-19/+32
| | | | | (#20379) fix #2614 improve error message when array of proc calling convention mismatch
* 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