summary refs log tree commit diff stats
path: root/doc/destructors.rst
Commit message (Collapse)AuthorAgeFilesLines
* Improve Markdown code blocks & start moving docs to Markdown style (#19954)Andrey Makarov2022-07-151-730/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - add additional parameters parsing (other implementations will just ignore them). E.g. if in RST we have: .. code:: nim :test: "nim c $1" ... then in Markdown that will be: ```nim test="nim c $1" ... ``` - implement Markdown interpretation of additional indentation which is less than 4 spaces (>=4 spaces is a code block but it's not implemented yet). RST interpretes it as quoted block, for Markdown it's just normal paragraphs. - add separate `md2html` and `md2tex` commands. This is to separate Markdown behavior in cases when it diverges w.r.t. RST significantly — most conspicously like in the case of additional indentation above, and also currently the contradicting inline rule of Markdown is also turned on only in `md2html` and `md2tex`. **Rationale:** mixing Markdown and RST arbitrarily is a way to nowhere, we need to provide a way to fix the particular behavior. Note that still all commands have **both** Markdown and RST features **enabled**. In this PR `*.nim` files can be processed only in Markdown mode, while `md2html` is for `*.md` files and `rst2html` for `*.rst` files. - rename `*.rst` files to `.*md` as our current default behavior is already Markdown-ish - convert code blocks in `docgen.rst` to Markdown style as an example. Other code blocks will be converted in the follow-up PRs - fix indentation inside Markdown code blocks — additional indentation is preserved there - allow more than 3 backticks open/close blocks (tildas \~ are still not allowed to avoid conflict with RST adornment headings) see also https://github.com/nim-lang/RFCs/issues/355 - better error messages - (other) fix a bug that admonitions cannot be used in sandbox mode; fix annoying warning on line 2711
* renamed 'gc' switch to 'mm'; [backport:1.6] (#19187)Andreas Rumpf2021-11-241-6/+6
| | | | * renamed 'gc' switch to 'mm'; [backport:1.6] * better docs
* Call {.cursor.} a pragma. (#19116)treeform2021-11-101-8/+8
| | | | | | | | | | * Call {.cursor.} a pragma. Its hard to find .curser annotation while googling because all other things like it are called pragmas. See https://nim-lang.org/docs/manual.html#pragmas Also the . in front of the name makes it hard to find and search for. Can we just call it cursor pragma? * Small fix for comment.
* update numbers of lifetime-tracking hooks in doc/destructors.rst (#19088)Derek 呆2021-11-021-1/+1
|
* fix a tiny code snippet formatting issue in `doc/constructors.rst`, again ↵Derek 呆2021-10-281-1/+1
| | | | (#19065)
* fix a tiny formating issue in doc/destructors.rst (#19058)Derek 呆2021-10-271-1/+1
|
* typos [backport] (#18929)Andreas Rumpf2021-09-301-10/+11
|
* doc improvements (#18843)Andreas Rumpf2021-09-131-41/+12
| | | | | * cleaned up destructors documentation [backport] * Spec updates [backport:1.0]
* Improve description of how =trace is used (#18491)GordonBGood2021-07-151-5/+22
| | | | | | | | | | | | | | | | | | | * [skip ci] thamming_orc test created/destroyed counts match The thamming_orc.nim code now counts all created objects being tested, not just the ones following the "first 20" test, and the position of the `destroyed += 1` counter has been adjusted so it counts all the calls that are as a result of `=trace` tracing and not just the original destruction calls. * Improve description of how `=trace` is used The following nuances weren't previously fully explained: 1. That `=trace` is only used by `--gc:orc`. 2. That `=trace` is almost certainly used along with `=destroy` when manual resource allocation has been used, but it is only required if there is a possibility of cyclic references in the wrapped types (ie. generic types). 3. That, currently, a forward definition is required for the second of the pair to avoid an auto compiler generation conflict. The pattern of the use of `=trace` has also been made more extensive, showing how both a custom `=destroy` and `=trace` are used for manual allocation of resources when there is any possibility of a cyclic reference in the resource-wrapped values. * Update doc/destructors.rst Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* ORC: support for custom =trace procs (#18459)Andreas Rumpf2021-07-091-0/+37
| | | | | | | | | | | * ORC: support custom =trace procs (WIP) * Update tests/arc/tcustomtrace.nim Co-authored-by: Clyybber <darkmine956@gmail.com> * =trace is now documented and seems to work * make test green Co-authored-by: Clyybber <darkmine956@gmail.com>
* follow-up #18013 - inline syntax highlighting (#18166)Andrey Makarov2021-06-041-1/+1
|
* follow-up #17837: add `Console` for interactive sessions (#17930)Andrey Makarov2021-05-061-7/+8
| | | | | * follow-up #17837: add `Console` for interactive sessions * fix Latex
* typos (#17824)Andreas Rumpf2021-04-231-5/+5
|
* RST backtick refactor (all *.rst except manual.rst and rst_examples.rst) ↵quantimnot2021-03-181-100/+97
| | | | | (#17258) Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* Make add work in the destructors example (#17354)Clyybber2021-03-151-1/+3
|
* Small fix to destructors exampleClyybber2021-03-121-1/+1
|
* rename prepareStrMutation to prepareMutation (#17235)flywind2021-03-031-4/+4
| | | | | | | * remove unnecessary when statement * remove outdated codes * rename prepareStrMutation to prepareMutation
* document copy on write behavior of string literals in arc/orc (#17224)flywind2021-03-021-0/+70
| | | | | | * Update doc/destructors.rst Co-authored-by: Juan Carlos <juancarlospaco@gmail.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* document type bound operators (#17063)Timothee Cour2021-02-231-2/+3
| | | | | | | * document type bound rountines * address comments * Update doc/manual.rst Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Reboot of #16195 (#16746)Clyybber2021-01-201-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | * fix #16185 * fix test * fix comment * fix comment * better approach * Add more tests and move sameLocation to injectdestructors * Better and more strict sameLocation * Small cleanup and preliminary spec clarification * Fix * Fix doc * Expand test Co-authored-by: Andrey R (cooldome) <ariabushenko@gmail.com>
* include example of error-marked copy proc (#15886)n5m2020-11-091-1/+7
| | | | | * include example of error-marked copy proc * Update destructors.rst
* micro improvements (#15849)Andreas Rumpf2020-11-051-1/+1
|
* Massive documentation fixes + copy editing (#15747)Yanis Zafirópulos2020-10-291-12/+12
|
* renamed '=' to '=copy' [backport:1.2] (#15585)Andreas Rumpf2020-10-151-11/+11
| | | | | | | | | * Assign hook name changed to `=copy` * Adapt destructors.rst * [nobackport] Duplicate tests for =copy hook * Fix tests * added a changelog entry Co-authored-by: Clyybber <darkmine956@gmail.com>
* disable sink inference, only enable it for the stdlib. Reason: better source ↵Andreas Rumpf2020-07-281-4/+8
| | | | code compatibility (#15105)
* cleanup ARC documentation (#15100)Andreas Rumpf2020-07-281-42/+0
|
* An optimizer for ARC (#14962)Andreas Rumpf2020-07-151-1/+27
| | | | | | | | | | | | | | | | | | | | * WIP: an optimizer for ARC * do not optimize away destructors in 'finally' if unstructured control flow is involved * optimized the optimizer * minor code cleanup * first steps to .cursor inference * cursor inference: big steps to a working solution * baby steps * better .cursor inference * new feature: expandArc for easy inspection of the AST after ARC transformations * added topt_cursor test * adapt tests * cleanups, make tests green * optimize common traversal patterns * moved test case * fixes .cursor inference so that npeg compiles once again * cursor inference: more bugfixes Co-authored-by: Clyybber <darkmine956@gmail.com>
* Update docs and changelogClyybber2020-07-101-3/+4
|
* scoped memory management (#14790)Andreas Rumpf2020-07-041-2/+2
| | | | | | | * fixes the regressions * closes #13936 * scope based memory management implemented * enabled tcontrolflow.nim test case * final cleanups
* Fix some typos (#14843)Danil Yarantsev2020-06-281-1/+1
|
* fixes #13881Andreas Rumpf2020-05-121-3/+44
| | | | | | * fixes #13881 * documented changed requirements for system.onThreadDestruction * destructors.rst: update the documentation
* changed type() to typeof() in docs and error messages (#14084)hlaaftana2020-04-241-2/+2
|
* arc optimizations (#13325)Andreas Rumpf2020-03-181-0/+1
| | | | | * scope based destructors * handle 'or' and 'and' expressions properly, see the new test arc/tcontrolflow.nim * make this branch mergable, logic is disabled for now
* sink parameter inference for types that have destructors (#13544)Andreas Rumpf2020-03-041-0/+17
| | | | | | | | | | | | | | * ensure capitalize doesn't take an inferred sink parameter * sink parameter inference: first version, for now disabled. Changed that sink parameters can be consumed multiple times in order to adhere to our spec. * sink inference can now be disabled with .nosinks; sometimes for proc type interop this is required * fixes yet another critical DFA bug * better implementation that also understands if expressions etc * document sink parameter inference and allow for global disabling
* make sink operator optional (#13068)cooldome2020-01-171-2/+6
| | | | | | | | | | | | | | | | * make sink operator optional * bug fix, add changelog entry * Trigger build * fix one regression * fix test * Trigger build * fix typos
* Fix typo in doc/destructors.rst (#13148)Tomohiro2020-01-141-1/+1
|
* destructors.rst: added a missing 'var' to the motivating exampleAraq2019-10-281-1/+1
|
* destructors: spec reflects reality, =sink is here to stayAndreas Rumpf2019-08-111-131/+135
|
* destructors spec: be more precise about temporariesAndreas Rumpf2019-07-271-1/+3
|
* added destructors.rst documentAndreas Rumpf2019-07-011-0/+563