Commit Graph

297 Commits

Author SHA1 Message Date
Andreas Rumpf
71dd5f85b9 'isolate' builtin; refs https://github.com/nim-lang/RFCs/issues/244 (#15011) 2020-07-20 07:50:19 +02:00
Timothee Cour
faedb14a16 misc cleanups in compiler msgs: use toHumanStr, etc (#14677) 2020-06-15 21:17:24 -07:00
Timothee Cour
4301a3da9d * honor --errorMax even for tools (eg drnim, nim doc) (#14546)
* fix a bug that prevented nim doc compiler/nim on windows
2020-06-02 18:54:33 +02:00
Neelesh Chandola
4c08e64e98 disallow typedesc in arrays & move existing checks to types.typeAllowedAux (#13261)
* disallow typedesc in arrays and move previous checks to types.typeAllowedAux
2020-05-29 11:48:15 +02:00
Clyybber
1f1e4de3bc Make ./koch temp --gc:arc work (#14186) 2020-05-01 20:25:18 +02:00
cooldome
13fa338ada implement (#14114)
Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-25 19:59:56 +02:00
Zahary Karadjov
08afa03075 The raises list can now use expressions referencing the generic params 2020-04-01 19:38:44 +02:00
Zahary Karadjov
ce9a4ed124 Replace tfHasRequiresInit with a more accurate mechanism
The new mechanism can deal with more complex scenarios such as
not nil field appearing in a non-default case object branch or
a field within a generic object that may depend on a when branch.

The commit also plugs another hole: the user is no longer able
to create illegal default values through seq.setLen(N).
2020-04-01 19:38:44 +02:00
Zahary Karadjov
4f3d309fb0 Perform nil checks during object construction and within compiles()
Close https://github.com/nim-lang/Nim/issues/6494
2020-04-01 19:38:44 +02:00
Zahary Karadjov
8ae48292ff Plug another hole: default(T) forbidden for objects requiring initialization 2020-04-01 19:38:44 +02:00
Zahary Karadjov
05a0ec4adb Don't allow 'var x: T' for objects that require initialization 2020-04-01 19:38:44 +02:00
cooldome
c79df2fb6a EndsInNoReturn in expressions extension, fixes #13490 (#13520)
* fix #13490
2020-02-28 09:55:06 +00:00
cooldome
25dc5f76e0 fixes #12627 (#13521)
* fixes #12627
2020-02-28 09:54:17 +00:00
Jasper Jenkins
796aafe7e0 make case-object transitions explicit, make unknownLineInfo a const, replace a few magic numbers with consts (#13170) 2020-01-17 10:34:31 +01:00
Timothee Cour
3f78873898 remove all remaining warnings when build nim (with -d:nimHasLibFFI) (#13084)
* cleanup deprecations in evalffi + elsewhere

* remove dead code getOrdValue64
2020-01-09 13:19:18 +01:00
Clyybber
7e747d11c6 Cosmetic compiler cleanup (#12718)
* Cleanup compiler code base

* Unify add calls

* Unify len invocations

* Unify range operators

* Fix oversight

* Remove {.procvar.} pragma

* initCandidate -> newCandidate where reasonable

* Unify safeLen calls
2019-11-28 17:13:04 +01:00
Clyybber
ed1d41c51e Small ast.nim cleanup (#12156)
* Remove sonsLen
* Use Indexable
2019-09-09 11:54:15 +02:00
Andreas Rumpf
5f7a6aff06 fixes #11941 (#12079) 2019-08-29 00:35:05 +02:00
cooldome
c9f49cbc0a lift destructor for openarray (#12073)
* destroy for sink openarray
2019-08-28 12:07:46 +02:00
Andreas Rumpf
eaebbfa785 Fix several float range issues (supersedes #11905) (#12067)
* Fix several float range issues

* address the comments
2019-08-27 23:19:41 +02:00
Andreas Rumpf
114da04cbb fixes #12029; finish the 'unused import' feature (#12064) 2019-08-27 19:18:56 +02:00
narimiran
329e169e96 address the comments 2019-08-27 14:49:32 +02:00
Andreas Rumpf
81ddc67785 [refactoring] compiler: simplified markUsed 2019-08-08 22:43:58 +02:00
Andreas Rumpf
f58d87cb43 IC: some progress 2019-07-27 14:01:28 +02:00
Andrii Riabushenko
4c73139316 revert changes 2019-07-25 23:18:20 +01:00
Andrii Riabushenko
d7bc4e43a2 fixes #11826 2019-07-25 23:02:04 +01:00
Andreas Rumpf
fbb0642e27 Merge branch 'devel' into araq-detect-unused-imports 2019-07-18 18:16:32 +02:00
Andreas Rumpf
9852cf804b warn about unused imports; fixes an 'export' regression [nobackport] 2019-07-18 18:16:25 +02:00
Araq
07d465ca42 [refactoring] remove unused imports in the compiler and in some stdlib modules 2019-07-18 00:36:03 +02:00
Araq
4137a4dbf3 [feature] detect unused imports 2019-07-17 22:36:23 +02:00
Araq
9db369063c [refactoring] moves transformation for 'spawn' into its own spawn.nim implementation 2019-07-14 12:13:19 +02:00
Arne Döring
7d5d9f7703 introduce internal Int128 type, use it to fix case stmt checks (#11652)
* initial version of int128
* use int128 in case stmt
* fixes #11552
2019-07-05 22:45:32 +02:00
Arne Döring
5b27b263fd Remove immediate pragma (#11308)
* remove immediate from tests
* remove immediate from the compiler
2019-05-29 22:21:51 +02:00
Araq
9ecb1aae80 new compiler feature: --expandMacro 2019-05-29 20:47:28 +02:00
Arne Döring
f94ec363ab Allow void macro result (#11286)
* allow void macro result
* add test for void macro result type
2019-05-21 21:31:40 +02:00
Arne Döring
b92fd30282 rename tyExpr/tyStmt to tyUntyped/tyTyped (#11227) 2019-05-11 10:11:08 +02:00
Clyybber
f18b3af9d4 Replace countup(x, y-1) with x ..< y 2019-05-07 12:32:05 +02:00
Andreas Rumpf
bf592c4e94 more destructor based changes (#10885)
* mark user defined destructors with sfOverriden to simplify the logic
* refactoring in preparation to merge liftings and generic instantiations for destructors
* ast: introduce nkHiddenTryStmt for destructor generation in order to be able to optimize better the code later on
* renamed 'patterns' switch to 'trmacros' as it was totally misleading before
* destructors: introduce tfCheckedForDestructor flag in preparation of strict =destroy checking
* test for invalid/too late destructor introductions
* liftdestructors: make code robust for nimsuggest
* --newruntime works for hello world again
* newruntime: code generation for closures
2019-03-23 00:12:05 +01:00
alaviss
d72921ecf6 compiler/sem: correct macros lineinfo (#10438)
The compiler believes these are where a macro call starts (marked with
`^`):

    m "string"
    ^ ^

This commit addresses that.
2019-01-24 12:22:19 +01:00
Neelesh Chandola
e77dd683eb Fix defer not not-working at top level (#10191) 2019-01-07 00:51:17 +01:00
Araq
e874705971 fixes nested gensym'ed parameters; fixes #9476 2018-12-08 13:30:06 +01:00
cooldome
5b98afb8a8 Destructors: more moves for tuples (#9808) 2018-11-27 18:59:21 +01:00
Andreas Rumpf
6e8ed8c6fa added first version of a nimfind tool for the poor souls that don't have a good nimsuggest integretation 2018-11-14 16:04:54 +01:00
Andreas Rumpf
cb4d810659 make Nim take roughly 100MB less RAM for bootstrapping via a new compiler switch -d:leanCompiler; useful for the Raberry PI 2018-11-07 18:36:52 +01:00
cooldome
eaca5be9d6 Change the order of compilation passes, transformation is made lazy at code gen (#8489)
* Ast no transformation
* Add getImplNoTransform to the macros module
* progress on delaying transf
* Fix methods tranformation
* Fix lazy lambdalifting
* fix create thread wrapper
* transform for lambda lifting
* improve getImplTransformed
* Fix destructor tests
* try to fix nimprof for linux
2018-10-18 20:21:25 +02:00
xzfc
8fc7cecfa2 compiler: show name of instantiating context in error traces (#6763) (#9207) 2018-10-11 09:34:56 +02:00
LemonBoy
b97a7dbf3d Make the registered passes local to the ModuleGraph (#9259)
Closes #9068
2018-10-09 19:24:02 +02:00
Andreas Rumpf
9364369c1f make tests green again 2018-09-24 16:00:57 +02:00
Andreas Rumpf
84d122b5c8 extended system.type/typeof to support an upcoming 'collect' macro that works much better than sugar.lc 2018-09-11 19:02:05 +02:00
Andreas Rumpf
1948eadc24 change runnableExamples implementation; fixes #8641; fixes #7135; runnableExamples works for templates and generics 2018-09-02 22:56:26 +02:00