| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
ref https://forum.nim-lang.org/t/11590
|
|
|
| |
fixes #24031
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
updated version of #22193
After #22029 and the followups #23983 and #24005 which fixed issues with
it, `tyFromExpr` no longer match any proc params in generic type bodies
but delay all non-matching calls until the type is instantiated.
Previously the mechanism `fauxMatch` was used to pretend that any
failing match against `tyFromExpr` actually matched, but prevented the
instantiation of the type until later.
Since this mechanism is not needed anymore for `tyFromExpr`, it is now
only used for `tyError` to prevent cascading errors and changed to a
bool field for simplicity. A change in `semtypes` was also needed to
prevent calling `fitNode` on default param values resolving to type
`tyFromExpr` in generic procs for params with non-generic types, as this
would try to coerce the expression into a concrete type when it can't be
instantiated yet.
The aliases `tyProxy` and `tyUnknown` for `tyError` and `tyFromExpr` are
also removed for uniformity.
|
|
|
| |
fixes jsbigint64 regression
|
| |
|
| |
|
|
|
|
| |
(#23654)
|
| |
|
|
|
|
|
| |
`reset`, `wasMoved` and `move` doesn't support primitive types, which
generate `null` for these types. It is now produce `x = default(...)` in
the backend. Ideally it should be done by ast2ir in the future
|
|
|
| |
ref https://github.com/nim-lang/Nim/issues/9550
|
|
|
|
| |
follow up https://github.com/nim-lang/Nim/pull/7606
https://github.com/nim-lang/Nim/pull/13466
|
|
|
| |
introduced in https://github.com/nim-lang/Nim/pull/9411
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #23492
```nim
proc foo =
var x: range[1.0 .. 5.0] = 2.0
case x
of 1.0..2.0:
echo 1
else:
echo 3
foo()
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #4695
ref https://github.com/nim-lang/Nim/pull/15818
Since `nkState` is only for the main loop state labels and `nkGotoState`
is used only for dispatching the `:state` (since
https://github.com/nim-lang/Nim/pull/7770), it's feasible to rewrite the
loop body into a single case-based dispatcher, which enables support for
JS, VM backend. `nkState` Node is replaced by a label and Node pair and
`nkGotoState` is only used for intermediary processing. Backends only
need to implement `nkBreakState` and `closureIterSetupExc` to support
closure iterators.
pending https://github.com/nim-lang/Nim/pull/23484
<del> I also observed some performance boost for C backend in the
release mode (not in the danger mode though, I suppose the old
implementation is optimized into computed goto in the danger mode)
</del>
allPathsAsgnResult???
|
|
|
|
|
|
|
|
|
|
| |
variable `_` (#23498)
According to
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/Expression_statement,
some expression statements need parentheses to make it unambiguous. `_`
introduced in the https://github.com/nim-lang/Nim/pull/15789 is
unnecessary. We can get rid of it by adding parentheses so that object
literals are not ambiguous with block statements.
|
|
|
|
|
|
|
|
| |
fixes #4299
fixes #12492
fixes #10849
It binds `function` with `env`: `function.bind(:env)` to ease codegen
for now
|
| |
|
|
|
| |
mIntToStr, mInt64ToStr, mFloatToStr,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the function name extension encoded by paths could be useful for
debugging where the function is from
Before:
```js
function newSeq_33556909(len_33556911)
```
After:
```js
function newSeq__system_u2477(len_p0)
```
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #16771
follow up https://github.com/nim-lang/Nim/pull/16536
Ideally it should be handled in the IR part in the future
I have also checked the double evaluation of `swap` in the JS runtime
https://github.com/nim-lang/Nim/issues/16779, that might be solved by a
copy flag or something. Well, it should be best solved in the IR so that
it doesn't bother backends anymore.
|
|
|
| |
fixes #9550
|
|
|
|
| |
fixes #23382
follow up https://github.com/nim-lang/Nim/pull/15823
|
|
|
| |
fixes #23378
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
why ?
- We already have an emit that does the same thing
- The name asm itself is a bit confusing, you might think it's an alias
for asm.js or something else.
- The asm keyword is used differently on different compiler targets (it
makes it inexpressive).
- Does anyone (other than some compiler libraries) use asm instead of
emit ? If yes, it's a bit strange to use asm somewhere and emit
somewhere. By making the asm keyword for js target deprecated, there
would be even less use of the asm keyword for js target, reducing the
amount of confusion.
- New users might accidentally use a non-universal approach via the asm
keyword instead of emit, and then when they learn about asm, try to
figure out what the differences are.
see https://forum.nim-lang.org/t/10821
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
new strictions on methods (#22991)
**TODO**
- [x] fixes changelog
With the new option `nimPreviewVtables`, `methods` are confined in the
same module where the type of the first parameter is defined
- [x] make it opt in after CI checks its feasibility
## In the following-up PRs
- [ ] in the following PRs, refactor code into a more efficient one
- [ ] cpp needs special treatments since it cannot embed array in light
of the preceding limits: ref
https://github.com/nim-lang/Nim/pull/20977#discussion_r1035528927; we
can support cpp backends with vtable implementations later on the
comprise that uses indirect vtable access
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
| |
follow up https://github.com/nim-lang/Nim/pull/22851
|
|
|
|
|
|
| |
Done:
- [x] Implement conversions to openArray/varargs.
- [x] Implement index/range checking.
|
| |
|
|
|
|
|
| |
works better with strictdefs (#22436)
replaces `doAssert false` with `raiseAssert`, which works better with strictdefs
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* wip; use strictdefs for compiler
* checkpoint
* complete the chores
* more fixes
* first phase cleanup
* Update compiler/bitsets.nim
* cleanup
|
|
|
|
|
| |
Fix `succ`, `pred`
Fix `genRangeChck` for unsigned ints
Fix typo in `dec`
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* implement `ensureMove`
* use an additional flag
* improve some logics
* progress: fixes discard ensureMove
* forbids nested expressions
* improve error messages
* checkpoint
* fixes cursor
* ADD MORE TESTS
* fixes cursorinference again
* tiny cleanup
* improve error messages
* fixes docs
* implement comments add more tests
* fixes js
|
|
|
|
|
| |
* [JS] Fix bitwise ops & shifts
* Test `int64` & `uint64` only with `jsbigint64`
|
|
|
|
|
| |
* [JS] Fix casting to ints
* Simplify `genCast` by using `asUintN`/`asIntN`
|
|
|
|
|
|
|
|
|
|
|
| |
* fix VM uint conversion bug, stricter int gen on JS
fixes #19929
* fix float -> uint64 conversion too
* no need to mask to source type
* simpler diff with explanation, add test for described issue
|
|
|
|
|
|
|
|
|
|
|
| |
* .
* Fix jsgen FrameInfo
* Fix jsgen FrameInfo
* .
* Move to PProc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* import `=dup` hook eliminating `wasMoved` and `=copy` pairs
* add dup
* add a test for dup
* fixes documentation
* fixes signature
* resolve comments
* fixes tests
* fixes tests
* clean up
|
|
|
|
|
|
|
|
|
|
|
| |
* int64/uint64 as bigint in JS
* fix CI
* convert to compile option
* fix lie
* smaller diff, changelog entry
|
|
|
|
|
|
|
| |
dispatcher for ORC (#21594)
* fixes #21592; create type operations for the method dispatcher
* add a test case
|
|
|
| |
Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
calls; simplify compilation pipeline (#21444)
* abolish using passes in the compiler; simplify compilation pipeline
* duplicate code
* Really cool to have the same signature...
* haul
* unify other backends
* refactor process
* introduce PipelinePhase
* refactor compiler
* fixes passes
* fixes nimsuggest
* add a sentinel
* enable docs checkj
* activate doc testing
* clean up
* complete cleanups
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#21274) [backport:1.6]
* fixes #20139; hash types based on its path relative its project
* add a test case
* fixes procs
* better implementation and test case
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
parses the whole module at one time (#21379)
* fixes #19795; remove parse pipeline
* isScript
* fixes nimscriptapi
* don't touch reorder
* check script
* fixes tests
* it seems implicit imports of system cause troubles
* access the first child of `nkStmtList`
* ignore comments
* minor messages
* perhaps increases hloLoopDetector
* the module is a stmtList, which changes the errors
* fixes nimdoc
* fixes tlinter
* fixes nim secret tests
* fixes arc_misc
* fixes nim secret tests again
* safe; fixes one more test
* GlobalError is the root cause too
* fixes parsing errors
* put emit types to the cfsForwardTypes section
* fixes #11852; `{.push checks:off}` now works in procs
* disable navigator
* fixes nimdoc
* add tests for JS
* fixes nimsuggest
|
|
|
|
|
| |
[backport 1.6] (#21320)
fixes #21317; regression; etyBaseIndex should return fat pointers
|
|
|
|
|
| |
* Add test case
* Extend string with '0' when setting length to be longer
|