| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #11422, refs #8336/#8333, refs #20130
The compiler generates conversion nodes *after* evaluating the branches
of case statements as constants, the reasoning is that case branches
accept constants of different types, like arrays or sets. But this means
that conversion nodes that need to be evaluated like converter calls
don't get evaluated as a constant for codegen. #8336 fixed this by
re-evaluating the node if an `nkHiddenCallConv` was created, and in
#20130 this logic also had to be added for `nkHiddenStdConv` for
cstrings. This logic was only for single case elements, it has now been
added to range elements as well to fix #11422. Additionally, all
conversion nodes are now evaluated for simplicity, but maybe this won't
pass CI.
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #22661
Range expressions in `of` branches in `case` statements start off as
calls to `..` then become `nkRange` when getting typed. For this reason
the compiler leaves `nkRange` alone when type checking the case
statements again, but it still does the exhaustiveness checking for the
entire case statement, and leaving the range alone means it doesn't
count the values of the range for exhaustiveness. So the counting is now
also done on `nkRange` nodes in the same way as when typechecking it the
first time.
|
|
|
| |
fixes #24031
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Closes #14329
Marks `macros.error` as `.noreturn` so that it can be used in
expressions. This also fixes the issue that occurred in #19659 where a
stmt that could be an expression (Due to having `discardable` procs at
the end of other branches) would believe a `noreturn` proc is returning
the same type e.g.
```nim
proc bar(): int {.discardable.} = discard
if true: bar()
else: quit(0) # Says that quit is of type `int` and needs to be used/discarded except it actually has no return type
```
|
|
|
|
|
| |
(#20862)
fix #18964 Small string case with else statement first in AST evaluates wrongly
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* [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>
|
|
|
|
|
| |
* fixes #20031; uint64 is an ordinal type since 1.0
* Update compiler/semstmts.nim
|
|
|
|
|
| |
* nnkArglist => nnkArgList
* special case stylecheck:error
|
| |
|
| |
|
|
|
| |
This reverts commit 3f00a738dbc8319b4dd2b86bf5529c096f2dd243.
|
|
|
|
|
|
|
| |
* fixes #15280 [backport:1.2]
* make tests green again
* adapt tests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* WIP: an optimizer for ARC
* do not optimize away destructors in 'finally' if unstructured control flow is involved
* optimized the optimizer
* minor code cleanup
* first steps to .cursor inference
* cursor inference: big steps to a working solution
* baby steps
* better .cursor inference
* new feature: expandArc for easy inspection of the AST after ARC transformations
* added topt_cursor test
* adapt tests
* cleanups, make tests green
* optimize common traversal patterns
* moved test case
* fixes .cursor inference so that npeg compiles once again
* cursor inference: more bugfixes
Co-authored-by: Clyybber <darkmine956@gmail.com>
|
|
|
|
|
|
|
| |
* fixes the regressions
* closes #13936
* scope based memory management implemented
* enabled tcontrolflow.nim test case
* final cleanups
|
| |
|
|
|
|
| |
* fix #13490
|
| |
|
|
|
|
|
|
| |
* Fix #12785 and add test
* better variable name
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* initial version of int128
* use int128 in case stmt
* fixes #11552
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* merge actiontable tests
* merge arithm tests
* merge array tests
* merge assign tests
* merge bind tests
* merge casestmt tests
* merge closure tests
* merge cnt seq tests
* merge collections tests
* merge concept issues tests
* merge concept tests
* fix failing tests
* smaller outputs
Use `doAssert` where possible.
* fix wrong output
* split `tcomputedgoto`
* revert merging concepts
* fix failing test
|
| |
|
|
|
| |
Fixes #8333
|
|
|
| |
Fixes #7699
|
| |
|
|
|
|
|
|
|
|
| |
* Improve semchecking for duplicate cases in case statements
* Revert to previous solution
* Improve test
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
|
| |
|
|
|
|
|
|
|
| |
Added support for conditional compilation using 'when' with empty sets and arrays in
'case of' branches.
Please enter the commit message for your changes. Lines starting
|
| |
|
| |
|
|
|
|
| |
empty blocks.
|
|
|