summary refs log tree commit diff stats
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
* extend the skipAddr for potential types for destructors (#22265)ringabout2023-07-181-2/+1
| | | extend the skipAddr for potential types
* Fix non-toplevel fields in objects not getting rendered (#22266)Jake Leahy2023-07-161-24/+71
| | | | | | | | | | | | | * Add example object into testproject The proc is there to check the case of an identDef being inside an identDef (We do want to render those even if they are not exported) * Add `inside` set to `TSrcGen` which allows us to see what context we are in This is done instead of adding another inXyz bool parameter We then use this to know if we are inside an object when rendering an nkIdentDefs (To know if we need to skip rendering it) * Update test files
* Fixes Naive virtual crash the compiler fixes #22269 (#22271)Juan M Gómez2023-07-161-1/+1
| | | | | * Fixes Naive virtual crash the compiler fixes #22269 * adds type specific test
* gendepends now supports pkgs2 (#22277)ringabout2023-07-141-6/+10
|
* fixes #22237; fixes #21160; wrong cursor on unowned parameters in the for ↵ringabout2023-07-101-2/+15
| | | | | loop in ORC (#22240) fixes #22237; fixes #21160; wrong cursor on unowned parameters
* Fix nimsuggest not showing suggestions for imported tuples (#22241)Jake Leahy2023-07-101-1/+9
| | | | | | | | | | | * Add tests Also test if exported all tuple fields works. This seems like a hacky solution so will try and dive further to find a better solution * Always suggest tuple fields if it passes the filter If the tuple we are accessing is in scope then all the fields will also be in scope * Update tests so line numbers are correct
* fixes #21730; adds pkgs2 as well when nimbleDir is set (#22234)ringabout2023-07-071-0/+2
|
* Tolerate markup errors for doc comments (#19607) (#22235)Andrey Makarov2023-07-072-5/+17
| | | | | | | | | | | | | | | | | Follow-up to #21576 (for solving #19607). 1) errors in Markdown mode for `.nim` doc comments are reported with red color but allow to generate `.html` with the comment represented by literate block (monospaced text). We suppose that it's what people want for (supposedly) small doc comments. And this behavior is also a bit more Markdown-ish in the sense that Markdown generally does not have the concept of parsing error. - However, for standalone `.md` it's **not** applied because for large files the consequences are way bigger. (In {.doctype: rst.} mode the behavior is the same as before -- report the error and stop.) In future, when our parser can handle Markdown without errors according to the spec, this code will most probably be not needed.
* fixes #22175 (#22229)Andreas Rumpf2023-07-061-2/+5
|
* alternative to #22219; adds a pointer wrapper for T destructor (#22225)ringabout2023-07-062-6/+53
| | | | | | | | | | | | | | | * alternative to #22219; adds a pointer wrapper for T destructor * clean up and add comments * Update compiler/ccgtypes.nim * tidy up * fixes comments * fixes cpp * fixes cpp
* Fix concepts with doc comments (#22228)Jake Leahy2023-07-061-1/+3
| | | | | | | | | | | | | | | * Add testcase This tries to use a concept with a doc comment which currently leads to a segfault * Ignore nil nodes which happen when there are doc comments in new style concept This was done instead of semming the comments since `semConceptDecl` says it only supports lists of actual statements * Go with alternative fix: Sem comments but ignore them Since `nil` could mean anything it is best to not silently ignore it (In case another nil problem happens in future Also fix test case so it isn't an infinite loop
* fixes #22132; hoisted openArray params result in erroneous code (#22224)ringabout2023-07-051-1/+4
|
* fixes #22138 (#22221)Andreas Rumpf2023-07-041-2/+7
|
* fixes #22212; Compile error when running a Nimscript that compares se… ↵ringabout2023-07-032-4/+16
| | | | | (#22213) fixes #22212; Compile error when running a Nimscript that compares seq with switch("mm", "arc")
* fixes #22208; Ambiguous error when import modules with same names but… ↵ringabout2023-07-031-1/+1
| | | | | (#22211) fixes #22208; Ambiguous error when import modules with same names but different aliases
* clean up the documentation (#22196)ringabout2023-07-021-1/+1
|
* fixes #22197; Distinct ref objects + destructor cause C++ codegen error (#22207)ringabout2023-07-021-0/+8
|
* fixes #22200 (#22206)Andreas Rumpf2023-07-021-0/+4
| | | | | * fixes #22200 * typo
* reset macrocache after each script evaluation (#22195)Juan M Gómez2023-06-301-1/+4
|
* fix nested call regression in generic bodies (#22189)metagn2023-06-291-0/+11
| | | fixes #22187
* alternative to #22183; nimscript shares the same compileTime sym with VM ↵ringabout2023-06-291-1/+5
| | | | (#22184)
* fixes #19101; zero initialization union casts (#22185)ringabout2023-06-295-13/+12
| | | | | | | * zero initialization union casts * cleans up and adds a test case for #19101 * uses nimZeroMem
* fix new type inference for `noreturn` [backport] (#22182)metagn2023-06-281-7/+14
| | | | | fixes #22180 Backported since apparently the new type inference was backported
* fixes #22001 (#22177)Andreas Rumpf2023-06-271-2/+4
| | | | | * fixes #22001 * added test case
* fixes #22137 (#22170)Andreas Rumpf2023-06-271-1/+3
|
* adds =destroy T support for strings and seqs (#22167)ringabout2023-06-271-2/+2
| | | | | | | * adds =destroy T support for strings and seqs * fixes system * fixes tests
* adds T destructor for refs (#22147)ringabout2023-06-261-1/+6
| | | | | | | | | * adds T destructor for refs * add `newRefdestructor` * adds ref overload for destructors * fixes config
* fixes #22148; std/memfiles.memSlices nesting now fails with memory sa… ↵ringabout2023-06-251-1/+1
| | | | | | | (#22154) * fixes #22148; std/memfiles.memSlices nesting now fails with memory safety capture violation * adds a test case
* make `var object` match better than `object` (#22152)metagn2023-06-251-1/+3
| | | | | | | | | | | * fix `var object` not matching better than `object` fixes #13302 * remove comment for brevity * try note * try minimize breaks
* fix VM uint conversion size bug, stricter int gen on JS (#22150)metagn2023-06-252-9/+23
| | | | | | | | | | | * fix VM uint conversion bug, stricter int gen on JS fixes #19929 * fix float -> uint64 conversion too * no need to mask to source type * simpler diff with explanation, add test for described issue
* macOS `ar` doesn't support `@` syntax (#22146)Etan Kissling2023-06-241-1/+4
| | | | | | When the linker command line is long, Nim compiler generates a file for passing the linker arguments. On `macOS`, that mechanism fails as the `@` syntax is not supported by `ar`. Use `xargs` instead to pass the linker arguments file.
* adds nimbasePattern compiler option (#22144)Juan M Gómez2023-06-243-1/+6
| | | adds optonal --nimbasepattern
* fixes #21110; duplicate proc definitions for inline iters (#21136)ringabout2023-06-221-0/+8
| | | fixes #21110; duplicate proc definitions for iters
* fixes #21231; template with module as parameter elides usage/checking of ↵ringabout2023-06-211-0/+3
| | | | | | | module name specifier (#22109) * fixes #21231; template with module as parameter elides usage/checking of module name specifier * add a test case
* adds missing staticlib hints (#22140)ringabout2023-06-211-1/+1
|
* allow destructors to accept non var parameters; deprecate `proc =destroy(x: ↵ringabout2023-06-214-6/+20
| | | | | | | | | | var T)` (#22130) * make destructors accept non var parameters * define nimAllowNonVarDestructor * add a test case and a changelog * update documentation and error messages * deprecate destructors taking 'var T'
* fixes #22123; Compiler bug with default initializer values and arrays (#22128)ringabout2023-06-201-4/+4
|
* overhaul the error messages of `=dup` (#22129)ringabout2023-06-201-6/+41
|
* fixes #22117; View types lifetime tracking does not work with defer (#22121)ringabout2023-06-191-0/+18
|
* Create compiler and nimsuggest packages (#22118)Ivan Yonchovski2023-06-181-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have tested it locally with the following in my local packages_official.json ``` { "name": "compiler", "url": "https://github.com/yyoncho/Nim.git/?subdir=compiler", "method": "git", "tags": [ "library", "compiler" ], "description": "Package providing the Nim compiler binaries plus all its source files that can be used as a library", "license": "MIT", "web": "https://github.com/nim-lang/Nim" }, { "name": "nimsuggest", "url": "https://github.com/yyoncho/Nim.git/?nimsuggest=compiler", "method": "git", "tags": [ "library", "compiler" ], "description": "Package providing the Nim compiler binaries plus all its source files that can be used as a library", "license": "MIT", "web": "https://github.com/nim-lang/Nim" }, ``` Then `nimble install compiler`, `nimble install nimsuggest` work as expected.
* fix scoping regression with calls in generic bodies (#22115)metagn2023-06-172-3/+3
| | | refs #22029, refs https://github.com/status-im/nim-libp2p/actions/runs/5263850340/jobs/9514434659
* Add divmod (#22102)Ryan McConnell2023-06-172-1/+14
| | | | | | | | | | | | | | | | | | | | | | | * Adding divmod * Adding support to VM * Wrapped C structs and funcs * Fix javascript impl * Fixing struct compat * Segregate tests, better compiletime defs * Using `inline` and switch back to `func` * Apply suggestions from code review * Explicit structures --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #16331; aliasing of tuple construction within a single assignme… ↵Andreas Rumpf2023-06-161-3/+18
| | | | | | | (#22113) * fixes #16331; aliasing of tuple construction within a single assignment, great coding style * added test case
* fixes #22049; fixes #22054; implicit conversion keeps varness (#22097)ringabout2023-06-161-1/+7
| | | | | | | | | | | | | | | | | | | | | * fixes #22054; codegen for var tuples conv * rethink fixes * add test cases * templates only * fixes var tuples * keep varness no matter what * fixes typ.isNil * make it work for generics * restore isSubrange * add a test case as requested
* fixes #19607 (#21576)Andreas Rumpf2023-06-161-11/+17
|
* consider object types as declarative in templates (#22106)metagn2023-06-161-13/+36
| | | | | | | | | * consider object types as declarative in templates fixes #16005 * correct logic for nkRecList children, inject fields * don't actually inject fields
* fixes ilegal recursion (#22105)Juan M Gómez2023-06-161-1/+3
|
* adds another pass for sets fixes #6259 (#22099)Juan M Gómez2023-06-152-2/+4
| | | | | | | * adds another pass for sets fixes #6259 * Update tsets.nim removes extra `#`
* fixes explicit deref block (#22093)ringabout2023-06-152-3/+3
| | | fixes explicit deref
* Allows for arbitrary ordering of inheritance in type section #6259 (#22070)Juan M Gómez2023-06-153-5/+10
| | | | | | | | | | | | | * Allows for arbitrary ordering of inheritance in type section #6259 * prevents ilegal recursion * fixes ilegal recursion. Test passes with a better message * Apply suggestions from code review --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>