Commit Graph

287 Commits

Author SHA1 Message Date
Araq
4b0de0ca6f nimpretty: fixes #11616
(cherry picked from commit 6d8913ee14)
2019-07-19 16:47:36 +02:00
Araq
ddc02649a6 [refactoring] remove unused imports in the compiler and in some stdlib modules
(cherry picked from commit 07d465ca42)
2019-07-19 16:46:51 +02:00
Araq
694d57c899 styleCheck: make the compiler and large parts of the stdlib compatible with --styleCheck:error
(cherry picked from commit c94647aeca)
2019-07-15 07:58:45 +02:00
Araq
d13c75eb2f nimpretty: nimpretty now understands splitting newlines
(cherry picked from commit a59f0adc50)
2019-07-08 11:27:15 +02:00
Miran
38aa7f6d20 [bugfix] fix #11469, new rules for a newline in nimpretty (#11512)
* [bugfix] fix #11469, new rules for a newline in nimpretty
* concatenate two lines if they have the same indentation level

(cherry picked from commit f288e1b11a)
2019-06-27 20:59:46 +02:00
Araq
7bfde5fa40 [bugfix] nimpretty: fixes #11468
(cherry picked from commit af39f26a3a)
2019-06-16 17:18:58 +02:00
Andreas Rumpf
caf93f4355 nimpretty: smart tabs support, fixes #9399 [bugfix] 2019-06-10 10:50:15 +02:00
Araq
447cc1ff09 nimpretty: fixes #10295 2019-06-07 10:37:00 +02:00
cooldome
7d8af25d58 revert parser stmtListExpr (#11007)
* Revert "Support for stmtListExpr in parser after major keywords. Scaled down version. (#10852)"

This reverts commit 862897dc0f.

* redo fix for #4035

* render stmtlistExpr using semicolon

* Revert "render stmtlistExpr using semicolon"

This reverts commit cafb78b8d5.

* revert test
2019-04-17 11:55:41 +02:00
Miran
f309e4ff54 relax warning about inconsistent spacing (#10968)
Now the warning is raised only in the cases when there is an
inconsistency in the style (spacing vs no spacing):
* if a> b      --> warning
* if a >   b   --> no warning
2019-04-05 12:37:33 +02:00
Andreas Rumpf
8e1c6e2e2d fixes #10896 (#10903) 2019-03-25 19:26:38 +01:00
cooldome
28a926cb67 fixes #10861 (#10877) 2019-03-21 06:48:54 +01:00
Andrii Riabushenko
67e91558cf REVERT "optPar"
This reverts commit 5f1a59216b.
2019-03-21 00:45:21 +00:00
Andrii Riabushenko
5f1a59216b optPar 2019-03-21 00:17:52 +00:00
cooldome
862897dc0f Support for stmtListExpr in parser after major keywords. Scaled down version. (#10852)
* Support for stmtListExpr in parser after major keywords
* fixes #4035
2019-03-18 11:09:49 +01:00
cooldome
c19cd14fc9 fixes #10838 (#10841)
* fixes #10838
* reject func in types instead
* trigger tests
2019-03-18 11:04:01 +01:00
Neelesh Chandola
9884129058 Tuple unpacking now works for for vars (#10152)
* Tuple unpacking now works for `for` vars
* Give error if length of tuple vars != length of tuple
* Fix error message showing wrong tuple length
* unpacking now works now for mutable items
* Update changelog
2019-02-23 14:01:34 +01:00
Andreas Rumpf
dee8e6e98a gc: destructors is beginning to work (#10483)
* kochdocs.nim: code cleanup
* docgen: nicer indentation
* parser.nim: code cleanup
* fixes #10458
* make tests green again
* make =destroy mixins
* gc:destructors: produced C code is almost working
* --gc:destructors simple program compiles (but leaks memory)
* gc:destructors make examples compile in C++ mode
* destructors: string implementation bugfixes
* strs.nim: minor code cleanup
* destructors: builtin seqs are beginning to work
* remove debugging helpers
2019-01-29 15:12:16 +01:00
alaviss
413755fd45 Correct lineinfo for accent quoted symbols in proc definition (#10399)
* compiler/parser: preserve lineinfo for accent quoted symbols

Previously the lineinfo for symbol $$$ in this example is:

    proc `$$$`
             ^

After this commit:

    proc `$$$`
          ^

* compiler/semstmts: correct lineinfo for accent quoted idents

Previously nimsuggest would highlight this as:

    proc `$$$`
         ^~~

After this commit:

    proc `$$$`
          ^~~

* nimsuggest/tests: add a test for accent quoted proc

Disabled by default
2019-01-21 16:57:48 +01:00
Neelesh Chandola
9faad7591e Deprecate gc v2 (#10151)
* Deprecate gc v2

* warnDeprecated now has custom messages
2019-01-01 13:50:48 +01:00
Neelesh Chandola
c5ad4c10cb Deprecated pragma is now supported on enum fields (#10113)
* {.deprecated.} pragma is now supported for enum fields
* Add tests
* Simplify code
2018-12-30 09:43:59 +01:00
Neelesh Chandola
05b8085a87 Pragma syntax is now consistent (#9993)
* Give deprecation warning when type pragmas do not follow the type name
* pragma before generic parameter list in type definition is now deprecated
* Update changelog
* Fix bug where deprecated warning was being shown even though no generic param list was present
* Fix bug
* Use errGenerated
* Best attempt at writing the grammar
2018-12-27 22:38:24 +01:00
Andreas Rumpf
3300c8a500 much simpler implementation of constant tuple declarations 2018-12-19 11:11:33 +01:00
Neelesh Chandola
8e90ed0618 Const tuple unpacking (#9964)
* tuple unpacking is now supported for consts

* Move nkConstTuple to the end of TNodeKind

* Add nnkConstTuple in macros.nim

* Fix Formatting
2018-12-19 10:52:41 +01:00
Andreas Rumpf
d1fe195dcc nimpretty: explicit --indent option; fixes #9502; refs #9510 [backport] 2018-11-11 10:39:20 +01:00
Andreas Rumpf
3cf3c2d722 er... 'a not b' is an infix call 2018-11-08 09:39:27 +01:00
Andreas Rumpf
5845716df8 fixes parsing regressions; binary 'not' for 'not nil' must stay 2018-11-08 09:15:15 +01:00
Andreas Rumpf
05683e3aab fixes #9633 2018-11-08 09:15:15 +01:00
Andreas Rumpf
4e94f49065 parser/grammar sync; fixes #9608 [backport] 2018-11-07 20:07:43 +01:00
Araq
c735b75f6f compiler cleanup: flag tfOldSchoolExprStmt is gone 2018-11-06 13:55:03 +01:00
Araq
1fa22d4cfe removed the undocumented #? strongSpaces parsing mode 2018-11-06 13:55:03 +01:00
Dominik Picheta
8d9866a6d4 Maps out keyword to an nnkIdent. Fixes #6011. (#9536) 2018-10-29 16:33:56 +01:00
Andreas Rumpf
f3c0703b7d nimpretty: add #!nimpretty on/off directives 2018-10-16 16:55:04 +02:00
Andreas Rumpf
ed38079b9b nimpretty: fixes #8626 2018-10-16 16:55:04 +02:00
Dheepak Krishnamurthy
70018aa683 Add checks for except: body blocks (#9191) 2018-10-09 14:09:22 +02:00
Andreas Rumpf
a622291be4 parser.nim: minor code style fix 2018-09-16 21:33:08 +02:00
Araq
5709736e82 Merge branch 'devel' into araq-better-docgen 2018-09-14 15:48:07 +02:00
Andreas Rumpf
f7d1902043 fixes merge conflicts 2018-09-11 17:27:47 +02:00
Andreas Rumpf
86556ebfdb compiler refactoring; use typesafe path handing; docgen: render symbols between modules 2018-09-07 19:21:16 +02:00
cooldome
c033ff990a Renderer bug fixes (#8804)
Fixes #8763: render bug: pure enums not handled correctly
Fixes #8762: render bug: binary operators called with quotes rendered incorrectly
FIxes #8761: render bug: inversion of operator priorities
2018-09-07 01:52:42 +02:00
Iván Montes
e66d9c9381 Cosmetic: fix typo on TRIPLESTR_LIT (#8663) 2018-08-21 22:17:19 +02:00
Andreas Rumpf
dae5450947 WIP: disallow 'nil' for strings and seqs 2018-08-13 11:41:33 +02:00
cooldome
ec02940185 Render bug: if expression with statement list expression as condition (#8375)
* Fixes #8348
2018-07-21 13:01:47 +02:00
Andreas Rumpf
2a3a128e36 Merge branch 'devel' into typedesc-reforms 2018-06-26 18:33:51 +02:00
Andreas Rumpf
dd81d9d5b7 nimpretty improvements 2018-06-19 09:42:33 +02:00
Andreas Rumpf
c70706f4bd nimpretty: fixes pragma rendering 2018-06-17 14:15:42 +02:00
Zahary Karadjov
a49b06a52a Implement the is operator for the new static and typedesc type classes
This also makes the first baby steps towards a sound treatment of
higher-order kinds (type type int).

Adds test cases showcasing the new features.

* Also fixes breakage after the rebase
2018-06-16 16:46:32 +03:00
Zahary Karadjov
fb27357b62 A minimal patch enabling the new typedesc and static types syntax 2018-06-16 16:46:32 +03:00
Andreas Rumpf
7819e63f77 nimpretty: more features 2018-06-16 09:53:36 +02:00
Andreas Rumpf
a1bd4a6cbd nimpretty: first version that seems useful for others to test it 2018-06-16 01:46:39 +02:00