summary refs log tree commit diff stats
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
* fix #18977; disallow change branch of an object variant in ORC (#21526)ringabout2023-03-162-13/+36
| | | | | | | | | | | * fix #18977 disallow change branch of an object variant in ORC * check errors for goto exception * fixes conditions * fixes tests * add a test case for #18977
* fixes #19857; Exception raised in closure may be "skipped" in ORC (#21530)ringabout2023-03-161-0/+1
| | | fixes #19857; Exception raised in closure may be "skipped"
* Optimize `cgen.addIndent` (#21508)Amjad Ben Hedhili2023-03-131-2/+6
| | | | | * Optimize `cgen.addIndent` * Avoid temporaries
* fixes explicit globals in macros (#21502)ringabout2023-03-121-1/+2
|
* fixes #21496; Ambiguous calls compiles when module name are equal (#21500)ringabout2023-03-121-1/+2
| | | | | * fixes #21496; Ambiguous calls compiles when module name are equal * add a test case
* minor refactoring (#21499)Andreas Rumpf2023-03-101-7/+1
|
* fixes #21306; fixes #20485; don't transform yields in the var section when ↵ringabout2023-03-101-1/+4
| | | | | | | | | | | introducing new local vars [backport: 1.6] (#21489) * fixes #21306; don't transform yields in the var section when introducing new local vars * adds `inVarSection` so the var section in the var section is freshed * use `isIntroducingNewLocalVars` to avoid yield transformations in var sections * fixes comments
* fixes #21023; Segfault when mixing seqs, orc, variants and futures (#21497)ringabout2023-03-101-18/+43
| | | | | | | | | * fixes #21023; Segfault when mixing seqs, orc, variants and futures * fixes none of the branches were explicitly selected * add one more test * one more test
* fixes quoted variables with typedesc types (#21493)ringabout2023-03-091-1/+1
|
* a better message if graphviz's dot/nodejs is not found in PATH (#21488)ghost2023-03-082-1/+8
| | | | | | | | | * finish issue #21474: a better message if dot is not found locally when using gendepend * fix a typo in compiler * trim empty path reported in `findNodeJs` * compiler/main.nim: switch raise to simply quit
* fixes #21377; fixes `@[]` and `{}` type inference as returns in generics ↵ringabout2023-03-063-4/+15
| | | | | | | | | | | | | (#21475) * fixes `@[]` type inference in generics * add issue links * fixes macros and iterators * refactor * add one more test
* Add line directives for C code variables (#21466)Joey2023-03-051-2/+6
| | | | | * Add line directives for C code variables * Refactor genCLineDir to only use toFullPath if necessary
* Fix #21272: Rewrite parts of pickBestCandidate (#21465)SirOlaf2023-03-051-36/+50
| | | | | | | | | | | | | | | * Make pickBestCandidate store syms * Remove useless cursor * Try making pickBestCandidate more readable * Fix advance order * Revert back to seq with lots of comments --------- Co-authored-by: SirOlaf <>
* remove nosinks hacks from compiler (#21469)ringabout2023-03-049-13/+13
|
* `--embedsrc` for JavaScript (#21467)quantimnot2023-03-041-0/+2
| | | Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* fixes #21461 (#21463)Arnaud Moura2023-03-031-1/+1
| | | | | * fixes #21461; Move nim-gdb.py and add nim-lldb.py * fixes bad path for nim-gdb.py
* replaces implicit passes array registed at runtime with explicit function ↵ringabout2023-03-0315-316/+533
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | calls; simplify compilation pipeline (#21444) * abolish using passes in the compiler; simplify compilation pipeline * duplicate code * Really cool to have the same signature... * haul * unify other backends * refactor process * introduce PipelinePhase * refactor compiler * fixes passes * fixes nimsuggest * add a sentinel * enable docs checkj * activate doc testing * clean up * complete cleanups
* fixes #20139; hash types based on its path relative to its package path ↵ringabout2023-03-0210-74/+125
| | | | | | | | | | | | | | | (#21274) [backport:1.6] * fixes #20139; hash types based on its path relative its project * add a test case * fixes procs * better implementation and test case --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #20422; emit nimPrepareStrMutationV2 for toOpenArray to keep th… ↵Andreas Rumpf2023-03-022-2/+7
| | | | | (#21459) fixes #20422; emit nimPrepareStrMutationV2 for toOpenArray to keep the abstraction of mutable strings which have immutable string literals
* fixes #19291; implements `wasMoved` hook (#21303)ringabout2023-03-025-15/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fixes #19291; implements `wasMoved` hook * basics * checkpoint * finish `wasMoved` * add a test for #19291 * add documentation and changelog * work `attachedWasMoved` with generics * fixes optimizer * register `=wasMoved` * handle wasMoved magcis * check another round * some patches * try `op == nil` * nicer * generate `wasMoved` before `destroy` * try again * fixes tests * default wasMoved * Update tests/destructor/tv2_cast.nim * Update tests/destructor/tv2_cast.nim * Update tests/arc/topt_refcursors.nim
* fixes #21326; fixes #7375; fixes #11986; fixes #9607; rework quote do; ↵ringabout2023-03-022-5/+11
| | | | | | | | | | | | | `getAst` uses type info to annotate the type of quoted variables; no more type erasures for quoted variables (#21433) * fixes #21326; getAst uses type info to annotateType quoted variables * simplify logics; sem types first * fixes important packages * add testcases * tiny
* fixes #10938; fixes #13312; fixes #13918; fixes #20985; always initializes ↵ringabout2023-03-011-0/+12
| | | | | | | | | | | global variables with null values in VM (#21351) * fixes #10938; always initialize global variable in VM * fixes importc vars * there is a pre-existing issue regarding closure types in the VM * add tests
* suggestion for a simple fix for #21279 (#21378)heterodoxic2023-03-011-3/+9
|
* Fix typo in sourcemap.nim (#21438)Ikko Eltociear Ashimine2023-02-271-1/+1
| | | seperated -> separated
* fixes #21439; Add tyOpenArray to genTypeInfo. (#21440)Constantine Molchanov2023-02-271-1/+1
| | | | | * fixes #21439; Add tyOpenArray to genTypeInfo. * Add test.
* fixes #20695; fixes object with distinct defaults and tables (#21428)ringabout2023-02-241-1/+3
|
* fixes #21393 and misc style changes (#21419)Andreas Rumpf2023-02-242-28/+30
| | | | | | | | | * fixes #21393 and misc style changes * progress --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* Mitigate issues related to compiler options when cross-compiling (#21330)Francis Thérien2023-02-221-1/+3
| | | | | * Document C compiler options config when cross-compiling * Allow empty string to override default
* fixes #19795; fixes #11852; fixes #19974; remove parsing pipeline, Nim now ↵ringabout2023-02-228-11/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parses the whole module at one time (#21379) * fixes #19795; remove parse pipeline * isScript * fixes nimscriptapi * don't touch reorder * check script * fixes tests * it seems implicit imports of system cause troubles * access the first child of `nkStmtList` * ignore comments * minor messages * perhaps increases hloLoopDetector * the module is a stmtList, which changes the errors * fixes nimdoc * fixes tlinter * fixes nim secret tests * fixes arc_misc * fixes nim secret tests again * safe; fixes one more test * GlobalError is the root cause too * fixes parsing errors * put emit types to the cfsForwardTypes section * fixes #11852; `{.push checks:off}` now works in procs * disable navigator * fixes nimdoc * add tests for JS * fixes nimsuggest
* saves one unnecessary compare which is also a small regression (#21413)ringabout2023-02-211-1/+1
| | | | | saves one unnecessary compare which is also a sall regression follow up https://github.com/nim-lang/Nim/commit/d30c6419a051a815e3fdb354ac79522f17e55bda
* Specify that address is taken when converter takes a var parameter (#21391)Jake Leahy2023-02-211-0/+1
| | | | | | | * Add test case * closes #21247 Add the sfAddrTaken flag to var parameters in converters This allows the JS backend to properly pass the parameter as a fat pointer
* improve invalid module names errors (#21412)ringabout2023-02-211-1/+2
| | | I have seen these questions: "Why I got an invalid module name errors?". To eliminate this kind of questions, We might improve th error messages. Though, the question might evolve into "What is a valid Nim identifier", which should be more searchable on the Internet.
* Fix long link commands on macOS (v2) (#21382)Matt Haggard2023-02-171-2/+14
| | | Handle long link commands on macOS with a script, since ar does not support response files
* Add support for NuttX RTOS. (#21372)Century Systems2023-02-162-2/+9
| | | | | | | | | | | | | | | | | | | | | | * Add support for NuttX RTOS. Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp> * lib: pure: asyncdispatch: assign to result. Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp> * lib: std: typedthreads: add support for parameters to adjust Thread Stack Size. Like FreeRTOS/Zephyr, add support for following configurations. -d:nimThreadStackSize=xxxxx -d:nimThreadStackGuard=yyyy Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp> --------- Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
* add deprecated warnings for `{.deadcodeelim: on.}` (#21277)ringabout2023-02-161-1/+2
|
* fixes #21360; discarding empty seqs/arrays now raises errors (#21374)ringabout2023-02-161-8/+10
| | | | | * discarding empty seqs now raises errors * the same goes for sets
* allow omitting stmts using `finally` as post expr blocks; make it consistent ↵ringabout2023-02-141-1/+1
| | | | | with `else`, `except` etc. (#21361) allow omitting stmts using `finally` as post expr blocks
* fixes comments about type bound operations (#21365)ringabout2023-02-141-1/+1
|
* Change the default stdlib location for Linux packaging (#21328)Gabriel Huber2023-02-121-10/+12
| | | | | * Correctly evaluate the Nim prefix on Posix * Document new packaging layout
* fixes #21333; bad codegen for the at operator; [backport:1.6] (#21344)Andreas Rumpf2023-02-081-1/+1
|
* replaces `pairs` with `keys` and `items`; saves 8 bytes (#21319)ringabout2023-02-023-5/+5
| | | replace `pairs` with `keys` and `items`
* Add `contains` to `std/macrocache` (#21304)Jake Leahy2023-02-011-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add test cases * Implement contains for CacheSeq * Implement contains for CacheTable * Fix implementation of hasKey * Remove contains for CacheSeq Fix runnable examples I was accidently using --doccmd:skip so I didn't spot the failure locally * Implement hasKey as a VM callback instead of magic * Implement suggestions from PR Co-Authored-By: ringabout <ringabout@users.noreply.github.com> * Update lib/core/macrocache.nim --------- Co-authored-by: ringabout <ringabout@users.noreply.github.com> Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* fixes #19396; Nimdoc hide nonexported fields (#21305)ringabout2023-02-016-16/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * suppresses non-exported fields of types and adds command-line option to re-enable this if desired * corrected the doctest that produced a CI error * an embarrassingly bad error in reasoning * modified a nimdoc test to reflect updated behavior * needed another change to bring utils.html doctest in sync with update * add info * fix nimdoc * lint * render postfix * fixes a problem * fixes nimdoc * fix nimdoc --------- Co-authored-by: johnperry-math <john.perry@usm.edu> Co-authored-by: johnperry-math <devotus@yahoo.com>
* fixes #21317; 1.6.4 regression; etyBaseIndex should return fat pointers ↵ringabout2023-02-011-3/+4
| | | | | [backport 1.6] (#21320) fixes #21317; regression; etyBaseIndex should return fat pointers
* fixes #16790; fixes #19075; put big arrays on the constant seqs; don't ↵ringabout2023-01-311-2/+5
| | | | | | | inline them in the VM; big performance boost (#21318) * don't inline arrays in VM * add a test for #19075
* remove md5_old (#21312)ringabout2023-01-313-299/+2
|
* remove `enumUtilsExist` defines (#21309)ringabout2023-01-291-17/+4
|
* Revert "Fix #13093 C++ Atomics: operator= is implicitly deleted because the ↵ringabout2023-01-272-9/+1
| | | | | | | default definition would be ill-formed " (#21307) Revert "Fix #13093 C++ Atomics: operator= is implicitly deleted because the default definition would be ill-formed (#21169)" This reverts commit a7bae919adb952362cb53206140872d2b7424b47.
* Fix #13093 C++ Atomics: operator= is implicitly deleted because the default ↵Bung2023-01-272-1/+9
| | | | | | | | | | | | | definition would be ill-formed (#21169) * add test * fix #17982 Invalid C++ code generation when returning discardable var T * fix #13093 * cpp atomic good example * clearify the condition
* Implemented basic macro expand functionality (#20579)Ivan Yonchovski2023-01-279-9/+139
| | | | | | | | | | | | | | | | | | * 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