1993 Commits

Author SHA1 Message Date
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
metagn
9a50033d5b generic define pragma + string alias (#20979)
* generic `define` pragma + string alias

* clean

* add tests and document

* remove char/float, minimize changelog
2022-12-13 21:20:55 +01:00
Andreas Rumpf
3812d91390 alternative, much simpler algorithm for strict func checking (#21066)
* 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
2022-12-11 16:58:50 +01:00
ringabout
7a18c1ef44 clean up the documentation of threads (#21067)
* clean up the documentation of threads

* cleanup
2022-12-10 23:23:31 +08:00
Vindaar
0a1d4ba842 fix issue #20922 by handling missing expr in exprList for tkOf (#20930)
* fix issue #20922 by handling missing expr in `exprList` for `tkOf`

* fix line numbers in test case

* rewrite exprList requiring expr, add optionalExprList for except

As suggested by @metagn.

* update test case to reflect new code

* update grammar.txt

* update line numbers in test case taking into account nimout

Given the number of errors that are produced it seems easier to do it
this way instead of using `tt.Error`.
2022-12-08 10:59:13 +01:00
Xavier Noria
e669835665 Mention toSet in the docs of the set type (#21037) 2022-12-08 10:58:00 +01:00
ringabout
4480fd3e93 fixes #16656; add nre to lib.md (#21042) 2022-12-08 08:51:31 +01:00
ringabout
4da3ead294 fixes strictnotnil documentation; comment unfinished sections (#21041)
fixes documentation; comment unfinished sections
2022-12-08 10:06:48 +08:00
ringabout
9ba07edb2e build the documentation of official packages (#20986)
* remove db stuffs

* remove punycode

* remove

* fixes script

* add cloner

* patches

* disable

* patch

* fixes external packages

* disable two packages

* preview documentation build

* try again

* fixes URL

* fixes a bug

* simplify

* fixes documentaion

* fixes

* Apply suggestions from code review
2022-12-06 22:37:16 +08:00
metagn
4ca2dcb404 Named arguments in commands + many grammar fixes (#20994)
* Breaking parser changes, implement https://github.com/nim-lang/RFCs/issues/442

Types are separated from expressions and better reflected in the grammar.

* add test

* more accurate grammar

* fix keyword typedescs

* accept expressions in proc argument lists

* CI "fixes"

* fixes

* allow full ref expressions again, adapt old tests

* cleanup, fix some tests

* improve grammar, try and revert semtypes change

* restrict sigil binding to identOrLiteral

* fix, should have caught this immediately

* add changelog entry, fix double not nil bug

* correct grammar

* change section

* fix

* real fix hopefully

* fix test

* support LL(1) for tuples

* make grammar.txt too
2022-12-06 13:11:56 +01:00
ringabout
b2c7019006 definite assignment analysis for let (#21024)
* 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
2022-12-06 10:19:12 +01:00
metagn
739e1badb6 stdlib organization & documentation improvements (#20971)
* stdlib organization & documentation improvements

* fix CI

* Update doc/lib.md

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>

* fix ci, remove jshttpcore, export in jsfetch instead

* fix alphabetical order violations

* add cmdline, db_odbc

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
2022-12-06 09:37:03 +01:00
Dmitry Arkhipenko
794bcc8029 Add: missing nintendo-switch define (#21009) 2022-12-05 07:24:24 +01:00
metagn
2449c37137 better procvar ambiguity errors, clean up after #20457 (#20932)
* better procvar ambiguity errors, clean up after #20457

fixes #6359, fixes #13849

* only trigger on closedsymchoice again

* new approach

* add manual entry for ambiguous enums too

* add indent [skip ci]

* move to proc
2022-12-01 08:01:13 +01:00
ringabout
17ac8c31bf move smtp to nimble packages (#20953)
* move `smtp` to nimble packages

* fixes

* install smtp

* yes
2022-11-30 21:52:36 +01:00
ringabout
77a337a39a fixes documentation regression (#20960)
follow up https://github.com/nim-lang/Nim/pull/20371
2022-11-29 14:49:40 +08:00
ringabout
dc21ae9ea5 Correct descriptions for oids (#20926) 2022-11-26 11:29:45 -05:00
ringabout
4a3be7e29e add documentation and changelog for default object fields (#20845) 2022-11-15 08:42:01 +01:00
Andrey Makarov
3eef0491a8 fix a few "broken link" warnings (#20837) 2022-11-14 15:43:29 +08:00
ringabout
25cb19a8fe fixes documentation regression and a bit clean up (#20793)
* fixes documentation regression and a bit clean up

follow up https://github.com/nim-lang/Nim/pull/20371

* Apply suggestions from code review

* Apply suggestions from code review
2022-11-09 16:50:14 +01:00
Lee Matos
4b24d85907 Update testament docs demo, command output, and gotchas (#20756) 2022-11-05 11:10:19 +01:00
ringabout
0a1f204f0f removes channels_builtin when enabling nimPreviewSlimSystem (#20713) 2022-10-31 16:56:05 +08:00
Pietro Peterlongo
9c3faa449b add back discard as a way to do multiline comments, see #12352 (#20688) 2022-10-28 16:24:51 -04:00
Andreas Rumpf
76763f51aa implemented strictCaseObjects (#20608)
* implemented strictCaseObjects

* changelog update
2022-10-21 06:55:52 +02:00
ringabout
c0824b9b80 [std/os clean up] import and export osseps (#20580)
import and export osseps
2022-10-17 20:29:00 +02:00