Commit Graph

152 Commits

Author SHA1 Message Date
Timothee Cour
48eab5370a fix #2844 #3911; add --spellsuggest to suggest symbols in scope with similar spellings on undefined symbol error (#16067)
* add --spellsuggest to suggest symbols in scope with similar spellings on undefined symbol errors
* implement --spellsuggest with 0 arguments
2021-03-16 10:41:30 +01:00
flywind
e1cc3b83fb deprecate newruntime (#17245)
* deprecate newruntime
* tests
* Update compiler/commands.nim
2021-03-04 19:33:16 +01:00
Timothee Cour
a0daa7a76d fix #16731: using deprecated flags triggers a warning (#17225)
* using deprecated flags triggers a warning
* cleanups
* fixup
* address comments
2021-03-02 13:07:05 +01:00
Timothee Cour
6c5872c169 --nilseqs is now a deprecated noop (#17211)
* --nilseqs is now a deprecated noop

* fix tests; fix: future => sugar
2021-03-01 20:59:43 +01:00
Timothee Cour
b187caeb87 document since (#17048)
* document `since`
* address comment
2021-02-16 20:20:01 +01:00
Timothee Cour
4fc7fcb775 --hintAsError (#16763)
* --hintAsError

* add test, changelog

* condsyms
2021-01-20 10:49:59 +01:00
Juan Carlos
78a99587a4 Deprecate TaintedString (#15423)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
2021-01-15 18:56:38 -08:00
Timothee Cour
13b1b19a83 remove all mentions of doc2, jsondoc2 (except 1 mentioning the alias) (#15683) 2020-11-26 11:54:18 -08:00
Timothee Cour
ec6a1125a0 --declaredlocs => --declaredLocs (#15672) 2020-10-21 10:33:19 -07:00
Timothee Cour
05752cd5d0 add --declaredlocs (#15666) 2020-10-21 15:37:29 +02:00
Timothee Cour
94a4b57280 make patchFile more discoverable (#15659) 2020-10-20 20:21:10 +02:00
narimiran
5e9dd81baa more "eg" fixes 2020-10-20 10:51:50 +02:00
cooldome
531ed2dc36 fix #15405. deepcopy arc (#15410)
* fix #15405
* fix tests
* deepcopy for ARC has to be enabled via --deepcopy:on

Co-authored-by: Araq <rumpf_a@web.de>
2020-10-01 17:39:48 +02:00
Miran
2de6e18774 fix #11537, correct parse inline code without surrounding spaces (#15399) 2020-09-25 09:25:47 +02:00
Miran
fe3211fbcf fix the indentation in --help and --fullhelp (#15387)
* fix the indentation in `--help` and `--fullhelp`

* a better way to fix it
2020-09-23 12:44:41 +02:00
Andreas Rumpf
be78b35bb8 cleanup ARC documentation (#15100) 2020-07-28 11:34:44 +02:00
Andreas Rumpf
c5358b0d4b An optimizer for ARC (#14962)
* WIP: an optimizer for ARC
* do not optimize away destructors in 'finally' if unstructured control flow is involved
* optimized the optimizer
* minor code cleanup
* first steps to .cursor inference
* cursor inference: big steps to a working solution
* baby steps
* better .cursor inference
* new feature: expandArc for easy inspection of the AST after ARC transformations
* added topt_cursor test
* adapt tests
* cleanups, make tests green
* optimize common traversal patterns
* moved test case
* fixes .cursor inference so that npeg compiles once again
* cursor inference: more bugfixes

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-07-15 23:00:06 +02:00
Juan Carlos
6d10baa339 https://github.com/nim-lang/Nim/pull/14948#issuecomment-656498426 (#14958) 2020-07-11 06:21:59 -04:00
Ico Doornekamp
d7ccd82eac VM profiler (#14833)
* Crude VM profiler

* Added --profileVM flag, refactoring

* fixed FileLine hash

* Use TLineInfo instead of own FileLine, updated formatting

* Refactoring, moved PStackFrame to vmdefs for cleaner data structure

* Moved vmprofiler to separate file

* Simplified TLineInfo hash, use toFileLineCol for output

* Hash

* Moved profile data into Config, dump only once at end of run

* Changed profile output header to show '#instr' instead of 'count'

* Do not accumulate instrcount for non-top frames

Co-authored-by: Ico Doornekamp <git@zevv.nl>
2020-07-09 19:18:35 +02:00
Juan Carlos
74d1f25010 Clean out oldast (#14837)
* Clean out old Deprecated CLI switch
* Update to remove --oldast CLI option
2020-06-30 10:01:25 +02:00
Danil Yarantsev
7936768560 Fix some typos (#14843) 2020-06-28 19:17:18 +02:00
Juan Carlos
28510a9da9 Deprecated laxStrings for mutating the internal zero terminator on strings and its Deprecated code cleaned out (#14766)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-06-23 13:20:53 +02:00
Juan Carlos
c3459c7b14 Deprecate oldNewlines, clean out deprecated code from oldNewlines (#14763) 2020-06-23 11:22:07 +02:00
Andy Davidoff
4e3edf5836 add arc and orc to gc list (#14653) 2020-06-14 11:12:08 +02:00
Timothee Cour
9502e39b63 nim doc --backend:js, nim doc --doccmd:-d:foo, nim r --backend:js, --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
2020-05-11 12:01:18 +02:00
Araq
59f1462b95 remove the nilChecks switch; refs #11570 2020-04-20 14:44:54 +02:00
Andreas Rumpf
9c46927fad new feature: ability to turn specific warnings to errors 2020-04-04 22:56:03 +02:00
Timothee Cour
19cab9fa51 stacktraces can now show custom runtime msgs per frame (#13351)
* stacktraces can now show custom runtime msgs
* improve tests/stdlib/tstackframes.nim
* fix test for --gc:arc
* test --stacktraceMsgs:on and --stacktraceMsgs:off
* --stacktracemsgs:off by default
2020-03-30 13:45:32 +02:00
Andreas Rumpf
a6682de004 catchable defects (#13626)
* allow defects to be caught even for --exceptions:goto (WIP)
* implemented the new --panics:on|off switch; refs https://github.com/nim-lang/RFCs/issues/180
* new implementation for integer overflow checking
* produce a warning if a user-defined exception type inherits from Exception directly
* applied Timothee's suggestions; improved the documentation and replace the term 'checked runtime check' by 'panic'
* fixes #13627
* don't inherit from Exception directly
2020-03-12 23:44:33 +01:00
Clyybber
eae31a7f8d Only print the link command when listCmd is active; fix docs (#13603) 2020-03-07 23:53:43 +01:00
Andreas Rumpf
a0eca75182 sink parameter inference for types that have destructors (#13544)
* 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
2020-03-04 14:28:53 +01:00
Lee Matos
c11b91d52d Update advopt.txt to include link to nim cache docs (#13464) 2020-02-22 09:09:04 +01:00
Timothee Cour
7ec7731f82 fix #13150 nim doc --project now works reliably (#13223)
* fix #13150 `nim doc --project` works with duplicate names and with imports below main project file

* add to help; fixup after #13212 isRelativeTo got merged
* fix test tests/compilerapi/tcompilerapi.nim
* remove nimblePkg field; compute on the fly instead
* kochdocs: compiler docs now under compiler/
* --docRoot now has smart default: best among @pkg, @path
2020-02-06 11:17:00 +01:00
Timothee Cour
b462baed65 VM: allow overriding MaxLoopIterations without rebuilding nim (#13233) 2020-01-23 10:53:30 +01:00
Timothee Cour
e5ae7ceaa3 [easy] --hint🔗on now shows link cmd instead of nothing (#13056)
* --hint🔗on now shows link cmd instead of nothing

* update doc for --listCmd
2020-01-07 10:38:59 +01:00
Andreas Rumpf
c3344862b0 --exception:goto switch for deterministic exception handling (#12977)
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.
2020-01-01 10:01:49 +01:00
Andreas Rumpf
f7ba7c711a added the --asm command line option for inspection of the produced assember code (#12699) 2019-11-21 22:53:51 +01:00
Andy Davidoff
738c957e94 add --clearNimblePath; fixes #12601 (#12609) 2019-11-06 20:40:22 +01:00
Araq
0eae2217b6 first implementation of the new --seqsv2 switch 2019-10-20 08:11:07 +02:00
Ico Doornekamp
26676066cc added cpuTime to VM (#12346)
* added cpuTime to VM

* Hide VM-time cpuTime() behind --benchmarkVM flag
2019-10-04 19:32:16 +02:00
Hideki Okamoto
294d5fb560 Fixes #12010; Add the description for "cc" option into --fullhelp (#12350) 2019-10-04 19:30:20 +02:00
Andreas Rumpf
754531fff3 make --useVersion's documentation reflect reality 2019-09-16 23:54:31 +02:00
Andreas Rumpf
b07694cd90 new gensym handling (#11985)
* new .gensym implementation
* make astspec test green again
* introduce a --useVersion switch to group compatibility switches
* fixes #10180
* fixes #11494 
* fixes #11483
* object constructor fields and named parameters are also not gensym'ed
* disabled broken package
2019-08-23 16:15:02 +02:00
Arne Döring
44e7a7b6c2 Lock semchecked ast for macros (#11883) [bugfix]
* reject to modify type checked AST
* add flag to back out
* Introduce legacy feature set.
2019-08-08 16:57:06 +02:00
Araq
f45a1b927a documented --newruntime switch 2019-07-12 21:53:45 +02:00
Juan Carlos
aa7f23e1ee [bugfix] Fixes #11495 , Remove TinyC from help (#11508) 2019-06-17 11:03:18 +02:00
Araq
9ecb1aae80 new compiler feature: --expandMacro 2019-05-29 20:47:28 +02:00
Araq
279df834ba Nim is not a header file generator anymore; closes #4723 2019-05-22 15:13:26 +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
Miran
afeca3d9fe multi-methods need to be explicitly enabled (#10856)
* multi-methods need to be explicitly enabled

* update changelog, manual and tutorial
2019-03-18 08:21:37 +01:00