Commit Graph

528 Commits

Author SHA1 Message Date
ringabout
1dab8ba334 move threads out of system (#20674)
* move syslocks first

* progress

* clean up

* go on

* clean up

* clean up

* add imports syslocks

* remove documentation

* public deallocOsPages

* fixes genode

* fixes more

* fixes boehmGC

* cover more cases

* fixes cyclic deps

* fixes genode

* cleanup

* unpublic fields

* cleanup

* clean up
2022-10-29 18:11:40 +02:00
Andreas Rumpf
81087c949f fixes #20572 (#20585)
* fixes #20572

* added a test case
2022-10-17 23:48:51 +02:00
ringabout
5602183234 'lock levels' are deprecated, now a noop (#20539)
* 'lock levels' are deprecated, now a noop

* fixes tests
2022-10-11 09:17:09 +02:00
Andreas Rumpf
e83f27e6a0 out parameters: enforce that 'out' is only used as a parameter (#20510)
* out parameters: enforce that 'out' is only used as a parameter

* make tables.nim use 'out' parameters

* better backwards compat
2022-10-07 22:26:53 +02:00
metagn
919a889ba8 moderate system cleanup & refactor (#20355)
* system refactor, move out 600 lines

* compilation, slice, backwardsindex, misc_num moved out of system
* some procs/types moved into arithmetics, basic_types
* system no longer depends on syncio
* some procs moved around to fit with their surroundings

* make exceptions an import, old ops to misc_num

* move instantiationInfo back

* move back nim version, fix windows echo

* include compilation

* better docs for imported modules, fix unsigned ops

also remove ze, ze64, toU8, toU16, toU32 with nimPreviewSlimSystem

* fix terminal

* workaround IC test & weird csize bug, changelog

* move NimMajor etc back to compilation, rebase for CI

* try ic fix

* form single `indices`, slim out TaintedString, try fix IC

* fix CI, update changelog, addQuitProc

* fix CI

* try fix CI

* actually fix CI finally hopefully

* Update lib/system/compilation.nim

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>

* update kochdocs

* hopefully fix csize uses for slimsystem

* fix tquit

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
2022-09-28 15:28:45 -04:00
metagn
de4b0346bd store full definition AST for consts, fix noRewrite (#20115)
* continue #9582 for consts, close #9331, fix #20114

also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc

* changelog correctly

* fix jsgen

* update tgetimpl

* fix sighashes

* fix #19766, add comment about postfix

* fix noRewrite LOL

refs #16620

* fix changelog

* fix destructors
2022-09-28 15:05:01 +02:00
ringabout
3d2f0e2c7c make more standard libraries work with nimPreviewSlimSystem (#20343)
* make more standard libraries work with `nimPreviewSlimSystem`

* typo

* part two

* Delete specutils.nim

* fixes more tests

* more fixes

* fixes tests

* fixes three more tests

* add formatfloat import

* fix

* last
2022-09-27 20:06:23 +02:00
ringabout
d44b547144 add docs to copyNimNode and copyNimTree (#20357)
* add docs to copyNimNode and copyNimTree

* Apply suggestions from code review

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
2022-09-16 00:35:44 -04:00
ringabout
b2c5f6f3c8 give a deprecate warning when using newPar to construct tuple expressions (#20312)
* error/deprecate when using `newPar` to construct tuple expressions

* Update lib/core/macros.nim

* fixes
2022-09-06 21:38:08 +02:00
Andrey Makarov
cde6b2aab8 Implement Pandoc Markdown concise link extension (#20304)
* Implement Pandoc Markdown concise link extension

This implements https://github.com/nim-lang/Nim/issues/20127.
Besides reference to headings we also support doing references
to Nim symbols inside Nim modules.

Markdown:
```
Some heading
------------

Ref. [Some heading].
```

Nim:
```
proc someFunction*() ...

... ## Ref. [someFunction]
```

This is substitution for RST syntax like `` `target`_ ``.
All 3 syntax variants of extension from Pandoc Markdown are supported:
`[target]`, `[target][]`, `[description][target]`.

This PR also fixes clashes in existing files, particularly
conflicts with RST footnote feature, which does not work with
this PR (but there is a plan to adopt a popular [Markdown footnote
extension](https://pandoc.org/MANUAL.html#footnotes) to make footnotes work).

Also the PR fixes a bug that Markdown links did not work when `[...]`
section had a line break.

The implementation is straightforward since link resolution did not
change w.r.t. RST implementation, it's almost only about new syntax
addition. The only essential difference is a possibility to add a custom
link description: form `[description][target]` which does not have an
RST equivalent.

* fix nim 1.0 gotcha
2022-09-04 14:52:21 -04:00
Andrey Makarov
0f555110e6 Markdown code blocks part 6 (#20292) 2022-08-31 19:39:02 -04:00
ringabout
b6bfe38ff5 move formatfloat out of system (#20195)
* move formatfloat out of system

* fixes doc

* Update changelog.md

* careless

* fixes

* deprecate system/formatfloat

* better handling
2022-08-24 13:38:30 +02:00
metagn
685bf944aa fix #20067, fix #18976 [backport] (#20069) 2022-07-22 15:04:07 +08:00
ehmry
82680a12a7 macros: make hasCustomPragma more permissive (#19747)
Make hasCustomPragma return false rather than fail for invalid
parameters.
2022-04-25 22:16:11 +02:00
flywind
0978276ed9 use two spaces indentation (#19696) 2022-04-07 13:07:39 +08:00
flywind
c3f03cfa5d add somes links to docs (#19668) 2022-04-01 13:30:02 -04:00
flywind
7f6e800caf move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
Tanguy
ef3f343ec2 Allow std/macros.params to work with nnkProcTy (#19563)
* Allow std/macros.params to work with nnkProcTy

* Add tests for proc params & pragma
2022-02-25 12:57:58 +01:00
Regis Caillaud
486cb09ec2 Clonkk fix2 11923 (#19451)
* fix nnkBracketExpr not compiling for getImpl on customPragmaNode

* fix test import

* fix alias not working with hasCustomPragmas
2022-02-02 09:44:51 +01:00
Regis Caillaud
1563cb2f6e Fix #11923 (#19427)
* Apply commit 5da931fe81 that was never merged (was part of a bigger PR). Should fix issue #11932

* add a generic object for custom pragma
2022-01-20 20:50:36 +01:00
Hamid Bluri
5d303762f1 update deprecated example (#19415)
`toNimIdent` proc is deprecated, so I replaced it with `ident` proc
2022-01-18 15:55:39 -05:00
Jake Leahy
4da7dbffc5 Extract runnables that specify doccmd (#19275) [backport:1.6] 2021-12-20 17:29:03 +01:00
hlaaftana
c7c6b13a32 parseExpr/parseStmt accept filename, fixes #13540 (#19182) 2021-11-24 12:22:40 +01:00
hlaaftana
5933aece9b caseStmtMacros no longer experimental, experimental manual refactor (#19173)
* `caseStmtMacros` no longer experimental, experimental manual refactor

* Update doc/manual.rst

* apply review suggestions

* apply review

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-11-23 16:30:17 +01:00
Don-Duong Quach
f2f15e9726 fix for #19020, credit to @ElegantBeef (#19021) 2021-11-03 16:47:31 +01:00
Aditya Siram
e3b19cbe52 fixes #18878 (#18883) 2021-09-25 14:17:41 +02:00
Dankr4d
c70e4040bd fixes #14511 [backport:1.4] (#18732)
* fixes #14511 [backport:1.4]

Signed-off-by: Dankr4d <dude569@freenet.de>

* Replaced fix with code from alaviss, for better readability, with small
changes.

Signed-off-by: Dankr4d <dude569@freenet.de>

* - Specified output in test.

Signed-off-by: Dankr4d <dude569@freenet.de>

* Replaced case in nnkRecCase with a simpler version, which just adds the
last son.

Signed-off-by: Dankr4d <dude569@freenet.de>

* Update tests/macros/t14511.nim

* Update tests/macros/t14511.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-08-25 17:27:00 +00:00
flywind
061a9183f7 replace wrt with proper word (#18724)
* what does wrt mean?

* clarify
2021-08-22 06:21:53 +02:00
Andreas Rumpf
4920b06973 fixes #18543 (#18601)
* fixes #18543

* make tests green again
2021-07-27 19:04:55 +02:00
Antonis Geralis
48ef832cf3 sync with the same template from locks module (#18414) 2021-07-10 08:41:07 +02:00
Timothee Cour
5600a62229 strformat.fmt now supports non-literal const strings (#18274)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-06-18 08:57:51 -07:00
flywind
5bad022d58 alternative to #18185 (#18206) 2021-06-07 15:32:37 +02:00
Timothee Cour
3cc547f2df macros.treeRepr + friends: collapse SymChoice (#18072)
* macros.treeRepr + friends: collapse SymChoice

* make repr+friends work with invalid symchoice nodes

* address comment
2021-06-05 06:58:26 +02:00
Timothee Cour
18b4774311 document macros.unpackVarargs (#18106)
* deprecate macros.unpackVarargs

* un-deprecate unpackVarargs and add docs+runnableExamples

* update examples + tests with varargs[typed]
2021-05-31 10:51:20 +02:00
Andreas Rumpf
4857c462d5 Revert "fix #14873 properly by skipping abi field in importc type (#17944)" (#17992)
This reverts commit 98c29c01eb.
2021-05-15 06:50:39 +02:00
Timothee Cour
98c29c01eb fix #14873 properly by skipping abi field in importc type (#17944)
* fix #14873 properly by skipping `abi` field in importc type

* add test

* fix test for windows
2021-05-07 19:36:41 +02:00
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