| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
fixes #22932
follow up https://github.com/nim-lang/Nim/pull/21629
---------
Co-authored-by: Nickolay Bukreyev <SirNickolas@users.noreply.github.com>
|
|
|
|
| |
follow up https://github.com/nim-lang/Nim/pull/22851
follow up https://github.com/nim-lang/Nim/pull/22873
|
|
|
|
|
|
|
| |
(#22837)
… enabled
fixes #22836
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* CIs: attempt to use csources_v1
* also updated the BSDs
* also updated azure pipelines
* std modules should not itself use the 'std/' import dir...
* compiler has to be careful with std/ for v1 booting
|
|
|
|
|
|
|
| |
* std/options: $some(3) is now "some(3)", not "Some(3)", `$none(int)` is now `"none(int)"` instead of `"None[int]"`
* fix tests
* disable optionsutils
|
|
|
|
|
|
|
|
|
|
|
| |
* Add example for pattern matching on options
* Use code-block
* Apply suggestions
* Use block comments
* Fix example
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* move tests to testament
* minor
* fix random
* disable test random
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add some enhancements to `jsonutils.nim`
* Use `jsonutils.nim` hookable API to add a possibility to deserialize
JSON arrays directly to `HashSet` and `OrderedSet` types and
respectively to serialize those types to JSON arrays.
* Also add a possibility to deserialize JSON `null` objects to Nim
option objects and respectively to serialize Nim option object to JSON
object if some or to JSON `null` object if none.
* Move serialization/deserialization functionality for `Table` and
`OrderedTable` types from `jsonutils.nim` to `tables.nim` via the
hookable API.
* Add object `jsonutils.Joptions` and parameter from its type to
`jsonutils.fromJson` procedure to control whether to allow
deserializing JSON objects to Nim objects when the JSON has some
extra or missing keys.
* Add unit tests for the added functionalities to `tjsonutils.nim`.
* improve fromJsonFields
* Add changelog entry for the jsonutils enhancements
* Add TODO in `jsonutils.nim`
* Added an entry to "Future directions" section in `jsonutils.nim` as
suggestion for future support of serialization and de-serialization of
nested variant objects.
* Added currently disabled test case in `tjsonutils.nim` for testing
serialization and de-serialization of nested variant objects.
* Move JSON hooks to `jsonutils.nim`
Move `fromJsonHook` and `toJsonHook` procedures for different types to
`jsonutils.nim` module to avoid a dependency of collections modules to
the `json.nim` module.
The hooks are removed from the following modules:
* `tables.nim`
* `sets.nim`
* `options.nim`
* `strtabs.nim`
* Add some tests about `StringTableRef`
Add tests for `StringTableRef`'s `fromJsonHook` and `toJsonHook` to
`tjsonutils.nim`.
* Disable a warning in `jsonutils.nim`
Mark `fun` template in `jsonutils` module with `{.used.}` pragma in
order to disable `[XDeclaredButNotUsed]` hint. The template is actually
used by the `initCaseObject` macro in the same module.
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Change `UnpackError` with `UnpackDefect`
The deprecation warning for `UnpackError` exception raised by some
`inline` procedures in the Nim standard library propagates to the user
code. If the user code has a requirement for building without warnings
this is a problem for the successful execution of the tests. In order
to resolve this, all occurrences of `UnpackError` in the Nim code base
are changed to `UnpackDefect`. Only the type alias is retained to not
break other people's user code since `UnpackError` is exported type.
* Remove the catching of `UnpackDefect`
Defect exceptions should not be cached, because they indicate problem in
the API usage. The code in `nimblesocket.nim` is rewritten to first
check whether there is a value set into the `knownDomain` variable from
the `Option` type before usage.
|
|
|
| |
Co-authored-by: cooldome <ariabushenko@bk.ru>
|
|
|
|
|
|
|
| |
* The whole options module should be inline
* Use inline per proc and tag `lent` where appropriate
* Remove lent annotation (failing at compiletime)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Error -> Defect for defects
The distinction between Error and Defect is subjective,
context-dependent and somewhat arbitrary, so when looking at an
exception, it's hard to guess what it is - this happens often when
looking at a `raises` list _without_ opening the corresponding
definition and digging through layers of inheritance.
With the help of a little consistency in naming, it's at least possible
to start disentangling the two error types and the standard lib can set
a good example here.
|
|
|
|
|
|
|
|
| |
* Consider proc as a pointer type in options
* Add version annotation for SomePointer having proc in options
* Log procs as pointers for options in changelog
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Fixes #7780
|
|
|
|
|
|
|
|
| |
* Add none[T]() as alias to none(T)
* Add tests for none[T]
* this test shouldn't work anyway
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add >>= operator to Options
* options.bind callback signature: A -> Option[B]
* Use `flatMap` as the name of the Option bind operation.
* Rename Options test "bind" to "flatMap"
* CR from @dom96: Remove spaces inside of check() call
|
| |
|
| |
|
|
|