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
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
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
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
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
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
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
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
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
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
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
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
solo989
3cbf59336d
Update newLit set[T] to work when set is empty. ( #14662 )
...
* Update macros.nim
* Update lib/core/macros.nim
Co-authored-by: Clyybber <darkmine956@gmail.com >
Co-authored-by: Clyybber <darkmine956@gmail.com >
2020-06-15 09:15:17 +02:00
Timothee Cour
e30a08103d
remove tyOpt, mOpt ( #14636 )
...
* remove tyOpt, mOpt
* fixup
2020-06-12 11:03:52 +02:00
hlaaftana
fbc97e712a
move since from inclrtl to std/private/since ( #14188 )
...
* move since from inclrtl to std/private/since
* move since import in system below for HCR
2020-05-02 23:51:59 +02:00
cooldome
3b5a504692
parseEnum_regression ( #14150 )
...
Co-authored-by: cooldome <ariabushenko@bk.ru >
2020-04-28 19:56:50 +02:00
Jasper Jenkins
122751aa52
add nnkMacroDef to RoutineNodes ( #13676 )
2020-03-17 23:41:07 +01:00
Arne Döring
f95eef99a9
add expectIdent to macros ( #12778 )
...
* add expectIdent to macros
* apply feedback
* Update lib/core/macros.nim
Co-Authored-By: Clyybber <darkmine956@gmail.com >
* Update texpectIdent2.nim
* Update texpectIdent1.nim
Co-authored-by: Clyybber <darkmine956@gmail.com >
Co-authored-by: Andreas Rumpf <rumpf_a@web.de >
2020-03-11 08:27:31 +01:00
Arne Döring
eb42f38088
Remove dead magics ( #13551 )
2020-03-03 12:42:43 +01:00
hlaaftana
84e78b4ffc
Minor doc change in macros, future -> sugar ( #13475 ) [ci skip]
2020-02-24 09:57:15 +01:00
Clyybber
f6d45b40a5
expectLen now shows the length that we got ( #13387 )
2020-02-11 12:31:52 +01:00
b3liever
8bcc7e8b9e
basename supports pragmaexpr ( #13045 )
...
* basename supports pragmaexpr
* update changelog
2020-01-07 11:25:51 +01:00
Arne Döring
94675c2378
backtick and export marker handling in eqIdent ( #12574 )
2019-11-07 14:40:44 +01:00
Kaushal Modi
d914e9a65f
[backport] Add docs to better distinguish among getProjectPath, getCurrentDir and currentSourcePath ( #12565 )
...
Fixes https://github.com/nim-lang/Nim/issues/10477 .
2019-10-31 21:00:18 +01:00
zah
de5f6a07c2
Fix newLit for objects having string fields ( #12542 ) [backport]
2019-10-28 22:45:55 +01:00