summary refs log tree commit diff stats
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* fixes #21592; create type bound operations for calls in the method ↵ringabout2023-04-013-6/+10
| | | | | | | dispatcher for ORC (#21594) * fixes #21592; create type operations for the method dispatcher * add a test case
* hopefully easier to understand error message (#21585)Andreas Rumpf2023-03-301-2/+2
|
* document general use of `_`, error message, fixes (#21584)metagn2023-03-302-16/+24
| | | | | | | | | | | | * document general use of `_`, error message, fixes fixes #20687, fixes #21435 Documentation and changelog updated to clarify new universal behavior of `_`. Also new error message for attempting to use `_`, new tests, and fixes with overloadable symbols and implicit generics. * add test for #21435
* remove `seq[T]` `setLen` undefined behavior (#21582)tersec2023-03-291-1/+1
| | | remove seq[T] setLen UB
* Fix segfault caused by ensuring valueless statics are not evaluated (#21577)Jason Beetham2023-03-291-1/+1
|
* tuple unpacking for vars as just sugar, allowing nesting (#21563)metagn2023-03-284-90/+123
| | | | | | | | | | | | | | | | | | | * tuple unpacking for vars as just sugar, allowing nesting * set temp symbol AST * hopeful fix some issues, add test for #19364 * always use temp for consts * document, fix small issue * fix manual indentation * actually fix manual * use helper proc * don't resem temp tuple assignment
* fixes #20993 [backport:1.6] (#21574)Andreas Rumpf2023-03-281-16/+33
| | | | | * fixes #20993 [backport:1.6] * proper line endings for the test file
* fixes #21505 (overload resolution of explicit constructors for imported C++ ↵heterodoxic2023-03-272-5/+24
| | | | | types) (#21511) hacky attempt to reconcile default explicit constructors with enforcement of brace initialization, instead of memsetting imported objects to 0
* fixes #14255; Crash in compiler when using `system.any` by accident. (#21562)ringabout2023-03-231-1/+1
| | | fixes #14255; Crash in compiler when using system.any by accident.
* fixes #3770; templates with untyped parameters resolve private fields ↵ringabout2023-03-216-11/+33
| | | | | | | | | wrongly in generics (#21554) * fixes #3770; templates with untyped parameters resolve private fields wrongly * add a test case for #3770 * rename to `nfSkipFieldChecking`
* mitigates #21272; but it's not the final fix because the first round … ↵Andreas Rumpf2023-03-201-2/+2
| | | | | (#21462) mitigates #21272; but it's not the final fix because the first round of overload resolution should already match
* Use `analyseIfAddressTaken` logic for checking if address is taken in ↵Jake Leahy2023-03-202-11/+16
| | | | | | | | | | | | | | | | | | | converter (#21533) * Add a test case There are way more test cases (See all branches of analyseIfAddressTaken but this covers at least a second branch * Port analyseIfAddressTaken from semexprs to sigmatch This was done since we cannot import sem or semexprs (circular import) but we need the rest of the logic. In needs to be done here since the converter isn't semmed afterwards and so we can't just leave the process til later use the version from semexprs * Less hacky solution which has the checking be done in analyseIfAddressTakenInCall This was done instead of the recommendation on removing it since sfAddrTaken is used in places other than the backend * Remove weird whitespace * Still check nkHiddenAddr if we are checking a converter
* Made generic type classes work with types using static parameters (#21528)Jason Beetham2023-03-171-4/+23
|
* add a prepass for codeReordering (#21513)ringabout2023-03-172-3/+33
| | | | | | | * add a prepass for codeReordering * simplify * fixes
* 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