summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* fixes #9550; Concept related crash only when compiling to JS (#23470)ringabout2024-04-022-1/+12
| | | fixes #9550
* adds ccMember CC fixes #23434 (#23457)Juan M Gómez2024-03-296-4/+24
|
* fixes #23422; card regression (#23437)ringabout2024-03-282-1/+39
| | | | | | | | | fixes #23422 ref https://github.com/nim-lang/Nim/issues/20997 https://github.com/nim-lang/Nim/pull/21165 The function `cardSet` is used for large sets that are stored in the form of arrays. It shouldn't be passed as a pointer
* fixes #23429; rework `--verbosity` with warnings/hints (#23441)ringabout2024-03-281-0/+5
| | | fixes #23429
* Fix compile time errors when using tables on 8/16-bits systems. (#23450)Gianmarco2024-03-281-1/+4
| | | Refer to the discussion in #23439.
* Converted the 'invalid kind for firstOrd/lastOrd(XXX)' messages from ↵Nikolay Nikolov2024-03-271-4/+4
| | | | | | | | | | internal errors to fatal errors. (#23443) This fixes a nimsuggest crash when opening: beacon_chain/consensus_object_pools/blockchain_dag.nim from the nimbus-eth2 project and many other .nim files (44 files, to be precise) in the same project. Replaces: https://github.com/nim-lang/Nim/pull/23402
* Change unicode lookup tables to have int32 elements to support platforms ↵Gianmarco2024-03-252-9/+9
| | | | | | | | | | | | | | | where sizeof(int) < 4 (#23433) Fixes an issue that comes up when using strutils.`%` or any other strutils/strformat feature that uses the unicode lookup tables behind the scenes, on systems where ints are than 32-bit wide. Tested with: ```bash ./koch test cat lib ``` Refer to the discussion in #23125.
* fix atomicarc increment (#23427)Jaremy Creechley2024-03-251-1/+1
| | | | | | | | | | | | The fix to the atomicArc looks to use `-1` as the check value from the `SharedPtr` solution. However, it should be `-rcIncrement` since the refcount is bit shifted in ARC/ORC. I discovered this playing around doing atomic updates of refcounts in a user library. Related to https://github.com/nim-lang/Nim/issues/22711 @ringabout I believe you ported the sharedptr fix?
* [Cpp] Fixes an issue when mixing hooks and calls (#23428)Juan M Gómez2024-03-213-2/+19
|
* fix: use `ErrorColor` for hints marked as errors (#23430)Igor Sirotin2024-03-211-1/+2
| | | | | | | | | | | | # Description When using `--hintAsError`, we want some red color to appear in the logs. Same is already done for `warningAsError`. # Cherry-picking to Nim 1.6 Would be nice to cherry-pick this and the `warningAsError` log highlight to 1.6 branch, as it's used in status-desktop.
* Adds support for custom ASTs in the Nim parser (#23417)Andreas Rumpf2024-03-186-245/+449
|
* Update manual.md (#23393)arkanoid872024-03-161-1/+1
| | | adding link to generic == for tuples in Open and Closed symbols example
* fixes #23401; prevents nrvo for cdecl procs (#23409)ringabout2024-03-161-1/+4
| | | fixes #23401
* chore: fix some typos (#23412)soonsouth2024-03-166-7/+7
| | | Signed-off-by: soonsouth <cuibuwei@163.com>
* + added nimsuggest support for exception inlay hints (#23202)Nikolay Nikolov2024-03-157-50/+480
| | | | | | | | | | | | | | | | | This adds nimsuggest support for displaying inlay hints for exceptions. An inlay hint is displayed around function calls, that can raise an exception, which isn't handled in the current subroutine (in other words, exceptions that can propagate back to the caller). On mouse hover on top of the hint, a list of exceptions that could propagate is shown. The changes, required to support this are already commited to nimlangserver and the VS code extension. The extension and the server allow configuration for whether these new exception hints are enabled (they can be enabled or disabled independently from the type hints), as well as the inlay strings that are inserted before and after the name of the function, around the function call. Potentially, one of these strings can be empty, for example, the user can choose to add an inlay hint only before the name of the function, or only after the name of the function.
* fix BigInt conversion, xOffset/yOffset to int from int64 (#23404)Chancy K2024-03-151-1/+1
| | | | | Problem described here: https://github.com/karaxnim/karax/issues/284 Co-authored-by: Chancy Kennedy <chancy@conciergecloset.com>
* refactoring: no inheritance for PType/PSym (#23403)Andreas Rumpf2024-03-1414-253/+106
|
* Fix #23381, Use `sink` and `lent` to avoid Future[object] making a copy (#23389)握猫猫2024-03-141-10/+16
| | | | | | | | | fix #23381 As for the read function, the original plan was to use lent for annotation, but after my experiments, it still produced copies, so I had to move it out. Now the `read` function cannot be called repeatedly
* propagate efWantStmt in semWhen (#23400)metagn2024-03-142-3/+11
| | | | | | | | fixes #23399 The new case introduced in #21657 is triggered by `efWantStmt` but the `when` statement doesn't normally propagate this flag, so propagate it when the `semCheck` param in `semWhen` is true which happens when the `when` statement is `efWhenStmt` anyway.
* fixes #23382; gives compiler errors for closure iterators in JS (#23398)ringabout2024-03-141-1/+3
| | | | fixes #23382 follow up https://github.com/nim-lang/Nim/pull/15823
* Fixes an issue where exported types werent being cgen with the `exportc` ↵Juan M Gómez2024-03-111-4/+7
| | | | pragma (#23369)
* [C++] Allow `member` to define static funcs (#23387)Juan M Gómez2024-03-112-5/+21
|
* Update tests/js/tos.nim, make isAbsolute tested on nodejs under Windows. ↵lit2024-03-091-6/+4
| | | | | | | | (#23377) Windows's nodejs `isAbsolute` issue has been resolved by [this PR](https://github.com/nim-lang/Nim/pull/23365). So we can improve the coverage for Windows.
* fixes #22166; adds sideeffects for `close` and `setFilePos` (#23380)ringabout2024-03-091-2/+2
| | | fixes #22166
* fixes #22284; fixes #22282; don't override original parameters of inferred ↵ringabout2024-03-092-1/+25
| | | | | | | | | | | | | | | | | lambdas (#23368) fixes #22284 fixes #22282 ``` Error: j(uRef, proc (config: F; sources: auto) {.raises: [].} = discard ) can raise an unlisted exception: Exception ``` The problem is that `n.typ.n` contains the effectList which shouldn't appear in the parameter of a function defintion. We could not simply use `n.typ.n` as `n[paramsPos]`. The effect lists should be stripped away anyway.
* fixes #23378; fixes js abs negative int64 (#23379)ringabout2024-03-092-1/+15
| | | fixes #23378
* closes #22846; adds a test case (#23374)ringabout2024-03-081-0/+9
| | | closes #22846
* remove mention of `GC_ref` and `GC_unref` for strings (#23373)ringabout2024-03-061-5/+1
|
* closes #15751; adds a test case (#23372)ringabout2024-03-061-0/+11
| | | closes #15751
* fixes #12703; nim cpp rejects valid code would lose const qualifier for ↵ringabout2024-03-052-4/+29
| | | | | | cstring to string via cstrToNimstr (#23371) fixes #12703 ref #19588
* closes #10219; adds a test case (#23370)ringabout2024-03-051-0/+20
| | | closes #10219
* fixes #20945; fixes #18262; provides C API `NimDestroyGlobals` for ↵ringabout2024-03-042-0/+25
| | | | | | | | | static/dynlib libraries (#23357) fixes #20945 fixes #18262 todo - [ ] perhaps export with lib prefix when the option is enabled
* fix `isAbsolute` broken when `nodejs` on Windows (#23365)litlighilit2024-03-041-3/+3
| | | | | | | | | | | When target is nodejs, `isAbsolute` used to only check in the POSIX flavor, i.e. for js backend on Windows, ```nim isAbsolute(r"C:\Windows") == false ``` This fixes it.
* makes nimsuggest listen on localhost by default (#23351)Juan M Gómez2024-03-041-1/+1
|
* remove obselete doc with nimrtl (#23358)ringabout2024-03-041-3/+0
| | | since nimrtl.dll is created with `--threads:on`
* ref #23333; fixes AF_INET6 value on Linux (#23334)ringabout2024-03-031-1/+1
| | | ref #23333
* Dont mangle when targeting cpp (#23335)Juan M Gómez2024-03-032-2/+2
| | | | Unfortunately we cant trick the debugger when targeting C++ so this one also needs to wait for our own debugger adapter.
* Update browsers.nim, deprecate unimplemented `openDefaultBrowser()` (#23332)litlighilit2024-03-031-14/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | For this [proc](https://github.com/nim-lang/Nim/blob/773c066634d831a968bb464eab35b25a00026525/lib/pure/browsers.nim#L83) `proc openDefaultBrowser*() {.since: (1, 1).}`: though it's documented to open default browser with `about:blank` page, it behaves differently: - On Windows, it failed and open no window - On Linux(Debian with Kde), it opens not default browser but `Konqueror` I have paid much effort to implement this variant, but even the implementation on Windows is considerably complex. In short, it's not only hard but unworthy to fix this. Just as Araq [said](https://github.com/nim-lang/Nim/issues/22250#issuecomment-1631360617), we shall remove the `proc openDefaultBrowser*() {.since: (1, 1).}` variant --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* Fix nimsuggest highlight for import statements (#23263)autumngray2024-03-032-1/+21
| | | | | | | | | | | Currently, I don't have syntax highlighting (+ no/wrong jump-to-definition) for some import statement forms, namely: - `import module/name/with/(slashes)` - `import (mod) as alias` - `import basemod/[ (sub1), (sub2) ]` With this patch, highlight/def will work for the regions indicated by parentheses.
* fixes #23273; forbids methods having importc pragmas (#23324)ringabout2024-03-031-0/+4
| | | fixes #23273
* fixes sink regression for ORC; ref #23354 (#23359)ringabout2024-03-033-2/+19
| | | | | | | | | ref #23354 The new move analyzer requires types that have the tfAsgn flag (otherwise `lastRead` will return true); tfAsgn is included when the destructor is not trival. But it should consider the assignement for objects in this case because objects might have a trival destructors but it's the assignement that matters when it is passed to sink parameters.
* fixes #13481; fixes #22708; disable using union objects in VM (#23362)ringabout2024-03-032-8/+2
| | | | | | fixes #13481; fixes #22708 Otherwise it gives implicit results or bad codegen
* make use of C++11's auto type deduction for temporary variables (#23327)heterodoxic2024-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is just one of those tiny steps towards the goal of an "optimized" C and C++ codegen I raised elsewhere before - what does me babbling "optimized" mainly entail? (not mutually-exclusive ascertainment proposals following:) - less and simplified resulting code: easier to pick up/grasp for the C/C++ compiler for to do its own optimization heuristics, less parsing effort for us mere humans trying to debug, especially in the case of interop - build time reduction: less code emission I/O, runtime string formatting for output... - easier access for fresh contributors and better maintainability - interop improvements - further runtime optimizations I am eagerly looking forward to the results of the LLVM-based undertakings, but I also think we can do a bit better (as outlined above) with our current C/C++ backends till those come to fruition. **Long story short**: this PR here focuses on the C++ backend, augmenting the current codegen method of establishing "temporary" variables by using C++11's auto type deduction. The reasons for adopting an "Almost Always Auto" style have been collected [here ](https://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-almost-always-auto/) for the C++ world. For those hopping between C++'s and Nim's realms, this change also results in a bit less code and less work for the codegen part (no redundant `getTypeDesc`s): no need to tell the C++ compiler the type it already knows of (in most cases).
* strformat: detect format string errors at compile-time (#23356)Jacek Sieka2024-03-032-40/+111
| | | | | | | | | | | | This also prevents unwanted `raises: [ValueError]` effects from bubbling up from correct format strings which makes `fmt` broadly unusable with `raises`. The old runtime-based `formatValue` overloads are kept for backwards-compatibility, should anyone be using runtime format strings. --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes an issue with string to 'var openArray' at compile-time; [backp… ↵Andreas Rumpf2024-03-032-21/+26
| | | | | (#23363) …ort]
* improve error messages [backport] (#23345)ringabout2024-02-261-34/+79
| | | | | | ref https://forum.nim-lang.org/t/11052 ![image](https://github.com/nim-lang/Nim/assets/43030857/1df87691-32d9-46b5-b61b-6b9f7cc94862)
* Revert "disable measuremancer" (#23353)ringabout2024-02-261-1/+1
| | | | | | Reverts nim-lang/Nim#23352 ref https://github.com/SciNim/Measuremancer/commit/e2e994b21c162d5c382f04383893f2abb12af51f
* fixes #23306 nim cpp -r invalid code generation regression with closure ↵Juan M Gómez2024-02-262-2/+14
| | | | iterators and try/catch-like constructions (#23317)
* disable measuremancer (#23352)ringabout2024-02-261-1/+1
| | | ref https://github.com/SciNim/Measuremancer/issues/17
* * fixed nimsuggest crash with 'Something = concept' put (erroneously) ↵Nikolay Nikolov2024-02-243-1/+28
| | | | outside of a 'type' block (#23331)