Commit Graph

74 Commits

Author SHA1 Message Date
Clyybber
76f93877cd Small parser loop fix (#17904)
* Fix loop on error with nim check in semiStmtList
* Add test
2021-04-30 17:17:29 +02:00
Timothee Cour
08262206d3 refs #15667 improve invalid indentation errors, report when & where = could be missing (#16397)
* refs #15667 improve invalid indentation errors

* also show line info where = is missing

* add test

* add more tests
2021-04-10 08:55:39 +02:00
Arne Döring
159c06e045 unify tuple expressions (#13793)
* 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>
2021-03-30 02:06:51 +02:00
hlaaftana
def1f99289 add finally as post expr block [backport:1.4] (#16896) 2021-02-01 20:14:20 +01:00
flywind
6d442a40a6 use doAssert in tests (#16486) 2020-12-28 14:13:21 +01:00
Clyybber
60ad95f799 Add testcase for invalid if statement (#15313) 2020-09-12 14:28:19 +02:00
Clyybber
1881fc5812 Fix #15305 (#15311)
* Fix #15305

* Fix test
2020-09-12 12:39:46 +01:00
Clyybber
f3552b86c1 Better semiStmtList parsing (#15123)
* Better semiStmtList parsing
* Add examples from forums and wiki
* Move parseIfExpr near parseIfOrWhen
* Update grammar
2020-09-09 07:36:31 +02:00
hlaaftana
de27910ab7 make from an operator (#14241) 2020-05-08 07:54:46 +02:00
Arne Döring
5b27b263fd Remove immediate pragma (#11308)
* remove immediate from tests
* remove immediate from the compiler
2019-05-29 22:21:51 +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
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
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
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
Arne Döring
1105d03644 require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
Andreas Rumpf
05683e3aab fixes #9633 2018-11-08 09:15:15 +01:00
Andreas Rumpf
8a357c270b parser change: 'not' is always a unary operator; fixes #9574 2018-11-07 21:17:52 +01:00
Araq
1fa22d4cfe removed the undocumented #? strongSpaces parsing mode 2018-11-06 13:55:03 +01:00
zah
96de224a63 Fix #8126 (#8712)
This is a temporary fix that will be reworked in a follow up commit
that aims to eliminate the tfExplicit flag from the compiler. The
complete and proper fix was considered too risky for inclusion just
before our 0.19 release.
2018-08-21 22:14:12 +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
Zahary Karadjov
8633b1b309 Starting test recording the current state of the parser
In the next commit, I'll introduce changes to the parser bringing
consistent handling of all type modifiers (ref, ptr, var, static
and type). The goal of this commit is to record precisely what is
going to be changed (i.e. by allowing you to look at the diff).

To preserve the diff, please don't squash upon merging.
2018-06-16 16:46:32 +03:00
Araq
02b78d3f94 make tests green again 2018-05-14 21:38:18 +02:00
Andreas Rumpf
cd0985df06 update the changelog 2018-05-06 08:17:32 +02:00
Andreas Rumpf
805402b294 fixes #7582 2018-05-05 14:17:31 +02:00
Arne Döring
6baca58693 Get symbol kind (#7491) 2018-04-11 16:48:01 +02:00
Oscar Nihlgård
d6793ded27 Fix parser bug with type classes (#7480) 2018-04-06 22:44:54 +02:00
Araq
212fdc5946 added the 'x.p[:T]' notation for explicit generic instantiations in combination with the ddot calling syntax 2018-04-06 22:05:57 +02:00
Arne Döring
5d46e1eaa2 Fixes #7473 (#7475)
* removed code duplication
* changelog entry, adopt tests for changes
2018-04-04 15:37:07 +02:00
Andreas Rumpf
2ad49836d9 make tests green again 2017-11-19 20:09:38 +01:00
Fabian Keller
40a6caeed8 Block expressions (#6695)
* enabled parsing of block expressions
* added test case; closes #3827
* adjusted grammar doc strings
* updated grammar in docs
2017-11-06 20:33:01 +01:00
Araq
742f43e572 fixes #6609; 'if' expressions support multiple statements; minor breaking change 2017-11-05 01:26:04 +01:00
Zahary Karadjov
7ad115f530 Restore the old behavior of parsing "quote do:"
close #5845
2017-08-19 08:57:43 +02:00
Arne Döring
000b8afd26 Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
Andreas Rumpf
503f780676 Merge branch 'zahary' into araq2 2017-05-16 17:32:18 +02:00
Araq
05c20bc4ff fixes a parser bug 2017-04-25 19:36:05 +02:00
Zahary Karadjov
8de19a7f4c fix a parsing regression (do is still mandatory in some situations) 2017-04-14 23:48:43 +03:00
Zahary Karadjov
e7eb01ed48 fix a parsing regression (calls with do inside param lists)
This treatment is applied only when "do" is used, because
the code foo(x: bar) is recognized as object construction.
2017-04-10 12:08:40 +03:00
Zahary Karadjov
9ffaee3f88 fully consisent parsing between the new and the old 'do blocks' 2017-04-10 11:44:02 +03:00
Andreas Rumpf
e21ca54b11 assignments support ': stmtList' like let/var do 2017-04-04 12:20:43 +02:00
Andreas Rumpf
a543b89bf8 language addition: colon-block for expressions in let/var context 2017-04-02 15:05:04 +02:00
Araq
10bd488daa implements #?braces syntax 2016-10-16 00:35:49 +02:00
Andreas Rumpf
0134a51a7c fixes critical 'do' parsing bug 2016-05-28 02:17:13 +02:00
Andreas Rumpf
3114523a6f fixes multi-line comments 2016-01-17 23:46:23 +01:00
Andreas Rumpf
71cf1f650e fixes multiline comments 2016-01-17 21:42:13 +01:00
Andreas Rumpf
2c2ab6884c fixes strutils.unescape; refs #3634 2016-01-17 21:29:25 +01:00
Araq
cd7b5ae1eb fixes #1799 properly 2015-10-25 02:35:18 +02:00
Peter Mora
75097e2981 sequtils related changes 2015-10-05 22:42:22 +02:00
Araq
31bbc24462 minor testsuite cleanup 2015-09-10 13:19:13 +02:00