43 Commits

Author SHA1 Message Date
Etan Kissling
7b4c9407f2
add enumStyle helper macro (#189)
For serialization and parsing, distinguishing enums with numeric values
from enums with associated strings for each value is useful. This adds
foundational helpers to allow such distinction.
2023-05-26 15:41:13 +03:00
c-blake
e18f5a62af
Add API call from a (slight) future 1.6 branch with when guards to (#173)
* Add API call from a (slight) future 1.6 branch with when guards to
deactivate as per claim here

    https://github.com/status-im/nim-codex/pull/346#issuecomment-1432073926

that this (or something very near it) is where it belongs.

* I also cannot find any `shims/parse` import.  See discussion here:
  https://github.com/status-im/nim-stew/pull/173

So, rename module to match upstream Nim stdlib.

If anyone complains, re-create `parse.nim` that simply does import
& re-export parseutils & self-deprecates.
2023-02-21 16:29:07 -05:00
jangko
c52569abd5
add {.used.} to stddefects for nim 1.4 and above 2023-02-15 16:18:10 +07:00
jangko
f2e58ba4c8
support multiple nim version re. nnkArgList issue 2022-09-22 08:16:32 +07:00
Zahary Karadjov
06621a2fcd
More forgiving recordFields 2022-07-28 19:50:32 +03:00
Miran
2ab76e2cc2
fix warnings encountered with Nim 1.6 (#128)
* fix warnings encountered with Nim 1.6

* Create shims/stddefects.nim with aliases for all defects
2022-07-27 10:10:26 +02:00
Miran
d37e77a72b
make it more Nim 1.4+ compatible (#131)
* make it more 1.6-compatible

* these changes are from 1.4 forward
2022-07-26 17:52:59 +00:00
tersec
f173efc500
stylecheck: nnkArglist -> nnkArgList (#127)
* stylecheck: nnkArglist -> nnkArgList

* --stylecheck:error iff >= 1.6.0
2022-07-18 11:02:40 +00:00
Zahary Karadjov
b87fd80b0f
Add tests for recordFields being used with empty objects 2022-03-03 17:36:28 +02:00
Zahary Karadjov
2f9c61f485
Add hashes.hashAllFields 2021-12-03 13:30:06 +02:00
Zahary Karadjov
a98ec09b0b
Add sets.keepItIf 2021-12-03 13:28:59 +02:00
Jacek Sieka
8a405309c6
enable styleCheck:usages (#93) 2021-12-02 16:24:02 +01:00
cheatfate
a587b7a8eb Fix generic sandwich problem. 2021-11-09 20:15:15 +02:00
Gabben
04f8150a08
Fix #62 (#75)
* Fix #62

- Supports more than one pragma parameter (return tuple)
- Returns nil if there are zero parameters in the pragma (like std)
2021-02-10 15:10:08 +02:00
Zahary Karadjov
1db43c7234
Add string.add(openarray[char]) (to be optimized later) 2020-09-02 19:59:50 +03:00
Zahary Karadjov
61e0f82858
More descriptive naming 2020-07-08 00:32:28 +03:00
Kim De Mey
cf82e2d51d
Remove made up ValueError (#42) 2020-06-09 10:21:28 +02:00
Zahary Karadjov
bb2221ba8c
Forgotten changes from the previous commit 2020-06-05 19:19:06 +03:00
Zahary Karadjov
c0f884b81b
Add shims/net for forced IP address initialization 2020-06-05 17:05:22 +03:00
Zahary Karadjov
a99dafab42
Handle another corner case in recordFields 2020-05-27 11:30:56 +03:00
Zahary Karadjov
4ffd3e1f59
Support type hierarchies in recordFields 2020-05-26 18:56:41 +03:00
Zahary Karadjov
cf837b3fb6
Fix a build problem when compiling NBC with json:trace logging 2020-05-25 20:32:29 +03:00
Zahary Karadjov
a333eb080f
Add options to storeMacroResults that improve the results in NBC 2020-05-24 00:49:12 +03:00
Zahary Karadjov
9a2a542b9f
Add dumpMacroResults 2020-05-23 20:18:20 +03:00
Zahary Karadjov
f003557674
typedParams will now handle parameters with pragmas 2020-05-23 20:12:56 +03:00
Zahary Karadjov
a695d9e7bd
Add shims/macros.getCustomPragmaFixed 2020-05-20 13:42:29 +03:00
Zahary Karadjov
3e1fa974a4
Use a simpler recursion in recordFields as it's no longer an iterator 2020-04-09 20:39:02 +03:00
Zahary Karadjov
989c33a82b
Take advantage of fixes in Nim 1.2 2020-03-25 17:52:09 +02:00
Zahary Karadjov
1c4293b3e7
A new fix for newLit
Upstream fix submitted here:
https://github.com/nim-lang/Nim/pull/12542
2019-10-28 14:30:49 +02:00
Zahary Karadjov
2c9ca5dabb recordFields returns more accurate information in nested case objects 2019-10-23 09:36:16 +09:00
Zahary Karadjov
4f685ab7ec
Another useful form of isTuple 2019-08-14 17:29:14 +02:00
Zahary Karadjov
343c2073cc
recordFields have become too heavy-weight to remain an iterator 2019-08-12 17:49:39 +03:00
Alexander Ivanov
06290de0f9
Implement unnamed tuple support 2019-08-08 22:51:25 +03:00
Zahary Karadjov
a3df04d701
Add more init procs for tables and macros.genExpr 2019-08-02 15:26:08 +03:00
Zahary Karadjov
2ca2f25af6
hasCustomPragmaFixed supports types with quoted field names 2019-07-31 02:43:35 +03:00
Zahary Karadjov
30e084f76f
Add macros.inspectType 2019-07-31 02:20:49 +03:00
Zahary Karadjov
f782f0378f
Add macros.genCode 2019-07-31 02:13:03 +03:00
Zahary Karadjov
4f4f138fb4
More capable alternative of unpackVarargs 2019-07-31 02:13:02 +03:00
Zahary Karadjov
5b6881588c
Alternative API for reading custom pragmas; The Nim one is too broken in 0.19.6 2019-07-31 02:13:02 +03:00
Zahary Karadjov
7d764a2390
Add init procs for sets 2019-07-16 13:17:32 +03:00
Jacek Sieka
522398a53e backport atomics from nim 0.20 (#4) 2019-07-14 10:24:22 +02:00
Jacek Sieka
89107ae03d
fix shims imports 2019-07-07 11:38:00 +02:00
Jacek Sieka
0a8e95408f
std_shims->stew 2019-07-06 19:12:24 +02:00