Commit Graph

15 Commits

Author SHA1 Message Date
ringabout
c948ab9b85 fixes symbolName for range enums (#24052) 2024-09-03 16:35:04 +02:00
ringabout
4d11d0619d complete std prefixes for stdlib (#22887)
follow up https://github.com/nim-lang/Nim/pull/22851
follow up https://github.com/nim-lang/Nim/pull/22873
2023-10-30 17:03:04 +01:00
ringabout
e10878085e fixes #22844; uses arrays to store holeyenums for iterations; much more efficient than sets and reasonable for holeyenums (#22845)
fixes #22844
2023-10-20 18:38:42 +02:00
metagn
51cb493b22 make parseEnum skip type aliases for enum type sym (#22727)
fixes #22726
2023-09-19 09:14:55 +02:00
Etan Kissling
8bba04078c avoid AnyEnumConv warning in genEnumCaseStmt (#22061)
When parsing enums from strings using `genEnumCaseStmt`, `AnyEnumConv`
warnings are generated due to conversion from integer value. It seems
possible meanwhile to refer to the actual `enum` value by symbol instead
of being required to do the conversion from `ord`, even when the `enum`
is defined in a `block`.
2023-06-10 14:45:00 +02:00
Andreas Rumpf
cf1b16ef8b minor code cleanups (#21215) 2023-01-02 10:39:17 +01:00
flywind
7f6e800caf move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
flywind
33bfe5b12c fix parseEnum cannot parse enum with const fields (#19466)
fix #19463
2022-02-04 13:47:03 +01:00
Vindaar
7d3c3e00ef Allow nnkAccQuoted in genEnumCaseStmt (#18606)
* [enumutils] provide node kind for `Invalid node type` error

* [enumutils] add support for nnkAccQuoted in `genEnumCaseStmt`

For reasons unknown to me, when running `nim doc` on a file that uses
`parseEnum` with an enum that contains accented quotes errors at CT
with the `Invalid node for type` error. Further errors are raised,
probably because the enum parsing fails?
2021-07-29 07:47:34 +02:00
Miran
e616675c41 various small documentation improvements (#18602) 2021-07-28 14:31:13 +02:00
Timothee Cour
7f077a76fe jsonutils: add customization for toJson via ToJsonOptions; generalize symbolName; add symbolRank (#18029)
* jsonutils: add customization for toJson via `ToJsonOptions`

* add enumutils.symbolRank

* lookup table implementation for HoleyEnum

* cleanup

* changelog

* fixup

* Update lib/std/jsonutils.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-05-18 15:10:19 +02:00
Andreas Rumpf
a9b62de895 CIs: attempt to use csources_v1 (#16282)
* 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
2021-04-21 07:41:33 +02:00
Timothee Cour
eb07a5a75b add typetraits.OrdinalEnum, enumutils.symbolName (#17281) 2021-03-10 08:08:24 -08:00
Timothee Cour
c274e67198 add enumutils.items for sparse enums, typetraits.SomeSparseEnum (#17080)
* add enumutils.items for enum with holes
* changelog
* ref in lib.rst
* use `type SomeSparseEnum* = (not Ordinal) and enum` instead of concept
* address comment: rename back to enum with holes
2021-02-23 20:25:35 +01:00
cooldome
d62f3627aa EnumUtils, speed up findStr in compiler (#15777)
* add parseEnumRange
* fix runnable example
* update changelog
* use parseEnumRange in compiler
* reorganise code
* add changelog, make single normalizer argument
2020-11-03 16:26:16 +01:00