summary refs log tree commit diff stats
path: root/compiler/sempass2.nim
Commit message (Collapse)AuthorAgeFilesLines
* use strictdefs for compiler (#22365)ringabout2023-08-061-1/+3
| | | | | | | | | | | | | | | * wip; use strictdefs for compiler * checkpoint * complete the chores * more fixes * first phase cleanup * Update compiler/bitsets.nim * cleanup
* fixes #6499; disallow built-in procs used as procvars (#22291)ringabout2023-07-191-0/+1
|
* fixes #21987; don't create type bound ops for anything in a function with a ↵ringabout2023-06-041-1/+4
| | | | | | | `nodestroy` pragma (#21992) * fixes #21987; don't create type bound ops for anything in a function with a `nodestroy` pragma * add a comment
* Cpp Vfunctions draft (#21790)Juan M Gómez2023-05-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * introduces virtual pragma, modifies proc def, prevents proc decl * marks virtual procs as infix * forward declare vfuncs inside the typedef * adds naked callConv to virtual * virtual proc error if not defined in the same top level scope as the type * first param is now this. extracts genvirtualheaderproc * WIP syntax * supports obj. Removes the need for the prefix * parameter count starts as this. Cleanup * clean up * sem tests * adds integration tests * uses constraint to store the virtual content * introduces genVirtualProcParams --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* adds an experimental `mm:atomicArc` switch (#21798)ringabout2023-05-081-1/+1
|
* underscore as special word (#21766)metagn2023-05-021-1/+1
| | | | | * underscore as special word * fix really hard to notice error
* fixes #21245; warn about destructors that can raise (#21726)Andreas Rumpf2023-04-261-1/+2
| | | | | | | | | * fixes #21245; warn about destructors that can raise * doc update * progress * typo
* refactoring in preparation for better, simpler name mangling that wor… ↵Andreas Rumpf2023-04-241-2/+2
| | | | | | | | | | | (#21667) * refactoring in preparation for better, simpler name mangling that works with IC flawlessly * use new disamb field * see if this makes tests green * make tests green again
* remove useVersion (#21626)metagn2023-04-081-1/+1
| | | test removing useVersion
* fixes #21393 and misc style changes (#21419)Andreas Rumpf2023-02-241-9/+10
| | | | | | | | | * fixes #21393 and misc style changes * progress --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* Implemented basic macro expand functionality (#20579)Ivan Yonchovski2023-01-271-0/+3
| | | | | | | | | | | | | | | | | | * Implemented level based macro expand functionality - it can handle single macro call or expand whole function/proc/etc and it - In addition, I have altered the parser to provide the endInfo for the node. The usefulness of the `endInfo` is not limited to the `expandMacro` functionality but also it is useful for `ideOutline` functionality and I have altered the ideOutline functionality to use `endInfo`. Note `endInfo` most of the time is lost during the AST transformation thus in `nimsuggest.nim` I am using freshly parsed tree to get the location information. * Make sure we stop expanding correctly * Test CI * Fix tv3_outline.nim
* fix #20253 (#21174)Bung2023-01-131-1/+4
| | | | | | | | | * fix #20253 * change NimbleStableCommit * Update koch.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #21043; fixes a named exception in the infixAs expression which ↵ringabout2022-12-121-0/+4
| | | | | | | | | | | generate an implicit uninitialized let statement (#21081) * fixes #21043; fixes a named exception in the infixAs expression which generate an implicit uninitialized let statement * Update compiler/sempass2.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* alternative, much simpler algorithm for strict func checking (#21066)Andreas Rumpf2022-12-111-19/+18
| | | | | | | | | | | | | * alternative, much simpler algorithm for strict func checking * forgot to git add new compiler module * new spec is incredibly simple to describe * fixes bigints regression * typos * closes #16305; closes #17387; closes #20863
* tiny refactoring related to sink parameter inference logic (#21064)Andreas Rumpf2022-12-101-1/+1
| | | | | * tiny refactoring related to sink parameter inference logic * Update compiler/sempass2.nim
* definite assignment analysis for let (#21024)ringabout2022-12-061-10/+22
| | | | | | | | | | | | | | | | | | | * draft for let daa * patch * fixes bugs * errors for global let variable reassignments * checkpoint * out param accepts let * add more tests * add documentation * merge tests
* issue a warning for ptr to cstring conversion[backport] (#20814)ringabout2022-11-111-0/+5
| | | | | * issue a warning for ptr to cstring conversion[backport] * add a changelog
* implemented strictCaseObjects (#20608)Andreas Rumpf2022-10-211-3/+3
| | | | | * implemented strictCaseObjects * changelog update
* fixes #20572 (#20585)Andreas Rumpf2022-10-171-1/+1
| | | | | * fixes #20572 * added a test case
* fixes #20515; base `method` requires explicit `{.gcsafe.}` to be GC-safe ↵ringabout2022-10-161-4/+12
| | | | | | | (#20574) * fixes #20515; base requires explicit `{.gcsafe.}` to be GC-safe * add tests
* fixes #19162; enable `strictEffects` for v2 (#19380)ringabout2022-10-151-4/+4
| | | | | | | | | | | | | | | | | | | * enable stricteffects * add gcsafe * fix tests * use func * fixes pegs tests * explicitly mark repr related procs with noSideEffect * add nimLegacyEffects * change URL * fixes docopt * add `raises: []` to repr * fixes weave * fixes nimyaml * fixes glob * fixes parsetoml * Apply suggestions from code review * Update testament/important_packages.nim * add legacy:laxEffects
* 'lock levels' are deprecated, now a noop (#20539)ringabout2022-10-111-77/+1
| | | | | * 'lock levels' are deprecated, now a noop * fixes tests
* DAA and 'out' parameters (#20506)Andreas Rumpf2022-10-061-16/+22
| | | | | | | | | | | * DAA and 'out' parameters * progress * documented strictDefs and out parameters * docs, tests and a bugfix * fixes silly regression
* cleanup nfFirstWrite flags (#20500)Andreas Rumpf2022-10-051-1/+1
|
* new move analyser2 (#20471)Andreas Rumpf2022-10-011-7/+45
| | | | | | | | * 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>
* store full definition AST for consts, fix noRewrite (#20115)metagn2022-09-281-4/+5
| | | | | | | | | | | | | | | | | | | | | | | * 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 #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>
* support cstring in `case` (#20130)metagn2022-09-011-1/+1
| | | | | | | | | | | | | | | * 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
* remove unused sfProcvar, "procvar" mentions (#20204)metagn2022-08-241-1/+2
| | | refs #12975. doesn't close it because wProcvar isn't removed
* .forbids pragma: defining forbidden tags (#20050)Lancer112112022-07-261-5/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * .forbids pragma: defining illegal effects for proc types This patch intends to define the opposite of the .tags pragma: a way to define effects which are not allowed in a proc. * updated documentation and changelogs for the forbids pragma * renamed notTagEffects to forbiddenEffects * corrected issues of forbids pragma the forbids pragma didn't handle simple restrictions properly and it also had issues with subtyping * removed incorrect character from changelog * added test to cover the interaction of methods and the forbids pragma * covering the interaction of the tags and forbids pragmas * updated manual about the forbids pragma * removed useless statement * corrected the subtyping of proc types using the forbids pragma * updated manual for the forbids pragma * updated documentations for forbids pragma * updated nim docs * updated docs with rsttester.nim * regenerated documentation * updated rst docs * Update changelog.md Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> * updated changelog * corrected typo Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* fix #19435; don't create TypeBoundOps for tyOpenArray, tyVarargs [backport: ↵flywind2022-04-251-1/+1
| | | | | | | | | 1.6] (#19723) * fix #19435; openArray wronyly registers typebounds * add testcase * don't create TypeBoundOps for tyOpenArray, tyVarargs
* move assertions out of system (#19599)flywind2022-03-231-0/+3
|
* fixes #19159 [backport:1.6] (#19210)Andreas Rumpf2021-12-041-3/+4
|
* fixes another effect inference bug [backport:1.6] (#19100)Andreas Rumpf2021-11-071-0/+3
| | | | * fixes another effect inference bug [backport:1.6]
* correct effect tracking for .borrowed procs [backport] (#18882)Andreas Rumpf2021-09-231-4/+9
| | | | | | | | | | | * correct effect tracking for .borrowed procs [backport] * progress * fix error message in a test * correctly fix it Co-authored-by: narimiran <narimiran@disroot.org>
* we need something better than warningAsError for effect handling viol… ↵Andreas Rumpf2021-09-041-2/+2
| | | | | | (#18796) * we need something better than warningAsError for effect handling violations
* implements https://github.com/nim-lang/RFCs/issues/407 (#18793)Andreas Rumpf2021-09-031-0/+2
|
* fixes #18786 (#18788)Andreas Rumpf2021-09-031-6/+5
|
* strict effects (#18777)Andreas Rumpf2021-09-021-31/+85
| | | | | | | | | | | | | | | | | * fixes #17369 * megatest is green for --cpu:arm64 * docgen output includes more tags/raises * implemented 'effectsOf' * algorithm.nim: uses new effectsOf annotation * closes #18376 * closes #17475 * closes #13905 * allow effectsOf: [a, b] * added a test case * parameters that are not ours cannot be declared as .effectsOf * documentation * manual: added the 'sort' example * bootstrap with the new better options
* mitigates #12815 (#18557)Andreas Rumpf2021-07-221-2/+6
| | | | | | | | | * mitigates #12815 * Update doc/nimc.rst Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* fixes #12815 (#18554)Andreas Rumpf2021-07-221-1/+4
|
* fixes #18550 (#18553)Andreas Rumpf2021-07-211-0/+16
| | | | | * fixes #18550 * update the manual to reflect reality
* Extended side effect error messages (#18418)quantimnot2021-07-151-17/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Extended side effect error messages * Applied feedback: - refactored `markSideEffect` - refactored string interpolations - single message - skip diagnostics in `system.compiles` context Other: - started a test of diagnostic messages [ci skip] Tests aren't updated yet because messaging isn't nailed down. * - Added hints of where for side effect call locations. - Tried to clarify the reasons. * fix tests * Applied PR review feedback: - moved collection of side effects from TSym to TContext - used pragma shorthand form `.sideEffect` and `.noSideEffect` in messages - added leading '>' to structured messages for readability - changed `sempass2.markSideEffect` to a proc - replaced `system.echo` in the test to make the test compatible with Windows * Applied NEP1 formatting suggestion Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* fixes #18240 (#18354)Andreas Rumpf2021-06-251-12/+25
| | | | | * ORC: track escaping parameters properly * fixes #18240
* cString => cSourceString; tyCString => tyCstring so that error msgs show ↵Timothee Cour2021-04-171-1/+1
| | | | cstring, not cString (#17744)
* implement RFCs/294 ; disallow enum <=> enum conversion (#16351)Timothee Cour2021-04-031-3/+3
| | | | | | | | | | | * fix https://github.com/nim-lang/RFCs/issues/294 ; disallow enum <=> enum conversion * fix the runnableExamples that was the instigator of this RFC * legacy -d:nimLegacyConvEnumEnum * use -d:nimLegacyConvEnumEnum in important_package nimgame2 * add test for enum cast * improve changelog * add changelog: Changes affecting backward compatibility * cleanup changelog * fix changelog
* better error messages for .raise effect analysis (#17595)Andreas Rumpf2021-03-311-5/+7
|
* added nkError to the AST (#17567)Andreas Rumpf2021-03-291-1/+3
| | | | | | | | | | | | | * added nkError to the AST * Update lib/core/macros.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Update compiler/ast.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* fixes a bug that keeps Nimbus from compiling with --gc:orc (#17005)Andreas Rumpf2021-02-111-2/+15
| | | | | * fixes a bug that keeps Nimbus from compiling with --gc:orc * better fix
* IC: next steps (#16729)Andreas Rumpf2021-01-231-6/+6
| | | | | | | | | | | * IC: dead code elimination pass * preparations for a different codegen strategy * added documentation to the newly written code * IC: backend code * IC: backend adjustments * optimized the compiler a bit * IC: yet another massive refactoring * fixes regressions * cleanups