summary refs log tree commit diff stats
path: root/compiler/renderer.nim
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* fix #14174 do not collapse pragma inside runnableExamples (#14385)Timothee Cour2020-05-181-1/+1
|
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-2/+2
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* fix several bugs with `repr` (#13386)Timothee Cour2020-02-111-4/+8
|
* fix #12740 (#12774)Arne Döring2019-12-041-7/+16
| | | | | | | | | | * fix #12740 * A different kind of a hack * proper fix * fix typo
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-191/+181
| | | | | | | | | | | | | | | | | | * 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
* .cursor implementation (#12637)Andreas Rumpf2019-11-121-0/+2
| | | | | | | | | | | * 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
* make renderIds work againAndreas Rumpf2019-11-011-2/+3
|
* renderer letAux fix only for octal literal (#12343)Ridho Pratama2019-10-081-5/+8
| | | | | | | | * renderer letAux fix only for octal literal * Handle when it's octal -1 for i64 * Added testcases
* render typeof as typeofAndreas Rumpf2019-10-071-2/+2
|
* Small ast.nim cleanup (#12156)Clyybber2019-09-091-32/+32
| | | | | * Remove sonsLen * Use Indexable
* fixes #12029; finish the 'unused import' feature (#12064)Andreas Rumpf2019-08-271-0/+5
|