summary refs log tree commit diff stats
path: root/compiler/renderer.nim
Commit message (Collapse)AuthorAgeFilesLines
* fixes #19396; Nimdoc hide nonexported fields (#21305)ringabout2023-02-011-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * suppresses non-exported fields of types and adds command-line option to re-enable this if desired * corrected the doctest that produced a CI error * an embarrassingly bad error in reasoning * modified a nimdoc test to reflect updated behavior * needed another change to bring utils.html doctest in sync with update * add info * fix nimdoc * lint * render postfix * fixes a problem * fixes nimdoc * fix nimdoc --------- Co-authored-by: johnperry-math <john.perry@usm.edu> Co-authored-by: johnperry-math <devotus@yahoo.com>
* remove legacy code (#21134)ringabout2022-12-261-4/+3
| | | | | * remove legacy code * fixes
* Make async stacktraces less verbose (#21091)Jake Leahy2022-12-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | * Name iterators something human readable Remove intermediate async procs from stacktraces Clean async traceback message from reraises message * Remove unused import/variable * Fix failing tests Don't add {.stackTrace: off.} to anonymous procs (They already don't appear in stacktrace) * Fix failing tests in pragma category Now check that the nim is a routine type first so we don't run into any assertion defects * Hide stack trace pragma in docs and update doc tests User doesn't need to know if something won't appear so this more becomes verbose noise If this is a bad idea we can always add a `when defined(nimdoc)` switch so we don't add {.stackTrace: off.} to the Future[T] returning proc for docs
* Docs expand `using` parameters (#21076)Jake Leahy2022-12-121-4/+29
| | | | | | | | | | | | | | | * Trying to fix by changing renderer * add renderExpandUsing flag This flag makes the renderer expand parameters that use using statement to have their full type * Update docs * Make comment better explain why checking for nkSym * Fix nil access when macro/template has parameter with no type * Fix nil access when node is not semmed yet
* alternative, much simpler algorithm for strict func checking (#21066)Andreas Rumpf2022-12-111-1/+5
| | | | | | | | | | | | | * alternative, much simpler algorithm for strict func checking * forgot to git add new compiler module * new spec is incredibly simple to describe * fixes bigints regression * typos * closes #16305; closes #17387; closes #20863
* render post expr blocks better (#20871)metagn2022-11-221-23/+42
| | | | | | | * render post expr blocks * remove pointless diff * fix PR split mistake
* fixes #20572 (#20585)Andreas Rumpf2022-10-171-1/+6
| | | | | * fixes #20572 * added a test case
* fixes #20524; add forbids pragmas to hideable lists (#20525)ringabout2022-10-091-1/+1
| | | | | * fixes #20524; add forbids pragmas to hideable lists * fixes nimdoc
* DAA and 'out' parameters (#20506)Andreas Rumpf2022-10-061-3/+9
| | | | | | | | | | | * DAA and 'out' parameters * progress * documented strictDefs and out parameters * docs, tests and a bugfix * fixes silly regression
* moderate system cleanup & refactor (#20355)metagn2022-09-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* move formatfloat out of system (#20195)ringabout2022-08-241-1/+1
| | | | | | | | | | | | | | | * move formatfloat out of system * fixes doc * Update changelog.md * careless * fixes * deprecate system/formatfloat * better handling
* fix NimNode comment repr() regression [backport: 1.2] (#19726)flywind2022-04-251-0/+2
|
* move assertions out of system (#19599)flywind2022-03-231-0/+3
|
* fix wrong name (rnimsyn => renderer; pnimsyn => parser; scanner => lexer) ↵flywind2021-09-251-2/+2
| | | | | | | (#18895) * fix wrong module name * rephrase more word
* properly fix #10053 ; `FieldDefect` msg now shows discriminant value + ↵Timothee Cour2021-08-131-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lineinfo, in all backends (c,vm,js) (#11955) * fix #10053 FieldError for vm * fixup * FieldError now also shows runtime value of discriminant * fix field error reporting in vm * also report culprit line info in err msg * fix errors for newruntime 2 * fix for js * fixup * PRTEMP4 * works * works * works perfect * refactor * std/private/repr_impl * suppport --gc:arc * cleanup * refactor * simplify * simplify * simplify * fixup * move out compiler.vmgen.genCustom * fixup * fixup * add tests * revert compiler/debugutils.nim * simplify reprDiscriminant * fixup * lib/std/private/repr_impl.nim -> lib/system/repr_impl.nim * try to fix D20210812T165220 * honor --declaredlocs * control toFileLineCol via --declaredlocs
* nim doc now correctly renders deprecated pragmas for routines and types (#18515)Timothee Cour2021-07-191-2/+2
|
* fixes #15884 (#18230)Andreas Rumpf2021-06-101-0/+2
| | | | | * fixes #15884 * micro optimization
* Remove confusing <//> (#17830)flywind2021-04-261-4/+1
|
* refs #17292 fix `repr`: `(discard)` now does't render as `discard` which ↵Timothee Cour2021-04-161-1/+7
| | | | | | | gave illegal code (#17455) * refs #17292 fix `repr` with (discard) * add tests * add more tests
* make repr handle setters `foo=` (#17683)Timothee Cour2021-04-091-5/+8
|
* ast: add getPIdent (#17684)Timothee Cour2021-04-091-11/+9
| | | | | * ast: add getPIdent * fixup
* fix #14850: `repr` now correctly renders `do` (#17623)Timothee Cour2021-04-031-7/+13
| | | | | | | * fix #14850: `repr` now correctly renders `do` * add tests * fix test
* repr: fix rendering of `'big`, `=destroy` etc (#17624)Timothee Cour2021-04-031-3/+19
|
* docgen: render pragmas by default except for a select list (and fix #9074) ↵Timothee Cour2021-04-011-1/+21
| | | | (#17054)
* unify tuple expressions (#13793)Arne Döring2021-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * unify tuple expressions * fix test * fix test * apply feedback * Handle empty tuples * Fix rendering named unary tuple * Protect static NimNode against stripping * Slightly less hacky * Revert "Slightly less hacky" This reverts commit 170c5aec0addc029f637afbc948700ca006b7942. * Slightly less hacky * Cleanup * Fix test * Fix another test * Add condsym * Rebase fallout * changelog: Move from compiler changes to language changes * Add stricter tests * Add empty tuple example to doc/astspec * Fix test Co-authored-by: Clyybber <darkmine956@gmail.com>
* added nkError to the AST (#17567)Andreas Rumpf2021-03-291-0/+4
| | | | | | | | | | | | | * 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>
* custom integer literals (#17489)Andreas Rumpf2021-03-241-4/+14
| | | | | | | * user defined integer literals; refs #17020 * updated renderer.nim * use mlexerutils helper * imported all test cases from https://github.com/nim-lang/Nim/pull/17020 * final grammar updated
* refs #17292 fix `repr` with `do:` (#17449)Timothee Cour2021-03-231-3/+10
| | | | | * refs #17292 fix `repr` with `do:` * address comment
* Fix #14325 (#17308)Clyybber2021-03-111-2/+2
| | | | | * Fix #14325 * Refactor and fix
* fix #13491 #17279 runnableExamples now don't get lost in translation (#17282)Timothee Cour2021-03-091-1/+1
| | | | | * fix #13491 runnableExamples rendering * fix a runnableExamples thanks to this bugfix
* Use nicer escape sequences in renderer.nim (#17239)Clyybber2021-03-021-11/+11
|
* ARC Analysis in one pass v3 (#17068)Clyybber2021-02-171-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Analyse last reads all at once * Integrate firstWrite analysis * Small cleanup * Use sets instead of seqs * Remove instrTargets * Reap the benefits * Implement error diagnostics * Operate on DFA index for lastRead analysis * Use mgetOrPut * Cache alias results This improves performance by a lot, since many CFG locations map to a single PNode * Improve performance * Improve performance * Cleanup * Fix #17025 * Grammar * Expand testcase
* Revert "ARC: Analysis in one pass v2 (#17000)" (#17046)Clyybber2021-02-151-9/+9
| | | This reverts commit 216be4060a853b3425501318537d598c4842eefc.
* ARC: Analysis in one pass v2 (#17000)Clyybber2021-02-101-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Analyse last reads all at once * Integrate firstWrite analysis * Small cleanup * Use sets instead of seqs * Remove instrTargets * Reap the benefits * Implement error diagnostics * Operate on DFA index for lastRead analysis * Use mgetOrPut * Cache alias results This improves performance by a lot, since many CFG locations map to a single PNode * Improve performance * Improve performance * Cleanup
* Revert "ARC Analysis in one pass (#16849)" (#16984)Clyybber2021-02-091-9/+9
| | | This reverts commit ab740cb5b9bfbacece26956fa2444763a790ccd1.
* ARC Analysis in one pass (#16849)Clyybber2021-02-091-9/+9
| | | | | | | | | | | | | | | | | | | * Analyse last reads all at once * Integrate firstWrite analysis * Small cleanup * Use sets instead of seqs * Remove instrTargets * Reap the benefits * Implement error diagnostics * Operate on DFA index for lastRead analysis * Use mgetOrPut
* close #16844 (#16852)flywind2021-01-291-0/+14
| | | | | | * close #16844 * better * comment * Update compiler/renderer.nim
* Correct all eggs (#15906)Miran2020-11-101-1/+1
| | | | * "eg" is a misspelled "egg", "e.g." is "exempli gratia" * Also, "ie" is "i.e.".
* Use modern enums in compiler (#15775)cooldome2020-11-021-1/+1
|
* fixes a regressionAraq2020-10-081-10/+18
|
* docgen: improve alignment of comments (still not perfect) (#15506)Andreas Rumpf2020-10-071-1/+1
| | | | | | | * docgen: improve alignment of comments (still not perfect) * fix error message text in `tunknown_named_parameter` Co-authored-by: narimiran <narimiran@disroot.org>
* implements https://github.com/nim-lang/RFCs/issues/258 (#15503)Andreas Rumpf2020-10-061-3/+4
| | | | | | | | | * 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
* renderer: use the biggest integer type for masking literals (#15482)alaviss2020-10-041-1/+1
| | | | | | | | On 32-bit system the mask would have a size of 32-bit, which is smaller than the BiggestInt (usually 64-bit) it was masked against. For some reason this only affect 32-bit Windows but not 32-bit Linux. Might just be a difference in how gcc handle out of bound shifts for Windows and Linux.
* borrow checking (#15282)Andreas Rumpf2020-09-091-1/+8
| | | | | | | | | | | * refactoring: move procs to typeallowed.nim * frontend preparations for first class openArray support * prepare the code generator for first class openArray * code generation for first class openArray; WIP * code generation for open arrays, progress * added isViewType proc * preparations for borrow checking * added borrow checking to the front end
* Big compiler Cleanup (#14777)Clyybber2020-08-281-14/+14
|
* Show that a variable is cursor in --expandArc (#15002)Clyybber2020-07-171-0/+2
|
* An optimizer for ARC (#14962)Andreas Rumpf2020-07-151-3/+18
| | | | | | | | | | | | | | | | | | | | * 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>
* renderer.nim: more obvious debug outputAraq2020-07-101-1/+11
|
* init checks and 'out' parameters (#14521)Andreas Rumpf2020-06-231-4/+4
| | | | | | | | | | | * 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
* Implement rendering of `[]=`, `{}`, `{}=` braces (#14539)cooldome2020-06-011-16/+54
| | | | | | | * render curly braces * fix typo * fix test Co-authored-by: cooldome <ariabushenko@bk.ru>