summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year 2024 (#23144)ringabout2023-12-313-3/+3
|
* Fix typo in pegs.nim (#23143)Ikko Eltociear Ashimine2023-12-301-3/+3
| | | wether -> whether
* Adds info:capabilities to NimSuggest (#23134)Juan M Gómez2023-12-291-0/+8
|
* fixes a typo in the test (#23140)ringabout2023-12-291-1/+1
|
* Fix cmpRunesIgnoreCase on system where sizeof(int) < 4. Fixes #23125. (#23138)Gianmarco2023-12-281-1/+6
| | | | | | | Fixes an issue where importing the `strutils` module, or any other importing the `strutils` module, ends up with a compile time error on platforms where ints are less then 32-bit wide. The fix follows the suggestions made in #23125.
* Asm syntax pragma (#23119)ASVIEST2023-12-254-15/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (Inspired by this pragma in nir asm PR) `inlineAsmSyntax` pragma allowing specify target inline assembler syntax in `asm` stmt. It prevents compiling code with different of the target CC inline asm syntax, i.e. it will not allow gcc inline asm code to be compiled with vcc. ```nim proc nothing() = asm {.inlineAsmSyntax: "gcc".} """ nop """ ``` The current C(C++) backend implementation cannot generate code for gcc and for vcc at the same time. For example, `{.inlineAsmSyntax: "vcc".}` with the ICC compiler will not generate code with intel asm syntax, even though ICC can use both gcc-like asm and vcc-like. For implement support for gcc and for vcc at the same time in ICC compiler, we need to refactor extccomp --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* CI entry may be reset to default (#23127)Ryan McConnell2023-12-251-1/+1
|
* make `-d:debugHeapLinks` compile again (#23126)ringabout2023-12-241-4/+6
| | | | | I have made `realloc` absorb unused adjacent memory, which improves the performance. I'm investigating whether `deallocOsPages` can be used to improve memory comsumption.
* fix spurious indent and newlines in rendering of nkRecList (#23121)metagn2023-12-245-20/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rendering of `nkRecList` produces an indent and adds a new line at the end. However for things like case object `of`/`else` branches or `when` branches this is already done, so this produces 2 indents and an extra new line. Instead, just add an indent in the place where the indent that `nkRecList` produces is needed, for the rendering of the final node of `nkObjectTy`. There doesn't seem to be a need to add the newline. Before: ```nim case x*: bool of true: y*: int of false: nil ``` After: ```nim case x*: bool of true: y*: int of false: nil ```
* Add `toSinglyLinkedRing` and `toDoublyLinkedRing` to `std/lists` (#22952)Eric N. Vander Weele2023-12-242-0/+23
| | | | Allow for conversion from `openArray`s, similar to `toSinglyLinkedList` and `toDoublyLinkedList`.
* retain postfix node in type section typed AST, with docgen fix (#23101)metagn2023-12-236-25/+65
| | | | | | Continued from #23096 which was reverted due to breaking a package and failing docgen tests. Docgen should now work, but ~~a PR is still pending for the package: https://github.com/SciNim/Unchained/pull/45~~ has been merged
* add switch, warning, and `bind` support for new generic injection behavior ↵metagn2023-12-228-6/+176
| | | | | | | | | | | | | | | | | | | | | (#23102) refs #23091, especially post merge comments Unsure if `experimental` and `bind` are the perfect constructs to use but they seem to get the job done here. Symbol nodes do not get marked `nfOpenSym` if the `bind` statement is used for their symbol, and `nfOpenSym` nodes do not get replaced by new local symbols if the experimental switch is not enabled in the local context (meaning it also works with `push experimental`). However this incurs a warning as the fact that the node is marked `nfOpenSym` means we did not `bind` it, so we might want to do that or turn on the experimental switch if we didn't intend to bind it. The experimental switch name is arbitrary and could be changed. --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* makes nimsuggest `con` work under v3 (#23113)Juan M Gómez2023-12-222-3/+19
| | | Co-authored-by: Jake Leahy <jake@leahy.dev>
* document `--experimental:vtables` (#23111)ringabout2023-12-211-0/+35
|
* fixes nimdoc warnings (#23110)ringabout2023-12-211-1/+1
|
* update action versions (#23109)ringabout2023-12-213-4/+4
|
* update mac CI to macos 12 (#23108)metagn2023-12-212-3/+3
| | | | | | closes #23107 Could also change to `macos-latest` but nothing else in CI uses `latest` OS versions.
* Don't crash for invalid toplevel parseStmt/Expr calls (#23089)Jake Leahy2023-12-193-4/+27
| | | | | | | | | | | | | | | This code will crash `check`/`nimsuggest` since the `ra` register is uninitialised ```nim import macros static: discard parseExpr("'") ``` Now it assigns an empty node so that it has something Testament changes were so I could properly write a test. It would pass even with a segfault since it could find the error
* fixes strictnotnil for func, method, converter (#23083)ringabout2023-12-191-1/+1
|
* fixes #18073; fixes #14730; document notnil is only applied to local … ↵ringabout2023-12-191-3/+7
| | | | | | | | (#23084) …symbols fixes #18073 fixes #14730
* allow non var deinit for locks and conds: alternative way (#23099)ringabout2023-12-193-17/+17
| | | alternative to https://github.com/nim-lang/Nim/pull/23092
* Revert "retain postfix node in type section typed AST" (#23098)metagn2023-12-194-29/+5
| | | Reverts nim-lang/Nim#23096
* retain postfix node in type section typed AST (#23096)metagn2023-12-184-5/+29
| | | fixes #22933
* add tuple unpacking changes to changelog (#23093)metagn2023-12-181-0/+19
| | | | | | closes #23042 Adds changes from #22537 and #22611 to changelog (I believe both are set for 2.2).
* allow replacing captured syms in macro calls in generics (#23091)metagn2023-12-185-7/+126
| | | | | | | | | | | | | | | | | | fixes #22605, separated from #22744 This marks symbol captures in macro calls in generic contexts as `nfOpenSym`, which means if there is a new symbol in the local instantiatied body during instantiation time, this symbol replaces the captured symbol. We have to be careful not to consider symbols outside of the instantiation body during instantiation, because this will leak symbols from the instantiation context scope rather than the original declaration scope. This is done by checking if the local context owner (maybe should be the symbol of the proc currently getting instantiated instead? not sure how to get this) is the same as or a parent owner of the owner of the replacement candidate symbol. This solution is distinct from the symchoice mechanisms which we originally assumed had to be related, if this assumption was wrong it would explain why this solution took so long to arrive at.
* Fix grammar (#23090)Stephen2023-12-181-1/+1
|
* types refactoring; WIP (#23086)Andreas Rumpf2023-12-1711-97/+81
|
* Show the name of the unexpected exception that was thrown in `std/unittest` ↵Jake Leahy2023-12-171-1/+2
| | | | | (#23087) Show name of error that wasn't expected in an `expect` block
* Mark `macros.error` as `.noreturn.` (#23081)Jake Leahy2023-12-175-1/+30
| | | | | | | | | | | | | | | Closes #14329 Marks `macros.error` as `.noreturn` so that it can be used in expressions. This also fixes the issue that occurred in #19659 where a stmt that could be an expression (Due to having `discardable` procs at the end of other branches) would believe a `noreturn` proc is returning the same type e.g. ```nim proc bar(): int {.discardable.} = discard if true: bar() else: quit(0) # Says that quit is of type `int` and needs to be used/discarded except it actually has no return type ```
* Allow `parseAll` to parse statements separated by semicolons (#23088)Jake Leahy2023-12-172-16/+14
| | | | | | | | | | | | | | | | | | Fixes the second issue listed in #9918. Fixed by replacing the logic used in `parseAll` with just a continious loop to `complexOrSimpleStmt` like what the [normal parser does](https://github.com/nim-lang/Nim/blob/devel/compiler/passes.nim#L143-L146). `complexOrSimpleStmt` [guarantees progress](https://github.com/nim-lang/Nim/blob/devel/compiler/parser.nim#L2541) so we don't need to check progress ourselves. Also allows `nimpretty` to parse more valid Nim code such as ```nim proc foo(); # Would complain about indention here # ... proc foo() = # ... ```
* fixes #22637; now `--experimental:strictNotNil` can be enabled globally (#23079)ringabout2023-12-161-2/+2
| | | fixes #22637
* fixes not nil examples (#23080)ringabout2023-12-151-0/+1
|
* make treeToYaml print yaml (and not json) (#23082)Jacek Sieka2023-12-152-170/+203
| | | less verbose - used in nph
* type refactor: part 4 (#23077)Andreas Rumpf2023-12-1525-194/+197
|
* fixes yet another strictdefs bug (#23069)ringabout2023-12-1529-117/+138
|
* rationals: support Rational[SomeUnsignedInt] (#23046)shirleyquirk2023-12-152-6/+15
| | | | | | | | fixes #22227 rationale: - `3u - 4u` is supported why not`3u.toRational - 4u.toRational` - all of rationals' api is on SomeInteger, looks like unsigned is declared as supported - math on unsigned rationals is meaningful and useful.
* Param match relax (#23033)Ryan McConnell2023-12-1510-69/+154
| | | | | | | | | | | #23032 --------- Co-authored-by: Nikolay Nikolov <nickysn@gmail.com> Co-authored-by: Pylgos <43234674+Pylgos@users.noreply.github.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> Co-authored-by: Jason Beetham <beefers331@gmail.com>
* fixes #23051; don't generate documentation for exported symbols again (#23074)ringabout2023-12-141-1/+2
| | | | | | | | | | | | | fixes #23051 Before ![image](https://github.com/nim-lang/Nim/assets/43030857/d402a837-281e-4035-8302-500f64dccdb5) After ![image](https://github.com/nim-lang/Nim/assets/43030857/de9a23f1-9e50-4551-b3fd-3311e1de378e)
* Overloads passed to static proc parameters now convert to the desired… ↵Jason Beetham2023-12-144-8/+32
| | | | | (#23063) … type mirroring proc params
* fixes #23065; DocLike command defaults to ORC (#23075)ringabout2023-12-141-1/+2
| | | fixes #23065
* type graph refactor; part 3 (#23064)Andreas Rumpf2023-12-1417-270/+257
|
* fixes #9381; Fix double evaluation of types in generic objects (#23072)Pylgos2023-12-142-5/+28
| | | fixes https://github.com/nim-lang/Nim/issues/9381
* Skip trailing asterisk when placing inlay type hints. Fixes #23067 (#23068)Nikolay Nikolov2023-12-131-2/+13
|
* nimpretty: check the rendered AST for wrong output (#23057)Andreas Rumpf2023-12-133-14/+55
|
* fixes #23060; `editDistance` wrongly compare the length of rune strings (#23062)ringabout2023-12-132-1/+6
| | | fixes #23060
* type refactoring: part 2 (#23059)Andreas Rumpf2023-12-1335-430/+422
|
* Typrel whitespace (#23061)Ryan McConnell2023-12-131-24/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just makes the case statements easier to look at when folded ```nim case foo of a: of b: of c: else: case bar: of a: of b: of c: of d: else: ``` to ```nim case foo of a: of b: of c: else: case bar: of a: of b: of c: of d: else: ```
* Types: Refactorings; step 1 (#23055)Andreas Rumpf2023-12-1257-658/+713
|
* Look up generic parameters when found inside semOverloadedCall, fixin… ↵Jason Beetham2023-12-122-0/+22
| | | | | | | | | (#23054) …g static procs --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Ast stmt now saves its ast structure in the compiler (#23053)ASVIEST2023-12-122-1/+8
| | | | | | | see https://github.com/nim-lang/Nim/issues/23052 --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>