Commit Graph

197 Commits

Author SHA1 Message Date
Constantine Molchanov
4ae598762e fixes #21439; Add tyOpenArray to genTypeInfo. (#21440)
* fixes #21439; Add tyOpenArray to genTypeInfo.

* Add test.
2023-02-27 00:56:43 +01:00
Jake Leahy
0a45543cc1 Specify that address is taken when converter takes a var parameter (#21391)
* Add test case

* closes #21247 Add the sfAddrTaken flag to var parameters in converters

This allows the JS backend to properly pass the parameter as a fat pointer
2023-02-21 12:27:12 +01:00
Jake Leahy
cac49694c0 std/asyncjs allow transforming proc types (#21356)
* Add test case

* Implement JS async transform for nnkProcTy
2023-02-14 08:14:19 +01:00
ringabout
76e4f8afb1 fixes #21209; exclude threads options for JS (#21233) 2023-01-08 15:39:25 +01:00
Jake Leahy
7ae7832f76 JS backend properly extends string with setLen (#21087)
* Add test case

* Extend string with '0' when setting length to be longer
2022-12-13 08:43:37 +01:00
Jake Leahy
1fefb8e92a Refactor JS sourcemap generator (#21053)
* Parse the new line format

* Fix pattern

Didn't have space after the path

* Remove duplicate sources

Sources would sometimes double up with a new line at the end

* Remove unused variable

* Refactor sourcemap.nim

Removes the multiple translations needed, now goes from single high level type to the final SourceMap

Adds documentation for procs

* Line numbers line up properly now

Files aren't linking correctly though

* Files now link up correctly

Lines are sometimes off but overall seems pretty good

Just need to implement parser

* Add column info to output

Add sourceMappingURL to rope directly to prevent copy

* Properly handle columns

* Remove debug lines

* Add testcase

* Finish testcase

* Use the outdir folder instead of the folder the test is in to find the sourcemap

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
2022-12-13 12:21:51 +08:00
ringabout
9ba07edb2e build the documentation of official packages (#20986)
* remove db stuffs

* remove punycode

* remove

* fixes script

* add cloner

* patches

* disable

* patch

* fixes external packages

* disable two packages

* preview documentation build

* try again

* fixes URL

* fixes a bug

* simplify

* fixes documentaion

* fixes

* Apply suggestions from code review
2022-12-06 22:37:16 +08:00
metagn
6d8cf25bd7 deprecate do: meaning do (): + misc cleanup (#20927)
* test disable do: block lambda lifting

* fix last test [skip ci]

* deprecate `do:` meaning `do ():` + misc cleanup

closes https://github.com/nim-lang/RFCs/issues/486

* oops

* fix

* no idea what could be causing nimsuggest failure other than this

* ensure ci works
2022-12-06 09:44:26 +01:00
ringabout
17ac8c31bf move smtp to nimble packages (#20953)
* move `smtp` to nimble packages

* fixes

* install smtp

* yes
2022-11-30 21:52:36 +01:00
Bung
b286448a99 fix #8821 JS codegen can produce extreme switch statements with case … (#20548)
* fix #8821 JS codegen can produce extreme switch statements with case a of range

* remove totalRange
2022-10-14 12:21:02 +02:00
ringabout
c651817ffd fixes devel CI (#20512) 2022-10-07 15:00:15 +02:00
ringabout
f89ba2c951 add default field support for object in ARC/ORC (#20480)
* fresh start

* add cpp target

* add result support

* add nimPreviewRangeDefault

* reduce

* use orc

* refactor common parts

* add tuple support

* add testcase for tuple

* cleanup; fixes nimsuggest tests

* there is something wrong with cpp

* remove

* add support for seqs

* fixes style

* addd initial distinct support

* remove links

* typo

* fixes tuple defaults

* add rangedefault

* add cpp support

* fixes one more bugs

* add more hasDefaults

* fixes ordinal types

* add testcase for #16744

* add testcase for #3608

* fixes docgen

* small fix

* recursive

* fixes

* cleanup and remove tuple support

* fixes nimsuggest

* fixes generics procs

* refactor

* increases timeout

* refactor hasDefault

* zero default; disable i386

* add tuples back

* fixes bugs

* fixes tuple

* add more tests

* fix one more bug regarding tuples

* more tests and cleanup

* remove messy distinct types which must be initialized by original types

* add tests

* fixes zero default

* fixes grammar

* fixes tests

* fixes tests

* fixes tests

* fixes comments

* fixes and add testcase

* undo default values for results

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
2022-10-04 12:45:10 +02:00
metagn
0b1650576c move widestrs out of system (#20462)
* move widestrs out of system

* fix osproc
2022-10-01 22:35:09 +02:00
Bung
08faa04d78 fix #20233 Float ranges in case statement in JS crash compiler (#20349) 2022-09-14 17:16:34 +02:00
flywind
1e5dd9022b [js] add testcase for array indexDefect and remove todo (#19838)
* remove unused opcSubstr

* [js] add testcase for array indexDefect

* Revert "remove unused opcSubstr"

This reverts commit cb461f2545.
2022-06-10 20:33:44 +02:00
flywind
7b09fd70ab undefine C symbols in JS backend [backport:1.6] (#19437)
fix #19330; fix #19059
2022-02-04 17:10:24 -05:00
hlaaftana
07c7a8a526 Optimize lent in JS [backport:1.6] (#19393)
* Optimize lent in JS [backport:1.6]

* addr on lent doesn't work anymore, don't use it

* use unsafeAddr  in test again for older versions
2022-01-17 13:03:40 +01:00
flywind
d102b2f54c deprecate unsafeAddr; extend addr (#19373)
* deprecate unsafeAddr; extend addr

addr is now available for all addressable locations, unsafeAddr is deprecated and become an alias for addr

* follow @Vindaar's advice

* change the signature of addr

* unsafeAddr => addr (stdlib)

* Update changelog.md

* unsafeAddr => addr (tests)

* Revert "unsafeAddr => addr (stdlib)"

This reverts commit ab83c99c50.

* doc changes; thanks to @konsumlamm

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-01-16 11:08:38 +01:00
hlaaftana
a95399143f Use openarray of bytes in md5 (#19307)
* Use openarray of bytes in md5
* fix CI
* cleanup
* use noSideEffect for bootstrapping
* fix CI again
* actually fix CI by checking if it works
* this is getting ridiculous
* put old md5 version in compiler, remove vmop
2022-01-15 13:19:05 +01:00
flywind
9df195ef58 style usages part one (openarray => openArray) (#19321)
* style usages (openArray)

* revert doc changes
2022-01-04 13:29:50 +01:00
hlaaftana
faaf271928 Update JS and nimscript import tests (#19306)
* add new modules, except experimental ones
* remove deprecated modules mersenne and sharedlist
* better describe why some modules fail and some modules don't
2022-01-01 13:33:16 +01:00
Timothee Cour
f061971a9b envPairs works in vm, nims (#18615)
* envPairs works in vm, nims

* fixup
2021-09-29 09:32:39 +02:00
flywind
c56008450a fix CI failure(upstream changes) (#18820)
* fix upstream changes

* Update tests/js/tunittest_error2.nim

Co-authored-by: flywind <xzsflywind@gmail.com>

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-09-08 11:47:14 +02:00
Timothee Cour
0de3d4292f fix #16993, #18054, #17835 runnableExamples now works with templates and nested templates (#18082) 2021-06-02 09:02:14 -07:00
Timothee Cour
a66637bda4 followup #16871 asyncjs.then: allow pipelining procs returning futures (#17189)
* followup #16871 asyncjs.then: allow pipelining procs returning futures
* rename test files where they belong
* fix tests
* tests for then with `onReject` callback
* rename test file containing fail to avoid messing with grep
* address comments
* cleanup
* un-disable 1 test
2021-03-04 14:00:04 +01:00
flywind
ec068a2687 fix #17177 (#17243)
* remove unnecessary when statement

* remove outdated codes

* fix #17177

* add testcase
2021-03-03 11:57:34 +01:00
Timothee Cour
a4e6b242d5 asyncjs: add then, catch for promise pipelining (#16871)
* asyncjs: add then
* improve tests, changelog, API
* fix cryptic windows error: The parameter is incorrect
* address comments
2021-02-24 21:03:21 +01:00
flywind
240879bf3d array literals uses typed arrays; fix a jsgen bug (#16850)
* array litterals uses typed arrays
* Update compiler/jsgen.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-02-15 11:28:11 +01:00
Saem Ghani
260a5dacb7 fixed dot operator recursive loop & macro suggest (#16922)
* basic stability improvements; refs nimsuggest
* fixed dot operator recursive loop & macro suggest
* hacky fix for run away dot operator sem check

Committing this mostly to make the issue more clear. Perhaps get better
feedback.

* semExprWithType seems like a better place to check
* fixed error messages const case expressions
* Clean-up test
* stopped the dot operator madness

No longer get infinite recursion when seming broken code with a dot
operator macro like in jsffi.

Co-authored-by: Araq <rumpf_a@web.de>
2021-02-15 09:51:05 +01:00
Timothee Cour
fff5819ee7 fix #16978 unittest js foreign exception (#16998)
* fix #16978 unittest js foreign exception
2021-02-13 09:51:46 +01:00
hlaaftana
fad8439b8d Make parseopt available on all backends (#17009)
* Make parseopt available on all backends

* fix spaces

* fix getopt and update prelude

* no crazy unnecessary version checks, use doAssert
2021-02-13 09:05:40 +01:00
hlaaftana
81533a0014 [backport:1.4] JS cstring null fixes (#16979)
* [backport:1.4] JS cstring null fixes
* fix JS move string
* make it look cleaner
2021-02-11 17:04:32 +01:00
Timothee Cour
7b9b76d840 tests/tuples/ttuples_issues.nim: test on all backends + various improvements (#16907)
* improve tests/tuples/ttuples_issues.nim: test on all backends

* address comments
2021-02-02 20:17:13 +01:00
flywind
de4f2604c2 fix #16822 (#16884)
* see whether it breaks

* fix #16884

* correct

* fix #14574
2021-02-01 13:31:04 +01:00
Timothee Cour
14730d9d64 fix noDecl => nodecl (#16760)
* fix noDecl => nodecl

* address comment

* disable flaky tests/stdlib/thttpclient.nim on freebsd
2021-01-20 11:08:42 +01:00
Timothee Cour
18e14f5920 js: improve tests + some docs (#16727)
* js: improve tests

* _

* _

* _

* fixup
2021-01-16 12:08:40 +01:00
Timothee Cour
025ca660f7 [backport 1.0] add backend support for js bigint (#16606)
* add backend support for js bigint

* cleanup

* add tests

* add -d:nimHasJsBigIntBackend

* cleanup

* more tests
2021-01-06 20:28:24 +01:00
flywind
5fb56a3b2c refactor cmpIgnoreStyle and cmpIgnoreCase (#16399)
* init

* support strutils

* more

* better

* Call len once per string/cstring

* Change var to let

* Compare ternary on first char

* More appropriate param name

* fix

* better

* one test

* impl

* more efficient

* minor

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-12-31 11:54:40 +01:00
Timothee Cour
82bb4db4b7 unittest: use defines instead of env vars (#16165)
* unittest: use defines instead of env vars

* use defines in testament

* fixup

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-12-10 00:57:52 +01:00
Timothee Cour
b809562c7c make megatest consistent with unjoined tests wrt newlines, honor newlines in output spec (#16151)
* fix megatest newlines
* still allow missing trailing newline for now but in a more strict way than before
2020-11-28 09:09:31 +01:00
flywind
70a1c42542 add ** to jsffi (#16141)
* fix rope index

* add testcase

* fix ropes format

* add `**` to jsffi

* add testcase

* changelog

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-11-26 20:30:19 +01:00
flywind
19e224866b add simple writeStackTrace for JS backend (#16016)
* add simple writeStackTrace for JS backend

* add testcase for writeStackTrace

* changelog
2020-11-24 19:45:06 +01:00
Timothee Cour
b3c3557c33 fix #16025 repr now consistent: does not insert trailing newline (#16034) 2020-11-19 12:12:51 -08:00
flywind
47ce24f680 fix #12303 (#15964) 2020-11-14 12:51:23 +01:00
Timothee Cour
1a47fc2291 strengthen taddr.nim: add test case for #14578; reference other issues; test cpp (#15960) 2020-11-13 14:44:44 -08:00
Timothee Cour
cc882917fe js -d:nodejs now supports osenv: getEnv, putEnv, envPairs, delEnv, existsEnv (v2) (#15826)
* js -d:nodejs now supports osenv: `getEnv`, `putEnv`, `envPairs`, `delEnv`, `existsEnv`

* refactor to osenv

* fix for js (without -d:nodejs) + VM

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-11-12 14:36:57 +01:00
flywind
1f9bf43100 fix #14157 (#15877)
* fix #14157

* Update compiler/jsgen.nim

* add changelog

* Update compiler/jsgen.nim

* Update tests/js/tmodify_cstring.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-11-12 09:20:10 +01:00
flywind
fde17b159f follow #15818 and close #7109 (#15823)
* follow #15818 and close #7109

* Update compiler/jsgen.nim

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
2020-11-02 18:27:39 +01:00
flywind
544cb107c7 fix #8821 (#15809) 2020-11-02 10:41:44 +01:00
flywind
80b0748d75 fix #15651 (#15800)
* fix

* minor
2020-10-31 12:06:13 +01:00