| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
fixes nightlies build
|
|
|
|
|
|
|
|
|
| |
* Update manual.md
add explanation for $#.
* Update manual.md
add explanation.
|
|
|
|
|
| |
Revert "clarify that `char` may not be unsigned (#20308)"
This reverts commit f433d9cccf1a05da1a24e9fed9b914b7a2a35945.
|
|
|
| |
fixes #20303; wasMoved expressions with side effects
|
| |
|
|
|
|
|
|
|
|
|
| |
(#20312)
* error/deprecate when using `newPar` to construct tuple expressions
* Update lib/core/macros.nim
* fixes
|
|
|
| |
use case stmt
|
|
|
|
|
|
|
| |
* test using arrow precedence in spec
refs #8759
* add test for #8759
|
| |
|
|
|
| |
depends on #20126
|
|
|
|
|
|
|
|
|
|
|
| |
[backport]
prevent use-after-free bugs in cased objects
the bug happens specifically when deleting
an item in a seq. The item taking it's place
might not have the same case fields. Then =sink(x[i], move x[xl])
might leave the deleted fields still in memory!
If the new item switches branches again, you get a use-after-free bug.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement Pandoc Markdown concise link extension
This implements https://github.com/nim-lang/Nim/issues/20127.
Besides reference to headings we also support doing references
to Nim symbols inside Nim modules.
Markdown:
```
Some heading
------------
Ref. [Some heading].
```
Nim:
```
proc someFunction*() ...
... ## Ref. [someFunction]
```
This is substitution for RST syntax like `` `target`_ ``.
All 3 syntax variants of extension from Pandoc Markdown are supported:
`[target]`, `[target][]`, `[description][target]`.
This PR also fixes clashes in existing files, particularly
conflicts with RST footnote feature, which does not work with
this PR (but there is a plan to adopt a popular [Markdown footnote
extension](https://pandoc.org/MANUAL.html#footnotes) to make footnotes work).
Also the PR fixes a bug that Markdown links did not work when `[...]`
section had a line break.
The implementation is straightforward since link resolution did not
change w.r.t. RST implementation, it's almost only about new syntax
addition. The only essential difference is a possibility to add a custom
link description: form `[description][target]` which does not have an
RST equivalent.
* fix nim 1.0 gotcha
|
|
|
|
|
|
|
| |
* Cleanup dochack
* xxx
* More cleanups
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add improved Windows UNC path support in std/os
Original issue: `std/os.createDir` tries to create every component of
the given path as a directory. The problem is that `createDir`
interprets every backslash/slash as a path separator. For a UNC path
this is incorrect. E.g. one UNC form is `\\Server\Volume\Path`. It's an
error to create the `\\Server` directory, as well as creating
`\\Server\Volume`.
Add `ntpath.nim` module with `splitDrive` proc. This implements UNC path
parsing as implemented in the Python `ntpath.py` module. The following
UNC forms are supported:
* `\\Server\Volume\Path`
* `\\?\Volume\Path`
* `\\?\UNC\Server\Volume\Path`
Improves support for UNC paths in various procs in `std/os`:
---
* pathnorm.addNormalizePath
* Issue: This had incomplete support for UNC paths
* The UNC prefix (first 2 characters of a UNC path) was assumed to
be exactly `\\`, but it can be `//` and `\/`, etc. as well
* Also, the UNC prefix must be normalized to the `dirSep` argument
of `addNormalizePath`
* Resolution: Changed to account for different UNC prefixes, and
normalizing the prefixes according to `dirSep`
* Affected procs that get tests: `relativePath`, `joinPath`
* Issue: The server/volume part of UNC paths can be stripped when
normalizing `..` path components
* This error should be negligable, so ignoring this
* splitPath
* Now make sure the UNC drive is not split; return the UNC drive as
`head` if the UNC drive is the only component of the path
* Consequently fixes `extractFilename`, `lastPathPart`
* parentDir / `/../`
* Strip away drive before working on the path, prepending the drive
after all work is done - prevents stripping UNC components
* Return empty string if drive component is the only component; this
is the behavior for POSIX paths as well
* Alternative implementation: Just call something like
`pathnorm.normalizePath(path & "/..")` for the whole proc - maybe
too big of a change
* tailDir
* If drive is present in path, just split that from path and return
path
* parentDirs iterator
* Uses `parentDir` for going backwards
* When going forwards, first `splitDrive`, yield the drive field, and
then iterate over path field as normal
* splitFile
* Make sure path parsing stops at end of drive component
* createDir
* Fixed by skipping drive part before creating directories
* Alternative implementation: use `parentDirs` iterator instead of
iterating over characters
* Consequence is that it will try to create the root directory
* isRootDir
* Changed to treat UNC drive alone as root (e.g. "//?/c:" is root)
* This change prevents the empty string being yielded by the
`parentDirs` iterator with `fromRoot = false`
* Internal `sameRoot`
* The "root" refers to the drive, so `splitDrive` can be used here
This adds UNC path support to all procs that could use it in std/os. I
don't think any more work has to be done to support UNC paths. For the
future, I believe the path handling code can be refactored due to
duplicate code. There are multiple ways of manipulating paths, such as
manually searching string for path separator and also having a path
normalizer (pathnorm.nim). If all path manipulation used `pathnorm.nim`,
and path component splitting used `parentDirs` iterator, then a lot of
code could be removed.
Tests
---
Added test file for `pathnorm.nim` and `ntpath.nim`.
`pathnorm.normalizePath` has no tests, so I'm adding a few unit tests.
`ntpath.nim` contains tests copied from Python's test suite.
Added integration tests to `tos.nim` that tests UNC paths.
Removed incorrect `relativePath` runnableExamples from being tested on Windows:
---
`relativePath("/Users///me/bar//z.nim", "//Users/", '/') == "me/bar/z.nim"`
This is incorrect on Windows because the `/` and `//` are not the same
root. `/` (or `\`) is expanded to the drive in the current working
directory (e.g. `C:\`). `//` (or `\\`), however, are the first two
characters of a UNC path. The following holds true for normal Windows
installations:
* `dirExists("/Users") != dirExists("//Users")`
* `dirExists("\\Users") != dirExists("\\\\Users")`
Fixes #19103
Questions:
---
* Should the `splitDrive` proc be in `os.nim` instead with copyright
notice above the proc?
* Is it fine to put most of the new tests into the `runnableExamples`
section of the procs in std/os?
* [skipci] Apply suggestions from code review
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* [skip ci] Update lib/pure/os.nim
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* Move runnableExamples tests in os.nim to tos.nim
* tests/topt_no_cursor: Change from using splitFile to splitDrive
`splitFile` can no longer be used in the test, because it generates
different ARC code on Windows and Linux. This replaces `splitFile` with
`splitDrive`, because it generates same ARC code on Windows and Linux,
and returns a tuple. I assume the test wants a proc that returns a
tuple.
* Drop copyright attribute to Python
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
|
|
|
| |
mirror behavior without overloadableEnums
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* remove deprecated pragma syntax from 0.20.0
closes #4651, closes #16653 with a cheap fix for now due to
how early `tfFinal` is set
* remove type pragma between name and generics
* undo removal, try removing bind expression (0.8.14)
* fix test, unremove bind expr
* remove again
* Update changelog.md
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* dependencies @ HEAD & weave test dependencies
* try fix package ci
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
|
|
|
| |
add nimsuggest.nimble back
|
|
|
| |
This reverts commit 04e4a5ec0e35fc7e1c346c2d002e8487b4b48cb5.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#19754)
* Fix 16937: Make --clib option works
* Make tests/compiler/tcmdlineclib.nim works from any current dir
* Try to fix link error on macosx
* Add a comment to tests/compiler/tcmdlineclib.nims
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* implement case for cstring
for now just converts to string on C backend
* custom implementation for cstring
* remove leftover
* revert even more
* add nil + fix packages weird variant literal bug
* update docs
|
|
|
| |
remove the olf nimv019 define in the config
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* [Testament] Extend and document message testing aids
* Enable inline msgs when not reject action.
Eliminates the pain of changing the line and column numbers in `nimout`
or `output` while making changes to the test.
* Enable using inline msgs and nimout together.
Allows ease of inline msgs for the test as well as testing msgs from
other modules.
* Add path separator and test filename variable interpolation in
msgs.
Eases handling path separators in the msgs.
* Add some documentation.
* Fixed lots of broken tests
* Fixed more broken tests
* Support multiple inline messages per a line
* Fix a broken test
* Revert variable substitution in `output`
* Remove uneeded params
* Update doc/testament.md
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* Update testament/specs.nim
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* Update testament/specs.nim
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* Fix indentation
Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
- needs #20168 to make the stuff working
I went for this minimal solution because it seems like `compiler.nimble` and
`nimsuggest.nimble` are not in use
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
|
| |
|
|
|
|
| |
* fixes the regressions caused by the fix for #20107 [backport]
|
|
|
|
|
|
|
| |
- apparently TLineInfo's implementation of `==` ignores the column. After I fixed
the code to use exact TLineInfo comparison I fixed several other issues hidden
by that issue.
- Replaced `tuple[sym, info]` with `SymInfoPair`
|
|
|
|
|
| |
* fix #19600 No error checking on fclose
* add IOError to open
|
|
|
| |
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
|
|
|
|
|
|
|
| |
add cert dir for ssl ctx
Co-authored-by: Paul Roberts <pmr@stelo.org.uk>
Co-authored-by: sandytypical <43030857+xflywind@users.noreply.github.com>
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
|
|
|
|
|
| |
* fix `nim md2tex` and `koch pdf` commands
* change rst2tex -> md2tex also
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* minor updates on manual
1. statement -> keyword:
1. re-phase on the explanation of `import except`: maybe the newer version does not export some of the identifiers;
1. "The original module name is then not accessible" is moved up to the previous paragraph, since it is coupled with
the previous paragraph, but not the current one.
1. re-phase on the explanation of _Disabling certain messages_.
* Apply suggestions from code review
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* Update manual.md
do not use "()".
* Update doc/manual.md
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix links to subheader when TOC is present
It was observed (in https://github.com/nim-lang/Nim/pull/20112)
that links to 2nd- (and subsequent) -level headings
fail if TOC is present, e.g.:
```nim
.. contents::
Type relations
==============
Convertible relation
--------------------
Ref. `Convertible relation`_
```
The problem here is that links are resolved in `rst.nim` but later
`rstgen.nim` fixes ("fixes") anchors to make them unique so that
TOC always works (if e.g. there was another sub-section like
"Convertible relation").
The solution implemented in this PR is to move that fix-up of anchors
into `rst.nim`, so that link resolution could know final anchors.
The bug seems to be added in https://github.com/nim-lang/Nim/pull/2332
in 2015, that is it is present in Nim 1.0.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Add missing rand(var Rand, Ordinal) overload
* Corrected mistake, thanks @metagn
Co-authored-by: metagn <metagngn@gmail.com>
* Update random.nim
Co-authored-by: metagn <metagngn@gmail.com>
|
|
|
| |
remove `var` from ref parameters; make it consistent
|
| |
|
|
|
| |
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
| |
refs #12975. doesn't close it because wProcvar isn't removed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* move formatfloat out of system
* fixes doc
* Update changelog.md
* careless
* fixes
* deprecate system/formatfloat
* better handling
|
|
|
|
|
|
|
| |
(#20194)
* register echoBinSafe
* add output
|
|
|
| |
fixes #20227; skip distinct types for genObjConstr
|
|
|
|
|
|
|
|
|
|
|
| |
* test removing dollar for objects out of system
* test & fixes
* fix bootstrap
* use nimPreviewSlimSystem, test stdlib category
* fix test
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* micro implementation of rfc 149
refs https://github.com/nim-lang/RFCs/issues/149
* number/array/seq literals, more statements
* try fix number literal alias issue
* renew expectedType with if/case/try branch types
* fix (nerf) index type handling and float typed int
* use typeAllowed
* tweaks + const test (tested locally) [skip ci]
* fill out more of the checklist
* more literals, change @ order, type conversions
Not copying the full call tree before the typedesc call check
in `semIndirectOp` is also a small performance improvement.
* disable self-conversion warning
* revert type conversions (maybe separate op later)
* deal with CI for now (seems unrelated), try enums
* workaround CI different way
* proper fix
* again
* see sizes
* lol
* overload selection, simplify int literal -> float
* range, new @ solution, try use fitNode for nil
* use new magic
* try fix ranges, new magic, deal with #20193
* add documentation, support templates
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Minor refactor
* Add OpenSSL 3 support
Remove symbols noOpenSSLHacksq and openssl10
* Drop loading of older openssl versions
* Add library path
* Use only versioned libssl soname os OSX
* Update .github/workflows/ci_packages.yml
Co-authored-by: Hein Thant <official.heinthanth@gmail.com>
* On Mac OS X CI, link OpenSSL in /usr/local/lib/
* Install OpenSSL on Mac OS X on azure pipeline
* Remove DYLD_LIBRARY_PATH
Co-authored-by: Hein Thant <official.heinthanth@gmail.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Hein Thant <official.heinthanth@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* test CI for template redefinitions
* adapt asyncmacro
* fix quote
* fix again
* try something else
* revert
* fix ioselectors_select, disable packages CI
* adapt more tests & simplify
* more
* more
* more
* rename to redefine, warn on implicit redefinition
* basic documentation [skip ci]
* Update compiler/lineinfos.nim
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add `doctype: RST|Markdown|RstMarkdown` pragma
Implements https://github.com/nim-lang/RFCs/issues/68 ,
see also discussion in https://github.com/nim-lang/Nim/issues/17987
The permitted values:
* `markdown`, which is default. It still contains nearly all of
the RST supported but it is assumed that in time we will give up
most or all RST features in this mode
* `rst`, without any extensions
* `RstMarkdown` — compatibility with Nim 1.x. It's basically RST
with those Markdown features enabled that don't conflict with RST.
* Apply suggestions from code review
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* Additional fix in spirit of review
* Fix test after #20188
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* remove pre-1.0 stdlib deprecations
notable exceptions:
* ze, toU8 etc in system/arithmetics
* potentially callsite
* undo macros, ospaths, securehash, oswalkdir
* add sets back
* add back future, document deprecated versions
* add to changelog [skip ci]
|