Commit Graph

282 Commits

Author SHA1 Message Date
Mamy Ratsimbazafy 11aeb996ab
Error message typo 2020-06-23 19:46:18 +02:00
andri lim 188230a368
Merge pull request #43 from status-im/fix_vcc_bitops2
fix bitops2 checkedScan and bitScan for vcc
2020-06-19 20:22:34 +07:00
jangko 9385fabe6c
fix countOnesBuiltin for vcc 32 bit 2020-06-15 21:46:01 +07:00
jangko 74d8ff707b
env var for vcc 2020-06-15 21:36:12 +07:00
jangko e1b6d5c92f
add test for vcc compiler 2020-06-15 21:09:41 +07:00
jangko 22fabba6df
fix bitops checkedScan and bitScan for vcc 2020-06-15 11:55:52 +07: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
Jacek Sieka 86ac01122c
ssz no longer uses stew/bitseqs 2020-06-03 11:22:32 +02:00
Zahary Karadjov b9e847a143
Add bitops2.getBitsBE 2020-06-01 19:49:46 +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
andri lim 10e39dcfe5
Merge pull request #39 from rockcavera/master
fixes for `-d:swapBytesBuiltin --cc:vcc`
2020-05-20 10:23:28 +07:00
rockcavera 2218717cf6
fixes for `-d:swapBytesBuiltin --cc:vcc`
renamed the `builtin_bswapT` procedures of the vcc compiler to `swapBytesBuiltin`, to then work correctly with `-d:swapBytesBuiltin --cc:vcc`
2020-05-19 21:58:46 -03:00
Zahary Karadjov d0f5be4971
Fix a compilation error when using a 32-bit varint parser 2020-05-12 22:59:46 +03:00
Zahary Karadjov c500d3dda1
Some renames to cater to the latest FastStreams API 2020-05-12 15:02:06 +03:00
Giovanni Petrantoni 5fa6bb2742 Add a note about compiler crash with raises pragma (results) 2020-05-12 19:37:15 +09:00
Jacek Sieka 21bcf97e26
Remove `ranges` from readme
deprecated
2020-05-08 21:15:01 +02:00
Jacek Sieka f125f6e8d1 space 2020-05-08 18:54:36 +03:00
Jacek Sieka 2d9226464d heterogenous `or`
Useful for translating `error` results
2020-05-08 18:54:36 +03:00
Jacek Sieka 638e7acc8e
deprecate ranges (#31)
Without lifetime tracking, ranges pose a number of issues with regards
to memory safety - use openArray instead which is limited but safe.

In its present form, ranges take a copy of whatever is passed to them
which obscures the copies that they take, leading to misleading and slow
code.

If openArray is not applicable, simply do a seq copy - it's fine and
really doesn't matter in 95% of all cases, then profile and use other
techniques where needed.
2020-05-07 07:11:43 +02:00
Jacek Sieka 720f1a254d
byteutils: compile-time to/fromBytes (#35) 2020-05-06 15:51:07 +02:00
Jacek Sieka 8065e36c5a
results: fix non-void [] overload 2020-04-23 06:46:10 +02:00
Zahary Karadjov df7f2e7ed5
Fix a typo [skip ci] 2020-04-22 16:39:37 +03:00
Zahary Karadjov 1eed7a72b7
Make any accidental "run-time" usage of declval an error 2020-04-22 16:34:11 +03:00
Zahary Karadjov 4acc3866ed
Adds results.Opt
It turned out that Nim's Option type is broken for `not nil` and
`requiresInit` types. It will report an udesired warning due to
the way `none` is defined. The `Result` type doesn't suffer from
this problem, so I've transitioned some APIs in NBC to use the
new `results.Opt[T]` type (alias of `Result[T, void]`).

Perhaps we should renamed `Result` to `Res` to make the naming
more consistent and to allow the code to more easily fit in the
80 character per-line budget.
2020-04-22 15:43:26 +03:00
Zahary Karadjov 9a0cded592
Add objects.declval 2020-04-22 15:41:42 +03:00
Jacek Sieka ff755bbf75
change get/[] to always raise Defect and tryGet to do eh bridge mode (#30)
* also sprinkle mixin randomly across the codebase
2020-04-16 18:23:12 +02:00
Zahary Karadjov 8528ce28b4
Writing to FastStreams can have side-effects 2020-04-14 19:36:15 +03:00
Jacek Sieka 805ef4f1b2
result: cleanups
* fix defect raising without `$`
* doc updates
* better `?` that doesn't cause raises effect (it should, because of
FieldError but...)
2020-04-11 16:22:37 +02:00
Jacek Sieka 5512e89d4c a few more cleanups
* add raises to endians2, bitops2 since they sometimes call C functions
2020-04-10 22:40:00 +03:00
Jacek Sieka 87ccf8e66b hex byte: raise instead of assert on hex-to-byte odd lengths 2020-04-10 22:40:00 +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
Jacek Sieka b06a5b6e32
result -> results (#27) 2020-04-07 11:43:07 +02:00
Jacek Sieka 55c2ec8977 result: more performance notes 2020-04-06 15:53:53 +03:00
Jacek Sieka 4d20b25c02 result: fix and/or template evaluation, add perf notes 2020-04-06 15:53:53 +03:00
Jacek Sieka 9414202d53 result: `and` can deal with heterogenous values 2020-04-04 00:28:46 +03:00
Jacek Sieka 86739f99c4
Use defect for normal errors, document exception bridge mode (#20)
Co-authored-by: Zahary Karadjov <zahary@gmail.com>
2020-04-02 11:39:11 +02:00
Jacek Sieka 4201f46750
Update README.md 2020-04-01 14:22:21 +02:00
Jacek Sieka fe074766f1
Update README.md 2020-04-01 14:22:04 +02:00
Jacek Sieka 7287fffebe
result: add `expect` helper (#23)
* result: add `expect` helper

* result: use explicit conversion in mapConvert
2020-04-01 14:16:20 +02:00
Jacek Sieka d622c07a08
result: cleanups (#22)
* fix ResultError type
* add/fix documentation
* clean up raises (in preparation for better Defect handling)
* fix toException mixin
* work around compiler bug with more explicit types
* fix capture exception type
* fix result type on `?`
2020-03-30 22:49:13 +02:00
Ștefan Talpalaru 4477f45c40
Merge branch 'basetype' 2020-03-30 19:56:37 +02:00
Ștefan Talpalaru 09e55cd375
stew/objects: add baseType() 2020-03-29 17:34:45 +02:00