summary refs log tree commit diff stats
path: root/compiler/pragmas.nim
Commit message (Collapse)AuthorAgeFilesLines
* refactorings to prepare the compiler for IC (#15935)Andreas Rumpf2020-12-171-1/+3
| | | | | | | | | | | | | | * added ic specific Nim code; WIP * make the symbol import mechanism lazy; WIP * ensure that modules can be imported multiple times * ambiguity checking * handle converters and TR macros properly * make 'enum' test category green again * special logic for semi-pure enums * makes nimsuggest tests green again * fixes nimdata * makes nimpy green again * makes more important packages work
* cmdline: improve command processing (#16056)Timothee Cour2020-11-261-1/+1
|
* fix #12558 (#15864)flywind2020-11-091-1/+5
| | | | * fix #12558 * Update compiler/pragmas.nim
* EnumUtils, speed up findStr in compiler (#15777)cooldome2020-11-031-1/+1
| | | | | | | | * add parseEnumRange * fix runnable example * update changelog * use parseEnumRange in compiler * reorganise code * add changelog, make single normalizer argument
* Use modern enums in compiler (#15775)cooldome2020-11-021-7/+7
|
* closes #7658 (#15784)flywind2020-10-301-3/+6
| | | | | * fix #7658 * more
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-4/+4
| | | | | | | | | | | | | | | | | * refactoring: idents don't need inheritance * refactoring: adding an IdGenerator (part 1) * refactoring: adding an IdGenerator (part 2) * refactoring: adding an IdGenerator (part 3) * refactoring: adding an IdGenerator (part 4) * refactoring: adding an IdGenerator (part 5) * refactoring: adding an IdGenerator (part 5) * IdGenerator must be a ref type; hello world works again * make bootstrapping work again * progress: add back the 'exactReplica' ideas * added back the missing exactReplica hacks * make tcompilerapi work again * make important packages green * attempt to fix the build for 32 bit machines (probably need a better solution here)
* implements https://github.com/nim-lang/RFCs/issues/260 (#15505)Andreas Rumpf2020-10-071-10/+20
| | | | | * implements https://github.com/nim-lang/RFCs/issues/260 * added a test case
* implements https://github.com/nim-lang/RFCs/issues/258 (#15503)Andreas Rumpf2020-10-061-0/+9
| | | | | | | | | * implements https://github.com/nim-lang/RFCs/issues/258 * don't be too strict with custom pragma blocks * cast pragmas: documentation * added most missing inference query procs to effecttraits.nim
* fixes #15430, pop pragma takes invalid input (#15449)shirleyquirk2020-10-011-1/+3
| | | | | * fix #15430, pop pragma {.pop, experimental.} should be allowed, but not {.pop experimental.}
* .noalias annotation; frontend support (#15419)Andreas Rumpf2020-09-281-2/+6
| | | | | * .noalias annotation; frontend support * added .noalias support to Nim; implements https://github.com/nim-lang/RFCs/issues/204
* Expand hoisted default params in sem (#15270)Clyybber2020-09-051-3/+3
| | | | | | | | | * Expand hoisted default params in sem Introduce ast.newTree{I,IT} Add test for default params in procs * Cleanup * Simplify hoist transformation and expand test
* Big compiler Cleanup (#14777)Clyybber2020-08-281-3/+3
|
* Use typeflag insteadClyybber2020-08-101-2/+4
|
* Make explicit {.nimcall.} a seperate calling conventionClyybber2020-08-081-3/+3
|
* fixes #14458 [backport:1.2] (#14756)Andreas Rumpf2020-06-221-1/+1
|
* `nim doc --backend:js`, `nim doc --doccmd:-d:foo`, `nim r --backend:js`, ↵Timothee Cour2020-05-111-4/+4
| | | | | | | | | | `--doccmd:skip` + other improvements (#14278) * `nim doc --backend:js|cpp...` `nim doc --doccmd:'-d:foo --threads:on'` `nim r --backend:cpp...` (implies --run --usenimcache) * --usenimcache works with all targets * --docCmd:skip now skips compiling snippets; 50X speedup for doc/manual.rst
* CT sizeof(+friends) for {.importc, completeStruct.} types, enable ABI static ↵Timothee Cour2020-04-231-1/+5
| | | | | | | | | | | checks (#13926) * -d:checkabi obsolete (ABI check now enforced); add `addTypeHeader` helper * cleanups * import sizeof at CT for {.completeType.} * address comments; revert default enabling of -d:checkAbi for now * mimportc_size_check.nim => msizeof5.nim; merge mabi_check.nim into msizeof5.nim; refactor * all pragmas in errmsgs should be written: '.importc' (un-ambiguous and less verbose than {.importc.})
* remove the nilChecks switch; refs #11570Araq2020-04-201-1/+0
|
* drnim: tiny progress (#13882)Andreas Rumpf2020-04-151-1/+1
| | | | | | | | | | | * drnim: tiny progress * refactoring complete * drnim: prove .ensures annotations * Moved code around to avoid code duplication * drnim: first implementation of the 'old' property * drnim: be precise about the assignment statement * first implementation of --assumeUnique * progress on forall/exists handling
* finally de-deprecate the .define and .undef pragmasAndreas Rumpf2020-04-041-2/+0
|
* new feature: ability to turn specific warnings to errorsAndreas Rumpf2020-04-041-19/+16
|
* added an .assert pragma and mentioned the pragmas in the changelogAraq2020-04-021-1/+1
|
* The raises list can now use expressions referencing the generic paramsZahary Karadjov2020-04-011-4/+7
|
* Replace tfHasRequiresInit with a more accurate mechanismZahary Karadjov2020-04-011-1/+1
| | | | | | | | | 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).
* More sophistication; Allow requiresInit to be specified per-fieldZahary Karadjov2020-04-011-3/+7
|
* First steps, the compiler can boot with enforced requiresInitZahary Karadjov2020-04-011-1/+1
|
* DrNim (Nim compiler with Z3 integration) (#13743)Andreas Rumpf2020-03-311-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | * code cleanups and feature additions * added basic test and koch/CI integration * make it build on Unix * DrNim: now buildable on Unix, only takes 10 minutes, enjoy * added basic documentation for DrNim which can also be seen as the RFC we're following * drnim: change the build setup so that drnim.exe ends up in bin/ * makes simple floating point ranges work * added basic float range check * drnim: teach Z3 about Nim's range types plus code refactoring * drnim: make unsigned numbers work * added and fixed index checking under setLen * first implementation of .ensures, .invariant and .assume (.requires still missing and so is proc type compatibility checking * drnim: .requires checking implemented * drnim: implemented .ensures properly * more impressive test involving min() * drnim: check for proc type compatibility and base method compatibility wrt .requires and .ensures * testament: support for 'pattern <directory> * koch: uses new <directory> feature of testament * drnim: added tiny musings about 'old' * Make testament work with old SSL versions * koch: add support for 'koch drnim -d:release' * drnim: preparations for the param.old notation
* '.push raises: []' now also affects proc types (#13776)Andreas Rumpf2020-03-291-3/+3
| | | | | | | | | * '.push raises: []' now also affects proc types * fixes the regression * less disruptive bugfix * another attempt
* new feature: --staticBoundChecks:on to enforce static array index checking ↵Andreas Rumpf2020-03-181-2/+5
| | | | (#10965)
* sink parameter inference for types that have destructors (#13544)Andreas Rumpf2020-03-041-2/+6
| | | | | | | | | | | | | | * ensure capitalize doesn't take an inferred sink parameter * sink parameter inference: first version, for now disabled. Changed that sink parameters can be consumed multiple times in order to adhere to our spec. * sink inference can now be disabled with .nosinks; sometimes for proc type interop this is required * fixes yet another critical DFA bug * better implementation that also understands if expressions etc * document sink parameter inference and allow for global disabling
* properly handle note override logic/verbosity/config/cmdline using ↵Timothee Cour2020-02-271-0/+1
| | | | modifiedyNotes, cmdlineNotes
* make goto based exceptions available for 'nim cpp' (#13244)Andreas Rumpf2020-01-251-2/+2
| | | | | * make goto based exceptions available for 'nim cpp' * optimize seq.add to be comparable to C++'s emplace_back
* make case-object transitions explicit, make unknownLineInfo a const, replace ↵Jasper Jenkins2020-01-171-1/+1
| | | | a few magic numbers with consts (#13170)
* fixes #13122 (#13126)Andreas Rumpf2020-01-131-4/+2
| | | | | | * fixes #13122 * moved tests to where they belong
* VM: support importc var, ptr/pointer types, cast int <=> ptr/pointer (#12877)Timothee Cour2020-01-051-0/+2
| | | | | | | | | | | | | | * VM: allow certain hardcoded special var variables at CT * VM: allow all importc var, cast[int](ptr) * fix tests tests/vm/tstaticprintseq.nim, tests/cpp/t8241.nim * VM: == works for ptr/pointer nodes * bugfix: ==, cast now also works for pointer, not just ptr * VM supports cast PtrLikeKinds <=> PtrLikeKinds / int * improve cname handling * fixup + bug fix * VM: support cast from ref to int * address comment: opcLdGlobalDeref => opcLdGlobalDerefFFI * defensive check against typ == nil
* fix #12985 {.push.} now does not apply to generic instantiations (#12986)Timothee Cour2020-01-021-1/+1
|
* --exception:goto switch for deterministic exception handling (#12977)Andreas Rumpf2020-01-011-1/+1
| | | | | This implements "deterministic" exception handling for Nim based on goto instead of setjmp. This means raising an exception is much cheaper than in C++'s table based implementations. Supports hard realtime systems. Default for --gc:arc and the C target because it's generally a good idea and arc is all about deterministic behavior. Note: This implies that fatal runtime traps are not catchable anymore! This needs to be documented.
* ARC: cycle detector (#12823)Andreas Rumpf2019-12-171-1/+1
| | | | | | | | | | | | | * first implementation of the =trace and =dispose hooks for the cycle collector * a cycle collector for ARC: progress * manual: the .acyclic pragma is a thing once again * gcbench: adaptations for --gc:arc * enable valgrind tests for the strutils tests * testament: better valgrind support * ARC refactoring: growable jumpstacks * ARC cycle detector: non-recursive algorithm * moved and renamed core/ files back to system/ * refactoring: --gc:arc vs --gc:orc since 'orc' is even more experimental and we want to ship --gc:arc soonish
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-61/+61
| | | | | | | | | | | | | | | | | | * 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
* implemented a new localPassc pragma (#12706)Andreas Rumpf2019-11-221-1/+6
|
* fixes and changes the recently introduced 'alignas' to be 'align' (#12666)Andreas Rumpf2019-11-151-2/+2
| | | | | | * fixes and changes the recently introduced 'alignas' to be 'align' * more improvements
* implemented alignas pragma (#12643)Arne Döring2019-11-131-8/+9
| | | | | | | | | | | | * implemented alignas pragma * fix bootstrap * generate c++ compatible syntax for alignas * Make it work. * Multiple alignof expressions. Implement top level alignof.
* .cursor implementation (#12637)Andreas Rumpf2019-11-121-2/+5
| | | | | | | | | | | * cursors: first implementation * added currently failing test * .cursor works for doubly linked lists * make -d:useMalloc work again * added code to nil out refs in a destructor * it's now called --gc:arc * renderer.nim: render nkBreakState properly * make simple closure iterators work without leaking
* fixes #5050; fixes #11826 (#12606) [backport]cooldome2019-11-071-12/+2
|
* pragmas.nim: tiny code formattingAndreas Rumpf2019-11-071-2/+1
|
* remove unused importsnarimiran2019-11-061-1/+1
|
* Fixes semCustomPragma when nkSym (#12414) [backport]Alexander Ivanov2019-10-111-1/+1
|
* Refactor injectdestructors (#12295)Clyybber2019-10-011-6/+1
| | | One improvement over #devel is visible in the transformation of getEnv. With this approach we move to result whenever possible.
* cleanup importjs implementationAndreas Rumpf2019-09-211-12/+5
|