Commit Graph

2017 Commits

Author SHA1 Message Date
metagn
2ab948ce53 post expr blocks colon fix + correct grammar (#21983)
* post expr blocks colon fix + correct grammar

fixes #21982

* fix dochelpers

* this is remarkably common

* use head for unchained

* fix atlas

* final grammar fix
2023-06-06 06:53:21 +02:00
ringabout
8cc49f221e update the documentation of the dup hook (#21984)
* update the documentation of the dup hook

* document `=dup`

* typo

* minor improvement

* typo

* Update doc/destructors.md

* Update doc/destructors.md

* Update doc/destructors.md

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2023-06-03 07:09:05 +02:00
Andreas Rumpf
a9385a6b4a Atlas: virtual environments (#21965)
* Atlas: virtual environments

* fixes
2023-05-30 18:02:55 +02:00
Andreas Rumpf
4d20227438 Atlas: URL rewrite rules; --autoinit flag (#21963) 2023-05-30 14:00:09 +02:00
Andreas Rumpf
7ebb042f79 Atlas: some final cleanups (#21947) 2023-05-28 18:18:30 +02:00
ringabout
c2abcb06cc ship atlas and build documentation (#21945)
* ship atlas and build documentation

* move atlas.md and link it in tools' index
2023-05-28 08:28:49 +02:00
heterodoxic
609bf3d7c8 fix #21501 by making --app:lib and --app:staticLib imply --noMain (#21910) 2023-05-26 03:20:56 +02:00
Juan M Gómez
ee3650b29e documents changes on byref and bycopy (#21882) 2023-05-22 17:39:54 +02:00
Juan M Gómez
fcf2dcf099 Moves virtual under its own section manual_experimental.md (#21870) 2023-05-20 23:52:21 +02:00
Juan M Gómez
21ff10b882 documents virtual (#21860)
* documents virtual

* Apply suggestions from code review

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2023-05-19 21:23:29 +02:00
Andreas Rumpf
f4a9b258c3 isolation spec update; WIP (#21843)
* isolation spec update; WIP

* wip

* docs update, WIP

* progress

* Update doc/manual.md
2023-05-14 16:58:28 +02:00
ringabout
3b9999b93c adds documentation for =wasMoved and =dup hooks and small fixes (#21827)
* adds documentation for `=wasMoved` and `=dup` hooks and small fixes

* Update doc/destructors.md

* Update doc/destructors.md

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2023-05-11 19:38:27 +08:00
Juan Carlos
3a08e2e6ac Remove LineTooLong (#21819)
* LineTooLong refactor to make it actually useful
* Improve error message
* changelog wording
* Fix typo
2023-05-11 10:10:51 +02:00
ringabout
71439c2891 fixes links of generic define pragma (#21828) 2023-05-11 15:00:30 +08:00
Juan M Gómez
e45eb39ef7 documents codegendecl for object types (#21811) 2023-05-08 17:04:27 +02:00
Tomohiro
10328e50a5 Document about size pragma (#21794)
* Document about size pragma

* Fix typos

* Fix manual.md

* Update doc/manual.md

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2023-05-06 12:03:45 +02:00
Daniel Belmes
85dbfc68b5 Update the Nim Manual compile pragma with the second tuple form (#21773)
* Update the nim manual compile pragma with the second tuple form of

* Incorrectly put 'two' forms
2023-05-05 14:27:33 +02:00
ringabout
1d80dc7df6 closes #21771; fixes the link (#21777)
closes #21771
2023-05-03 18:54:40 +08:00
Andreas Rumpf
220b450489 fixes #21245; warn about destructors that can raise (#21726)
* fixes #21245; warn about destructors that can raise

* doc update

* progress

* typo
2023-04-26 22:32:10 +02:00
Juan M Gómez
897dff69dd documents #21628 (#21723)
* documents #21628

* Update doc/manual.md

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2023-04-24 18:09:07 +02:00
metagn
63d29ddd69 alias syntax fixes, improvements and tests (#21671)
* alias syntax fixes, improvements and tests

* even better, cannot use alias syntax with generics

* more type tests, improve comment

* fix again

* consistent error message + make t5167_5 work

* more comments, remove {.noalias.}
2023-04-22 09:11:56 +02:00
Raynei
48de0d0cf4 Documented path substitution by compiler (#21662)
Document compiler path substitution (nim-lang#19928)
2023-04-21 15:37:21 +02:00
metagn
b0a98cc01e warn on set types bigger than max size, default to 0..255 for int literals (#21659)
* test implicitly huge set types

refs https://github.com/nim-lang/RFCs/issues/298

* oh my god

* boot at least

* don't error, fix remaining issues, no 2 len arrays

* fix runnable example

* test assuming 0..255 for int literal

* test refactor, add changelog, test
2023-04-17 20:55:22 +02:00
Andrey Makarov
a0da74ed4c Update nim 2.0 documentation for docgen & nimgrep (#21665)
* Update nim 2.0 documentation for docgen & nimgrep

* [skip ci] Update changelogs/changelog_2_0_0.md

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>

* [skip ci] expand section on Markdown migration and `doctype`

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2023-04-17 10:57:51 +02:00
metagn
2a0d8a9a06 make grammar a bit more honest (#21655)
* test if expr parsing expr

refs #19802

* in any case

* just be honest

* fix symbol/keyword issue too
2023-04-14 12:34:49 +02:00
metagn
f05387045d int64/uint64 as bigint in JS (#21613)
* int64/uint64 as bigint in JS

* fix CI

* convert to compile option

* fix lie

* smaller diff, changelog entry
2023-04-11 21:20:20 +02:00
metagn
1bb117cd7a proc typeclass accounts for iterator, call conventions + nil fix + document typeclass AST (#21629)
* test fix #16546 #16548 + another issue

* please don't tell me other packages do this

* fix CI + test typeclass callconv pragma

* better logic in parser

* docs and changelog
2023-04-11 09:23:41 +02:00
metagn
16bc546aea remove useVersion (#21626)
test removing useVersion
2023-04-08 11:42:17 +02:00
metagn
4898b054ce warn against a, b = val in routine arguments (#21604)
closes https://github.com/nim-lang/RFCs/issues/480
2023-04-06 13:21:48 +02:00
Yardanico
b865f6a5f0 Remove the "This module" suffix and reword some entries from the stdlib overview (#21580)
Remove a lot of "This module x" and reword some entries
2023-03-30 15:35:17 +02:00
metagn
ecf9efa397 document general use of _, error message, fixes (#21584)
* 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
2023-03-30 15:34:42 +02:00
metagn
2315b01ae6 tuple unpacking for vars as just sugar, allowing nesting (#21563)
* 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
2023-03-28 17:52:23 +02:00
Zoom
4fc9f0c3a3 Docs: Mention Source Code Filters in lib/String handling (#21570)
Mention Source Code Filters in `String handling`

...as a viable solution for templating
2023-03-28 13:37:49 +02:00
ringabout
274d61865f closes #21536; fixes manual (#21552)
fixes manual
2023-03-20 22:42:57 +01:00
Hiroki Noda
c43ac90390 Add NuttX for thread stack size doc (#21529) 2023-03-16 18:03:43 +08:00
ringabout
af086b68f2 fixes sinkinference documentation, which has been disabled (#21470)
since https://github.com/nim-lang/Nim/pull/15105
2023-03-12 13:01:12 +08:00
Arnaud Moura
b2c5f8a05f fixes #21461 (#21463)
* fixes #21461; Move nim-gdb.py and add nim-lldb.py

* fixes bad path for nim-gdb.py
2023-03-03 23:37:12 +01:00
ringabout
d51a392149 replaces implicit passes array registed at runtime with explicit function 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
2023-03-03 07:36:38 +01:00
ringabout
a137e50150 fixes #19291; implements wasMoved hook (#21303)
* 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
2023-03-02 05:29:40 +01:00
Francis Thérien
7dc80a7fef Mitigate issues related to compiler options when cross-compiling (#21330)
* Document C compiler options config when cross-compiling

* Allow empty string to override default
2023-02-22 21:10:02 +01:00
Benji York
64a788cafb Fix a couple of small keyword issues. (#21416)
In this section of the manual, "if" should be enclosed in backticks and "elif" should be lower case.
2023-02-22 12:12:10 +01:00
Gabriel Huber
6c15958a83 Change the default stdlib location for Linux packaging (#21328)
* Correctly evaluate the Nim prefix on Posix

* Document new packaging layout
2023-02-12 16:41:27 +01:00
Ikko Eltociear Ashimine
9f651f05d5 nimgrep: fix typo (#21337)
occurences -> occurrences
2023-02-07 16:15:44 +08:00
ringabout
ff8ab06720 fixes #19396; Nimdoc hide nonexported fields (#21305)
* 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>
2023-02-01 08:13:40 +01:00
Heechul Ryu
23bd812b0c Update nims.md to use nim e instead of nim in advanced shebang (#21301)
Update nims.md

- suggest a better shebang that works with any filename
- related to https://github.com/nim-lang/Nim/issues/17190
2023-01-26 12:43:55 +01:00
ringabout
36e489e69b add md2html, md2tex to cmd helpers (#21295) 2023-01-24 13:33:13 +01:00
Anna
e4e947232b testament: make valgrind optional (#21238)
Add a simple switch to enable/disable valgrind support. On by default
2023-01-11 12:23:43 -05:00
Andrey Makarov
2620da9bf9 docgen: implement cross-document links (#20990)
* docgen: implement cross-document links

Fully implements https://github.com/nim-lang/RFCs/issues/125
Follow-up of: https://github.com/nim-lang/Nim/pull/18642 (for internal links)
and https://github.com/nim-lang/Nim/issues/20127.

Overview
--------

Explicit import-like directive is required, called `.. importdoc::`.
(the syntax is % RST, Markdown will use it for a while).

Then one can reference any symbols/headings/anchors, as if they
were in the local file (but they will be prefixed with a module name
or markup document in link text).
It's possible to reference anything from anywhere (any direction
in `.nim`/`.md`/`.rst` files).

See `doc/docgen.md` for full description.

Working is based on `.idx` files, hence one needs to generate
all `.idx` beforehand. A dedicated option `--index:only` is introduced
(and a separate stage for `--index:only` is added to `kochdocs.nim`).

Performance note
----------------

Full run for `./koch docs` now takes 185% of the time before this PR.
(After: 315 s, before: 170 s on my PC).
All the time seems to be spent on `--index:only` run, which takes
almost as much (85%) of normal doc run -- it seems that most time
is spent on file parsing, turning off HTML generation phase has not
helped much.
(One could avoid it by specifying list of files that can be referenced
and pre-processing only them. But it can become error-prone and I assume
that these linke will be **everywhere** in the repository anyway,
especially considering https://github.com/nim-lang/RFCs/issues/478.
So every `.nim`/`.md` file is processed for `.idx` first).

But that's all without significant part of repository converted to
cross-module auto links. To estimate impact I checked the time for
`doc`ing a few files (after all indexes have been generated), and
everywhere difference was **negligible**.
E.g. for `lib/std/private/osfiles.nim` that `importdoc`s large
`os.idx` and hence should have been a case with relatively large
performance impact, but:

* After: 0.59 s.
* Before: 0.59 s.

So Nim compiler works so slow that doc part basically does not matter :-)

Testing
-------

1) added `extlinks` test to `nimdoc/`
2) checked that `theindex.html` is still correct
2) fixed broken auto-links for modules that were derived from `os.nim`
   by adding appropriate ``importdoc``

Implementation note
-------------------

Parsing and formating of `.idx` entries is moved into a dedicated
`rstidx.nim` module from `rstgen.nim`.

`.idx` file format changed:

* fields are not escaped in most cases because we need original
  strings for referencing, not HTML ones
  (the exception is linkTitle for titles and headings).
  Escaping happens later -- on the stage of `rstgen` buildIndex, etc.
* all lines have fixed number of columns 6
* added discriminator tag as a first column,
  it always allows distinguish Nim/markup entries, titles/headings, etc.
  `rstgen` does not rely any more (in most cases) on ad-hoc logic
  to determine what type each entry is.
* there is now always a title entry added at the first line.
* add a line number as 6th column
* linkTitle (4th) column has a different format: before it was like
  `module: funcName()`, now it's `proc funcName()`.
  (This format is also propagated to `theindex.html` and search results,
  I kept it that way since I like it more though it's discussible.)
  This column is what used for Nim symbols resolution.
* also changed details on column format for headings and titles:
  "keyword" is original, "linkTitle" is HTML one

* fix paths on Windows + more clear code

* Update compiler/docgen.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>

* Handle .md and .nim paths uniformly in findRefFile

* handle titles better + more comments

* don't allow markup overwrite index title for .nim files

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2023-01-04 15:19:01 -05:00
Bung
b2328b44ba make it printer friendly (#21218) 2023-01-04 15:10:44 -05:00
ringabout
91ce8c385d fix #19580; add warning for bare except: clause (#21099)
* fix #19580; add warning for bare except: clause

* fixes some easy ones

* Update doc/manual.md

* fixes docs

* Update changelog.md

* addition

* Apply suggestions from code review

Co-authored-by: Jacek Sieka <arnetheduck@gmail.com>

* Update doc/tut2.md

Co-authored-by: Jacek Sieka <arnetheduck@gmail.com>
2022-12-15 06:45:36 +01:00