Commit Graph

191 Commits

Author SHA1 Message Date
Zahary Karadjov
74a80988d9 proper error reporting for concepts and the introduction of the {.explain.} pragma 2017-03-24 16:59:47 +02:00
Zahary Karadjov
815724db71 support the full range of type modifiers when declaring concept vars and testing proc signatures 2017-03-24 16:58:15 +02:00
Andreas Rumpf
b414806e66 nimsuggest: suggest types in a type section 2017-03-14 11:21:35 +01:00
Araq
556b564c7d nimsuggest: make tests green again 2017-03-10 00:18:24 +01:00
Araq
1887390b0f nimsuggest: fixes nimsuggest bug #45; do not show suggestions in string literals or comments 2017-03-08 12:53:21 +01:00
Araq
2589d69ed2 fixes #5430 2017-02-26 00:32:07 +01:00
Araq
773d17cd14 big refactoring: step 1 2016-10-31 15:34:44 +01:00
Araq
10bd488daa implements #?braces syntax 2016-10-16 00:35:49 +02:00
Jacek Sieka
3cd4cf4320 remove unused stuff 2016-08-09 22:54:27 +08:00
Andreas Rumpf
39ebe2175b compiler almost free of deprecated expr/stmt names 2016-07-30 16:34:42 +02:00
Andreas Rumpf
60b187513e stdlib and compiler don't use .immediate anymore 2016-07-29 23:51:01 +02:00
Andreas Rumpf
11b499f3ca prepare for #3898 2016-07-15 15:40:26 +02:00
Andreas Rumpf
0134a51a7c fixes critical 'do' parsing bug 2016-05-28 02:17:13 +02:00
Andreas Rumpf
4869d4e82a fixes #4036 2016-04-04 10:28:18 +02:00
Andreas Rumpf
c9966a3e17 use 'using' instead of 'sig' keyword; cleans up new features a bit 2016-02-29 12:19:54 +01:00
Andreas Rumpf
0baa1d9955 first version of .partial objects 2016-02-28 23:22:47 +01:00
Andreas Rumpf
38dee2095c added 'sig' feature; removed tfShared support in the compiler 2016-02-28 19:56:41 +01:00
Andreas Rumpf
2e71bd50b2 implements multi-line-comments; pounds are stripped from the doc comments 2016-01-16 21:40:54 +01:00
Andreas Rumpf
46f1f41cc9 finally removes 'echo ' gotcha 2016-01-15 11:34:52 +01:00
Araq
5fe71db6d9 'out T' is an alias for 'var T' 2015-11-26 17:46:05 +01:00
Araq
cd7b5ae1eb fixes #1799 properly 2015-10-25 02:35:18 +02:00
Araq
5206c310e6 fixes #1799 2015-10-25 01:26:08 +02:00
Adam Strzelecki
b0db8126a5 Parser: Inline expr pragmas with parenthesis
Previously pragmas could be attached only to whole statements, this change
allows attaching pragmas to inline statements, eg.:

  template rewriteAdd{a + b}(a: expr, b: expr): expr =
    ({.noRewrite.}: a + b) + 1

Code above will cause a + b to be rewritten once, because rewriteAdd attaches
{.noRewrite.} to resulting a + b expr.
2015-06-02 21:58:14 +02:00
Adam Strzelecki
2f5ed17cfe Parser: Properly represent parsePar in grammar 2015-06-02 21:53:46 +02:00
Araq
9e4e7ca535 fixes #2533 2015-04-24 12:36:41 +02:00
Andreas Rumpf
6a016743aa Merge pull request #2566 from nanoant/parser-diagnostic-location
Parser: Fix location (line, col) for diagnostics
2015-04-24 12:33:11 +02:00
Adam Strzelecki
07b13251d1 Parser: Fix location (line, col) for diagnostics
Previously parser was using lexMessage which was taking location from current
buffer position which was pointing after recently consumed token. But since
parser shows diagnostics about that token it should point to the location where
token starts.

This makes diagnostics like: `test.nim(2, 2) Error: ':' expected` point
properly at the beginning of the wrong token.
2015-04-21 11:32:13 +02:00
Adam Strzelecki
0da4d6b755 Parser: Make exprList() not comsume endToken
This makes use single comcol or eat for multiple cases. Also this makes
exprList responsible for consuming only list of expressions, nothing else which
is more logical.

As a side-effect compiler is now more consistent about errors, eg.:

    try # <- missing something
      echo "try"
    finally:
      echo "finally"

Triggers: test.nim(2, 6) Error: ':' expected

    try:
      echo "try"
    finally # <- missing something
      echo "finally"

Previously triggered: test.nim(4, 6) Error: invalid indentation

But now we got: Error: ':' expected - same as in 1st case
2015-04-20 21:06:03 +02:00
Adam Strzelecki
8a6df889d0 Parser: Use colcom(...) when possible
This make parsing obligatory colon more consistent across the parser's code.
2015-04-20 21:06:03 +02:00
Araq
2b4e233510 Merge branch 'devel' of https://github.com/Araq/Nim into devel 2015-04-20 11:44:54 +02:00
Araq
9abfc60db4 parse 'of' branches for macros properly 2015-04-19 14:25:16 +02:00
Andreas Rumpf
b4e938ca21 Merge pull request #2503 from ReneSac/arrowLike
Restrict arrow-like operators to those ending with `->`, `~>` or `=>`
2015-04-15 19:24:44 +02:00
ReneSac
06617bbb76 Minor fixes for arrow like change patch
Don't use ^ operator yet for compatibility with older compilers.
Moved arrow like explanation, and fix precedence description on the text in the manual.
Fixed typo in news.
2015-04-11 17:22:09 -03:00
ReneSac
34997292f4 Changing the rule for arrow like operators again. 2015-04-10 23:59:17 -03:00
Araq
10c1d7f519 minor lexer cleanups; fixes #2504 2015-04-10 14:03:48 +02:00
ReneSac
f15b4ccb52 Restrict arrow-like operators to start with - or = 2015-04-09 17:00:11 -03:00
ReneSac
80050a09a0 Refactored getPrecedence() after last change
The considerStrongSpaces() is now applied to almost all results, so it is better to do it at the end.
2015-04-08 02:06:18 -03:00
ReneSac
6a528bc7e9 Consider #!strongSpaces for keyword operators too.
When #!strongSpaces is on, every  operator affected by it gains priority higher than any operator not affected by it. This includes comparison operators, addition, etc.
It seems that counting spaces for keywords operators don't break anything in the parser. Of course, they can't have 0 spaces between their operands, but at least their precedence will work accordingly to their 1+ spaces.
2015-04-08 01:00:14 -03:00
Araq
e80840c40a preparations for dealing with the 'echo $foo' gotcha 2015-03-27 02:14:27 +01:00
Araq
e680e43fc2 fixes #2405 2015-03-25 14:50:08 +01:00
Araq
f6ff01572e breaking change: 'concept' is now a keyword and used instead of 'generic' 2015-03-23 13:10:18 +01:00
Araq
ca6906d85b fixes long standing parsing issue with command syntax 2015-03-22 01:38:14 +01:00
Araq
08c0ba379a fixes #1805 2015-03-21 20:38:28 +01:00
Max Zerzouri
9c126282b2 interpret tuple as a class and tuple[] as the empty tuple
When the indentation syntax is allowed it is always interpreted as a
tuple:

type
  Unit = tuple
2015-03-06 12:20:15 +13:00
Araq
ece23d39bc fixes #2123 2015-02-14 18:11:52 +01:00
Araq
c91ca82a43 fixes #2073; language spec change: arrow like operators are not right associative anymore 2015-02-08 13:38:06 +01:00
Araq
fe30ec83e2 nimsuggest improvements 2015-01-30 03:04:45 +01:00
Araq
26b853923c nimsuggest: first version 2015-01-27 01:36:19 +01:00
Araq
c87f1eb581 'discard' can be used instead of 'nil' for empty case object branches 2015-01-12 02:00:36 +01:00
Guillaume Gelin
3119fe087d Happy new year! 2015-01-06 15:26:33 +01:00