Commit Graph

492 Commits

Author SHA1 Message Date
Clyybber
7c64e49d45 getCustomPragmaVal priority/override fixes (#17725)
* Adhere left-to-right rule for custom pragma priority

* Improve error message for no custom pragmas

* custom pragmas on var/let sym take priority over its type ones

* Workaround & bug
2021-04-21 15:28:42 +02:00
flywind
dc89b21257 [std/locks]close #7998(complete condition variables) (#17711)
* close #7998
* workaround genode

* Update lib/system/syslocks.nim
2021-04-19 10:51:13 +02:00
flywind
cedbc7035d [std/locks]remove workaround for withLock (#17772)
Ref #6113 and #6049

The workaround for generics instantiation is unnecessary. It seems to be fixed by another PR I guess.

The test still works. So the changes should be harmless.
https://github.com/nim-lang/Nim/blob/devel/tests/stdlib/tlocks.nim

I also add some inline pragmas.
2021-04-19 10:33:56 +02:00
flywind
172a5ab7f8 [std/rlocks]add inline pragma (#17773)
so that it can be used as the base of new locks module with destructors.
2021-04-19 07:41:50 +02:00
flywind
5c5f356347 replace defer with try ... finally (#17753) 2021-04-17 11:48:22 +02:00
Timothee Cour
7e94420847 cString => cSourceString; tyCString => tyCstring so that error msgs show cstring, not cString (#17744) 2021-04-17 11:14:09 +02:00
Clyybber
51a40c1f38 Fix getCustomPragmaVal for some multi arg pragmas (#17723)
* Fix getCustomPragmaVal for some multi arg pragmas

* Bootstrap fix
2021-04-15 13:55:50 +02:00
Arne Döring
56c37759d6 getCustomPragma is split up in more usable chunks (#11526)
* getCustomPragma is split up in more usable chunks
* changelog entry
* fix for style checks
* shitty typedesc special casing
* Add since annotation and remove typedesc comments
* Fix typo
* Revert since annotation because it breaks bootstrapping
* Export getCustomPragmaNode conditionally
* Reduce code duplication
* Update since
* Update lib/core/macros.nim
* Apply suggestions from code review

Co-authored-by: Clyybber <darkmine956@gmail.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-04-14 20:42:09 +02:00
Araq
e710b9cf33 macrocache.nim: removed trailing whitespace 2021-04-11 20:14:44 +02:00
konsumlamm
6ec55ebf48 Fix rst typo (#17671) 2021-04-08 20:29:11 +02:00
flywind
c7b4639460 ref #14873 (#17644)
* ref #14873

* comment

* Update lib/core/locks.nim
2021-04-06 16:21:58 +02:00
konsumlamm
b9c94f22aa Improve the typeinfo module (#17625)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-04-05 00:42:18 -07:00
Timothee Cour
9abd383a2a new genAst as replacement for quote do (#17426)
* new `macros.genAst`: fixes all issues with `quote do`
* add changelog entry
* add workaround for https://github.com/nim-lang/Nim/issues/2465#issuecomment-511076669
* add test for #9607
* add kNoExposeLocalInjects option
* add test case for nested application of genAst
* genAst: automatically call newLit when needed
* allow skipping `{}`: genAst: foo
* add test that shows this fixes #11986
* add examples showing mixin; add examples showing passing types, macros, templates
* move to std/genasts
* improve docs
2021-04-02 13:11:03 +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
Timothee Cour
a65189a739 nnkArglist => nnkArgList + special case stylecheck:error (#17529)
* nnkArglist => nnkArgList

* special case stylecheck:error
2021-03-27 10:28:11 +01:00
Timothee Cour
c27cd83265 remove {.compileTime.} for procs with NimNode: redundant because of tfTriggersCompileTime (#17463) 2021-03-23 02:51:21 -07:00
Timothee Cour
d78ebe4a0e fix #17454 (#17461) 2021-03-23 08:33:09 +01:00
Danil Yarantsev
c5b109233a Add documentation to the macrocache module (#17431)
* Add docs to macrocache

* use hint

* Use incl in the incl example

* add macrocache to lib

* consistency

* Update doc/lib.rst

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

* apply suggestions

* clarify the warning

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2021-03-21 10:34:10 +01:00
quantimnot
b2b23d723a Fix macros.quote custom op symbol interpolation. (#17256)
Provides a workaround/fix for #7589.
https://github.com/nim-lang/Nim/issues/7589

Updated docs and tutorial to reflect change.

Updated runnableExamples to include an example.

Co-authored-by: name <name@example.com>
2021-03-05 14:41:33 +01:00
Danil Yarantsev
82d8e9bff3 Replace double backticks with single backticks - Part 2 out of ~6 (#17206) 2021-02-28 23:15:26 -08:00
Danil Yarantsev
56461c280f Change stdlib imports to use std prefix in most examples (#17202) 2021-02-28 13:17:19 -08:00
flywind
9450bf6c08 use single backtick (#17100) 2021-02-18 22:47:21 -08:00
Timothee Cour
b9994925f5 remove all uses of condsyms symbols defined prior to bootstrap nim 0.20.0 (#16918)
* nimNoArrayToCstringConversion deadcode
* nimbabel deadcode
* nimHasalignOf deadcode
* nimvarargstyped deadcode
* nimhygiene deadcode
* nimNewTypedesc deadcode
* nimlocks deadcode
* nimHasCppDefine deadcode
* nimHasRunnableExamples deadcode
* nimHasNilChecks deadcode
* nimSymKind deadcode
* minor macros refactoring
* nimVmEqIdent deadcode
* nimNoNil deadcode
* nimNoZeroTerminator deadcode
* nimHasSymOwnerInMacro deadcode
* nimVmExportFixed deadcode
* nimNewRuntime deadcode
* nimAshr deadcode
* nimUncheckedArrayTyp deadcode
* nimHasTypeof deadcode
* nimErrorProcCanHaveBody deadcode
* nimHasHotCodeReloading deadcode
* nimHasSignatureHashInMacro deadcode
* nimHasDefault deadcode
* nimMacrosSizealignof deadcode
2021-02-17 09:32:36 +01:00
flywind
d447c0fe3f use typeof instead type (#16962) 2021-02-08 09:46:07 +01:00
flywind
4e1e231e29 fix floats slice (#16853)
* see whether it breaks

* fix

* fix

* minor

* fix

* add enum

* use Ordinal types

* fix tests

* fix

* another style

* fix remainning cases
2021-01-29 12:26:36 +01:00
flywind
b727217229 refactor cmpNimIdentifier (#16611)
* refactor cmpNimIdentifier

* Apply suggestions from code review

Co-authored-by: Clyybber <darkmine956@gmail.com>

Co-authored-by: Clyybber <darkmine956@gmail.com>
2021-01-13 12:29:30 +01:00
Timothee Cour
c21360e67a macros.quote: document hard to use op; add more useful examples (#16489)
* macros.quote: document hard to use `op`; add more useful examples

* add back doc comment removed in a60305fbf3

* address comment

* fixup

* clarify quoting rules

* Update lib/core/macros.nim

Co-authored-by: Clyybber <darkmine956@gmail.com>

Co-authored-by: Clyybber <darkmine956@gmail.com>
2021-01-06 19:28:17 +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
flywind
78acf1becb fix cmpIgnoreStyle bug (#16392) 2020-12-18 16:29:36 +01:00
Aditya Siram
23447ffdce Fixes #16219, hasArgOfName ignoring argument sets. (#16233)
* Fixes #16219, `hasArgOfName` ignoring argument sets.

* Fix test and simplify ident traversal.

* Moved test into a block and removed some boilerplate.

* Fix some argument formatting.

* use ..<

* Change the preceding line too

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-12-03 13:40:28 +01:00
flywind
e4d0f9f3de typeinfo minor improvement (#16083)
* typeinfo minor improvement

* minor

* Update lib/core/typeinfo.nim

* rename typeinfo
2020-11-23 22:56:30 +01:00
flywind
6cf5ca1dc2 alternative way to fix #16022 (#16064) [backport:1.4]
* alternative way to fix #16022
* add testcase for #16022

[backport:1.4]
2020-11-20 09:06:18 +01:00
Andreas Rumpf
fc735e4b08 fix #15934 and #15620 (#15938) [backport:1.4]
* make workaround for #15934 and #15620
* add testcase for #9754
2020-11-15 18:12:53 +01:00
flywind
0f53b129b7 nil 2020-11-13 15:28:22 +08:00
flywind
077eba7b38 make workaround for #15934 and #15620 2020-11-12 23:24:45 +08:00
Miran
bbe49a14ae Correct all eggs (#15906)
* "eg" is a misspelled "egg", "e.g." is "exempli gratia"
* Also, "ie" is "i.e.".
2020-11-10 21:53:25 +01:00
cooldome
0956a99537 ARC now capable of custom extra alignment. Ref, closure and seq support. (#15697) 2020-10-28 14:00:49 +01:00
shirleyquirk
4ef255b69d fix rlock compilation failure (#15584)
* change SysLockType_Reentrant

fix edge case where using SysLockType_Reentrant doesn't trigger an #include pthread.h

* syslocktype_reentrant now a var
* remove nodecl to remove empty system_syslocks.c
* let is better than var.

in reality SysLockType = enum, maybe that would be a better fix
2020-10-15 12:54:01 +02:00
Andreas Rumpf
8b66412a8b fixes #9754 [backport] (#15342) 2020-09-16 19:41:14 +02:00
Andreas Rumpf
fd31e8ff6f allow old styled RTTI for arc/orc (#15331) 2020-09-16 14:57:01 +02:00
Timothee Cour
169ca37d26 enable,document,test getImplTransformed, very useful for understanding how nim transforms code (#14924)
* enable,document,test getImplTransformed, very useful for understanding how nim transforms code
2020-07-18 10:49:36 +02:00
Juan Carlos
9465b5db44 Clean up macros (#14959) 2020-07-14 16:44:56 +02:00
Timothee Cour
2867a33ebc fix #14846; add macros.extractDocCommentsAndRunnables (#14849)
* fix #14846; add macros.extractDocCommentsAndRunnables

* fixup

* update tests

* address comment
2020-07-01 09:26:23 +02:00
Andreas Rumpf
da29222f86 init checks and 'out' parameters (#14521)
* I don't care about observable stores
* enforce explicit initializations
* cleaner code for the stdlib
* stdlib: use explicit initializations
* make tests green
* algorithm.nim: set result explicitly
* remove out parameters and bring the PR into a mergable state
* updated the changelog
2020-06-23 10:53:57 +02:00
Timothee Cour
9c42ae91b7 add legacy workaround; improve test so that it actually tests for the bugfix 2020-06-19 09:53:06 +02:00
solo989
408518c9fe Update tuple newLit 2020-06-19 09:53:06 +02:00
Miran
e7f280bd26 Remove deprecated stuff from stdlib (#14699)
* update to the latest Jester

* remove deprecated procs from some stdlib modules

* 'criterion' is not maintained anymore and relies on obsolete stuff
2020-06-17 15:25:02 +02:00
Timothee Cour
8619534293 remove compilerproc from newIdentNode (#14692) 2020-06-17 08:10:34 +02:00
solo989
bdd2c25e9f Update macros.nim (#14697) 2020-06-17 07:57:04 +02:00
Timothee Cour
dfe51d10a1 addQuitProc now works with closures, and c, js(node/browser) backend; fix some bugs in testament (#14342)
* make addQuitProc great again

* fix bugs in testament

* fix test

* change 2016 => 2020

* addQuitProc => addExitProc + locks

* move to std/exitprocs
2020-06-16 11:43:48 +02:00