Commit Graph

272 Commits

Author SHA1 Message Date
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
Andreas Rumpf
18a3833d60 more refactoring 2018-05-27 15:22:17 +02:00
Andreas Rumpf
669a564492 remove more global variables in the Nim compiler 2018-05-27 11:10:56 +02:00
Araq
2a7fc84c86 remove ast.emptyNode global; cleanup configuration.nim 2018-05-16 03:06:07 +02:00
Araq
02b78d3f94 make tests green again 2018-05-14 21:38:18 +02:00
Araq
5526252fa0 fixes testament compilation 2018-05-14 17:45:44 +02:00
Andreas Rumpf
61e57cfa13 big refactoring: parser compiles again 2018-05-10 10:49:51 +02:00
Zahary Karadjov
b0d85b0adf Backwards-compatible support for keyword arguments in the command syntax 2018-05-07 09:37:49 +02:00
Andreas Rumpf
b7116a28ee compiler refactoring, pass config around explicitly 2018-05-05 18:47:29 +02:00
Andreas Rumpf
1aa359febb warn about inconsistent spacing around binary operators; fixes #7582 2018-05-05 14:58:33 +02:00
Andreas Rumpf
805402b294 fixes #7582 2018-05-05 14:17:31 +02:00
Andreas Rumpf
33b69f0ed0 refactoring: make FileIndex a distinct type; make line information an uint16; fixes #7654 2018-04-21 08:13:37 +02:00
Araq
9bc963508f nimpretty: next steps 2018-04-18 21:30:38 +02:00
Andreas Rumpf
a30b52eb64 fixes #7610 2018-04-14 15:44:05 +02:00
Andreas Rumpf
47335aab41 introduce nkTupleConstr AST node for unary tuple construction; breaking change 2018-04-13 17:45:58 +02:00
Oscar Nihlgård
d6793ded27 Fix parser bug with type classes (#7480) 2018-04-06 22:44:54 +02:00