Commit Graph

259 Commits

Author SHA1 Message Date
Andreas Rumpf
d584dd5b99 fixes #19015 [backport:1.6] (#19204) 2021-12-04 07:42:58 +01:00
Timothee Cour
3aa16c1de0 fix RFC #341: dot-like operators are now parsed with same precedence as . (#18711)
* fix RFC #341: dot-like operators are now parsed with same precedence as `.`

* fixup

* [skip ci] address comment in changelog

* address comment

* update grammmar

* add manual entry

* fixup

* -d:nimPreviewDotLikeOps

* address comment to unblock PR: move nimPreviewDotLikeOps out of config/config.nims
2021-08-25 06:50:40 +02:00
Timothee Cour
f2910077ac sigmatch: support optional params with last block arg(s) (#18631)
* sigmatch: support optional params with last block arg
* add tests
* works with multiple block args
* cleanup
* address comment
2021-08-20 10:13:03 +02:00
Timothee Cour
b24812df5f properly fix #10053 ; FieldDefect msg now shows discriminant value + lineinfo, in all backends (c,vm,js) (#11955)
* fix #10053 FieldError for vm

* fixup

* FieldError now also shows runtime value of discriminant

* fix field error reporting in vm

* also report culprit line info in err msg

* fix errors for newruntime 2

* fix for js

* fixup

* PRTEMP4

* works

* works

* works perfect

* refactor

* std/private/repr_impl

* suppport --gc:arc

* cleanup

* refactor

* simplify

* simplify

* simplify

* fixup

* move out compiler.vmgen.genCustom

* fixup

* fixup

* add tests

* revert compiler/debugutils.nim

* simplify reprDiscriminant

* fixup

* lib/std/private/repr_impl.nim -> lib/system/repr_impl.nim

* try to fix D20210812T165220

* honor --declaredlocs

* control toFileLineCol via --declaredlocs
2021-08-13 09:35:48 +02:00
Andreas Rumpf
0c4582c665 mitigates #12815 (#18557)
* mitigates #12815

* Update doc/nimc.rst

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

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2021-07-22 11:59:21 +02:00
Andreas Rumpf
58e27ebd4a fixes #12815 (#18554) 2021-07-22 09:37:41 +02:00
Andreas Rumpf
01fc9e58ca fixes #18550 (#18553)
* fixes #18550

* update the manual to reflect reality
2021-07-21 16:55:50 +02:00
Andreas Rumpf
70fb377e88 undo RFC #294, it breaks code for no good reason, the compiler can wa… (#18546)
* undo RFC #294, it breaks code for no good reason, the compiler can warn about the construct instead

* Update changelog.md

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

* enable test case

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2021-07-21 08:51:03 +02:00
Timothee Cour
0b7361e938 followup #18362: make UnusedImport work robustly (#18366)
* warnDuplicateModuleImport => hintDuplicateModuleImport
* improve DuplicateModuleImport msg, add test
2021-06-27 20:39:16 +02:00
Timothee Cour
7d5e6b0169 support --hint:all:off --hint:x (ditto with --warnings + friends) (#17852)
* select all hints via `--hint:all:on|off`, etc
* simplify code with setutils
* address comment
2021-06-20 19:52:22 +02:00
Timothee Cour
e1e8af535e merge BuildMode into SuccessX, remove code duplication w drnim, add useful info to successx, add gc to compilesettings (#18252)
* merge BuildMode into SuccessX, add more info

* refactor duplicated with drnim

* fixup

* address comment
2021-06-14 08:51:40 +02:00
Andreas Rumpf
06232b7f2e fixes #18058 (#18162) 2021-06-03 17:12:45 +02:00
Timothee Cour
a36efb59b5 fix #16256: nimout: <empty> should give error (vacuously true); improve a few tests (#18089)
* fix #16256: nimout: <empty> should give error (vacuously true); improve some tests

* renamed:    tests/stdlib/t9710.nim -> tests/misc/t9710.nim

* improve tests

* fix non-DRY tests

* improve $nim_prs_D/tests/stdlib/t9091.nim

* renamed:    tests/stdlib/t9091.nim -> tests/misc/t9091.nim

* fixup

* address comment: doAssert => result.parseErrors
2021-05-31 13:39:19 +02:00
Timothee Cour
0b2bbcaa23 fix #18077 testament now parses cmd properly (#18086) 2021-05-26 09:46:53 +02:00
Timothee Cour
8df55d0ad7 close #3482 no more cgen error with typed templates (#18094) 2021-05-26 09:44:00 +02:00
Timothee Cour
b59dc3b255 remove some custom logic in testament around flags, testExec (#18090)
* remove some custom logic in testament around flags, testExec

* remove testExec, custom logic around flags from testament

* fixup
2021-05-26 09:41:50 +02:00
Timothee Cour
1636c05d13 close #5540 generic object with generic field evaluated too early (#18062) 2021-05-23 01:02:04 -07:00
Timothee Cour
f68f28d157 make testament isSuccess more robust and allow tests with --hints:off to succeed (#17968)
* fix testament isSuccess

* show givenSpec in addResult

* simplify tstatictypes.nim
2021-05-11 06:54:52 +02:00
Timothee Cour
f07583588c close #9039: compiler does not hang anymore in 1 case involving static params and arrays (#17983) 2021-05-09 21:33:32 +02:00
Timothee Cour
4e0f38fbb1 testament :show duration also for failed tests; improve tshould_not_work; mitigate #17946 tchannels timeouts (#17947)
* refs #17946; refactor testament test summary, show test duration for failures; increase timeout tchannels

* revert workarounds from https://github.com/nim-lang/Nim/pull/16698 and add allowPrefixMatch optional param to greedyOrderedSubsetLines

* add test

* workaround for yet another testament bug
2021-05-08 17:13:47 +02:00
Timothee Cour
87229e272e fix #17853 (ascii message separator broke json nim dump) (#17887) 2021-04-29 02:25:08 -07:00
c-blake
601c050fcb Implement https://forum.nim-lang.org/t/7848#50018 (#17874)
* Implement https://forum.nim-lang.org/t/7848#50018 with just the same
`SuccessX` hint category, build mode on a separate, final line, and
no change to how the mode is spelled for -d:release/-d:danger.

* Change to add a new BuildMode hint category and keep testament in sync
as per comment.

* Add "--hint:buildmode:off" to `defaultHintsOff`.

* Remove as requested.

* As requested for tests clean up.

* Address code review.

* Address code review.

* Mirror db45642311
2021-04-29 08:55:43 +02:00
Timothee Cour
ffe4328b35 --usenimcache (implied by nim r main) now caches some compile options to avoid recompiling when project was previously compiled with such options. (#17829)
* `--usenimcache` (implied by `nim r main`) now caches some compile options
to avoid recompiling when project was previously compiled with such options.

* works
* add test
* changelog
* use std/with
2021-04-25 10:25:31 +02:00
Timothee Cour
e4a3feeb92 add --processing:dots|filenames|off to customize hintProcessing (#17817) 2021-04-23 08:07:22 +02:00
Andreas Rumpf
0b116310bf unit separator (#17730)
* use the ASCII Unit Separator so that error messages can be handled precisely by the tooling
* updated testament
2021-04-20 16:30:17 +02:00
Timothee Cour
ad67bcf379 fix https://github.com/nim-lang/RFCs/issues/311 remove unary slice (#16714) 2021-04-19 19:02:52 -07:00
Timothee Cour
fe77c3c72f megatest: allow duplicate file names, show compilation progress (#17713)
* megatest: allow duplicate file names

* megatest: show compilation progress
2021-04-13 23:16:19 +02:00
flywind
7bfb9f0002 close #17636 (#17643) 2021-04-06 16:20:01 +02:00
Timothee Cour
270964c487 implement RFCs/294 ; disallow enum <=> enum conversion (#16351)
* fix https://github.com/nim-lang/RFCs/issues/294 ; disallow enum <=> enum conversion
* fix the runnableExamples that was the instigator of this RFC
* legacy -d:nimLegacyConvEnumEnum
* use -d:nimLegacyConvEnumEnum in important_package nimgame2
* add test for enum cast
* improve changelog
* add changelog: Changes affecting backward compatibility
* cleanup changelog
* fix changelog
2021-04-03 07:15:21 +02:00
flywind
924ab3adea fix #17190 nimscript now accepts arbitrary file extensions for nim e main.customext (#17596)
* fix #17190

* cah

* merge

* Update tnimscriptwithnimext.nim

* Update tnimscriptwithmacro.nims

* Apply suggestions from code review

* Delete tnimscriptwithnimext.nim

* Update tests/tools/tnimscriptwithmacro.nims

* fix

* fix

* add a test

* Apply suggestions from code review

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* Apply suggestions from code review

* Update changelog.md

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-04-01 08:05:04 +02:00
Timothee Cour
b18307f940 fix #17572 (#17586) 2021-03-31 11:27:02 +02:00
Andreas Rumpf
cfff27529e added nkError to the AST (#17567)
* added nkError to the AST

* Update lib/core/macros.nim

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

* Update compiler/ast.nim

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

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2021-03-29 16:23:19 +02:00
konsumlamm
eca0b87544 Close #8545 by add a test case (#17432)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-03-20 18:30:57 -07:00
Timothee Cour
9d4d27a3ce adjust spellSuggestSecretSauce logic to avoid too many matches for small symbols (#17410) 2021-03-18 13:26:45 +01:00
Timothee Cour
48eab5370a fix #2844 #3911; add --spellsuggest to suggest symbols in scope with similar spellings on undefined symbol error (#16067)
* add --spellsuggest to suggest symbols in scope with similar spellings on undefined symbol errors
* implement --spellsuggest with 0 arguments
2021-03-16 10:41:30 +01:00
Timothee Cour
6f6370367b fix #16949 --app:staticlib works on openbsd; --app:staticlib tested in CI (#16950) 2021-02-08 09:47:05 +01:00
Timothee Cour
6f1289b80c remove .github/workflows/ci_ssl.yml; instead run via trunner_thirdparty (#16221) 2021-02-02 18:32:33 -08:00
Timothee Cour
e112974920 fix #16752: threadvar now works with importcpp types; osx now uses native TLS (--tlsEmulation:off), which can be orders of magnitude faster (#16750)
* osx now uses native TLS, which can be orders of magnitude faster

* add {.cppNonPod.}

* improve test

* changelog, docs, disable part of windows test
2021-01-27 22:35:43 +01:00
Timothee Cour
4fc7fcb775 --hintAsError (#16763)
* --hintAsError

* add test, changelog

* condsyms
2021-01-20 10:49:59 +01:00
flywind
335f849c36 close #9901 add testcase (#16662)
* close #9901 add testcase

* follow advice
2021-01-11 18:00:57 +00:00
Clyybber
a0134671ee Make test independent of repo location (#16571)
* Make test independent of repo location

* Fix differently
2021-01-03 19:15:56 +01:00
flywind
c71f5650c6 Revert "Make config processing order test more robust" (#16561)
This reverts commit cf714c129f.
2021-01-03 12:55:08 +08:00
Clyybber
cf714c129f Make config processing order test more robust 2021-01-02 21:47:26 +01:00
Timothee Cour
471aab86a0 fix #16526 run config.nims before foo.nim.cfg (#16557)
* fix #16526 run config.nims before foo.nim.cfg

* add test
2021-01-02 21:41:44 +01:00
flywind
73f778e441 follow #16505 move and active tests (#16508)
* fix printing negative zero in JS backend

* move tests
2020-12-30 15:06:50 +01:00
Timothee Cour
8508c4e1c2 fix hintProcessing dots interference with static:echo and hintCC; add tests for nim secret, add tests for hintProcessing, misc other bug fixes (#16495)
* fix dots interfering with static:echo
* add tests
* fix hintProcessing dots for hintCC
* improve trunner tests
* fix bug: readLineFromStdin now writes prompt to stdout, consistent with linenoise and rdstdin
* disable a failing test for windows
2020-12-30 14:58:41 +01:00
flywind
89a2390f8b fix printing negative zero in JS backend (#16505) 2020-12-29 15:50:22 +01:00
flywind
6d442a40a6 use doAssert in tests (#16486) 2020-12-28 14:13:21 +01:00
flywind
3f9a2ebea5 fix nim js cmp fails at CT (#16473) 2020-12-27 10:13:57 +01:00
Timothee Cour
c731f7ab14 fixes #15939, fixes #15464, fixes #16169, fixes #16226 VM now supports addr(mystring[ind]) (index + index assignment) (#15987)
* fix #15939, fix #15464 VM now supports `addr(mystring[ind])` (index + index assignment), var char return etc
* cleanups
* cstring tests
* add test for bug #15464
* improve test coverage
2020-12-03 16:55:43 +01:00